Server Test

Server Test

rev. 9f5fb9826a6af51ebfb3736d0a778b00ec7b08b3

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 +41227,42040 @@
    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`"
  172         -
                        );
  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)
         365  +
                        ::pretty_assertions::assert_eq!(input, expected);
         366  +
                        let response = crate::output::TestNoPayloadOutput {
         367  +
                            test_id: ::std::option::Option::None,
         368  +
                        };
         369  +
                        response
  252    370   
                    };
  253    371   
                    sender.send(()).await.expect("receiver dropped early");
  254    372   
                    result
  255    373   
                }
  256    374   
            })
  257    375   
            .build_unchecked();
  258    376   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
  259    377   
            .await
  260    378   
            .expect("unable to make an HTTP request");
  261         -
        assert!(receiver.recv().await.is_some());
         379  +
        assert!(
         380  +
            receiver.recv().await.is_some(),
         381  +
            "we expected operation handler to be invoked but it was not entered"
         382  +
        );
  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| {
  636         -
                            let sender = sender.clone();
  637         -
                            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         -
                                ]
  670         -
                            );
  671         -
                            ret
  672         -
                        }
  673         -
                    )
  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         -
                ,
  729         -
            }
  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         -
            }
  757         -
        ;
  758         -
        Ok(response) };
  759         -
                                sender.send(()).await.expect("receiver dropped early");
  760         -
                                result
  761         -
                            }
  762         -
                        })
  763         -
                        .build_unchecked();
         579  +
            .test_payload_blob(move |input: crate::input::TestPayloadBlobInput| {
         580  +
                let sender = sender.clone();
         581  +
                async move {
         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();
  764    601   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
  765    602   
            .await
  766    603   
            .expect("unable to make an HTTP request");
  767         -
        assert!(receiver.recv().await.is_some());
         604  +
        assert!(
         605  +
            receiver.recv().await.is_some(),
         606  +
            "we expected operation handler to be invoked but it was not entered"
         607  +
        );
  768    608   
    }
  769         -
    /// Supports handling Infinity float query values.
  770         -
    /// Test ID: RestJsonSupportsInfinityFloatQueryValues
         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,
         669  +
                )
         670  +
            },
         671  +
        );
         672  +
        TestPayloadStructureInputFuture {
         673  +
            inner: Box::pin(fut),
         674  +
        }
         675  +
    }
         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
  771    699   
    #[::tokio::test]
  772         -
    async fn rest_json_supports_infinity_float_query_values_request() {
         700  +
    #[::tracing_test::traced_test]
         701  +
    async fn rest_json_http_with_empty_structure_payload_request() {
  773    702   
        #[allow(unused_mut)]
  774    703   
        let mut http_request = http::Request::builder()
  775         -
            .uri("/AllQueryStringTypesInput")
  776         -
            .method("GET")
         704  +
            .uri("/payload")
         705  +
            .method("POST")
         706  +
            .header("Content-Type", "application/json")
  777    707   
            .body(::aws_smithy_http_server::body::Body::from(
  778         -
                ::bytes::Bytes::from_static("".as_bytes()),
         708  +
                ::bytes::Bytes::from_static("{}".as_bytes()),
  779    709   
            ))
  780    710   
            .unwrap();
  781         -
        *http_request.uri_mut() = "/AllQueryStringTypesInput?Float=Infinity&Double=Infinity"
  782         -
            .parse()
  783         -
            .unwrap();
  784    711   
        #[allow(unused_mut)]
  785    712   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
  786    713   
        let config = crate::service::RestJsonConfig::builder().build();
  787    714   
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
  788         -
                        .all_query_string_types(move |input: crate::input::AllQueryStringTypesInput| {
  789         -
                            let sender = sender.clone();
  790         -
                            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) };
  912         -
                                sender.send(()).await.expect("receiver dropped early");
  913         -
                                result
  914         -
                            }
  915         -
                        })
  916         -
                        .build_unchecked();
         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  +
                    };
         738  +
                    sender.send(()).await.expect("receiver dropped early");
         739  +
                    result
         740  +
                }
         741  +
            })
         742  +
            .build_unchecked();
  917    743   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
  918    744   
            .await
  919    745   
            .expect("unable to make an HTTP request");
  920         -
        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  +
        );
  921    750   
    }
  922         -
    /// Supports handling -Infinity float query values.
  923         -
    /// Test ID: RestJsonSupportsNegativeInfinityFloatQueryValues
         751  +
    /// Serializes a payload targeting a structure
         752  +
    /// Test ID: RestJsonTestPayloadStructure
  924    753   
    #[::tokio::test]
  925         -
    async fn rest_json_supports_negative_infinity_float_query_values_request() {
         754  +
    #[::tracing_test::traced_test]
         755  +
    async fn rest_json_test_payload_structure_request() {
  926    756   
        #[allow(unused_mut)]
  927    757   
        let mut http_request = http::Request::builder()
  928         -
            .uri("/AllQueryStringTypesInput")
  929         -
            .method("GET")
         758  +
            .uri("/payload")
         759  +
            .method("POST")
         760  +
            .header("Content-Type", "application/json")
  930    761   
            .body(::aws_smithy_http_server::body::Body::from(
  931         -
                ::bytes::Bytes::from_static("".as_bytes()),
         762  +
                ::bytes::Bytes::from_static("{\"data\": 25\n}".as_bytes()),
  932    763   
            ))
  933    764   
            .unwrap();
  934         -
        *http_request.uri_mut() = "/AllQueryStringTypesInput?Float=-Infinity&Double=-Infinity"
  935         -
            .parse()
         765  +
        #[allow(unused_mut)]
         766  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
         767  +
        let config = crate::service::RestJsonConfig::builder().build();
         768  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
         769  +
            .test_payload_structure(move |input: crate::input::TestPayloadStructureInput| {
         770  +
                let sender = sender.clone();
         771  +
                async move {
         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  +
                    };
         792  +
                    sender.send(()).await.expect("receiver dropped early");
         793  +
                    result
         794  +
                }
         795  +
            })
         796  +
            .build_unchecked();
         797  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
         798  +
            .await
         799  +
            .expect("unable to make an HTTP request");
         800  +
        assert!(
         801  +
            receiver.recv().await.is_some(),
         802  +
            "we expected operation handler to be invoked but it was not entered"
         803  +
        );
         804  +
    }
         805  +
    /// Serializes an request with header members but no payload
         806  +
    /// Test ID: RestJsonHttpWithHeadersButNoPayload
         807  +
    #[::tokio::test]
         808  +
    #[::tracing_test::traced_test]
         809  +
    async fn rest_json_http_with_headers_but_no_payload_request() {
         810  +
        #[allow(unused_mut)]
         811  +
        let mut http_request = http::Request::builder()
         812  +
            .uri("/payload")
         813  +
            .method("POST")
         814  +
            .header("Content-Type", "application/json")
         815  +
            .header("X-Amz-Test-Id", "t-12345")
         816  +
            .body(::aws_smithy_http_server::body::Body::from(
         817  +
                ::bytes::Bytes::from_static("{}".as_bytes()),
         818  +
            ))
  936    819   
            .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| {
  942         -
                            let sender = sender.clone();
  943         -
                            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
 1067         -
                            }
 1068         -
                        })
 1069         -
                        .build_unchecked();
 1070         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 1071         -
            .await
 1072         -
            .expect("unable to make an HTTP request");
 1073         -
        assert!(receiver.recv().await.is_some());
 1074         -
    }
 1075         -
    /// Query values of 0 and false are serialized
 1076         -
    /// Test ID: RestJsonZeroAndFalseQueryValues
 1077         -
    #[::tokio::test]
 1078         -
    async fn rest_json_zero_and_false_query_values_request() {
 1079         -
        #[allow(unused_mut)]
 1080         -
        let mut http_request = http::Request::builder()
 1081         -
            .uri("/AllQueryStringTypesInput")
 1082         -
            .method("GET")
 1083         -
            .body(::aws_smithy_http_server::body::Body::from(
 1084         -
                ::bytes::Bytes::from_static("".as_bytes()),
 1085         -
            ))
 1086         -
            .unwrap();
 1087         -
        *http_request.uri_mut() = "/AllQueryStringTypesInput?Integer=0&Boolean=false"
 1088         -
            .parse()
 1089         -
            .unwrap();
 1090         -
        #[allow(unused_mut)]
 1091         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 1092         -
        let config = crate::service::RestJsonConfig::builder().build();
 1093         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 1094         -
            .all_query_string_types(move |input: crate::input::AllQueryStringTypesInput| {
         824  +
            .test_payload_structure(move |input: crate::input::TestPayloadStructureInput| {
 1095    825   
                let sender = sender.clone();
 1096    826   
                async move {
 1097    827   
                    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
 1107         -
                            }),
 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,
         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  +
                            ),
 1126    835   
                        };
 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)
         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
 1236    846   
                    };
 1237    847   
                    sender.send(()).await.expect("receiver dropped early");
 1238    848   
                    result
 1239    849   
                }
 1240    850   
            })
 1241    851   
            .build_unchecked();
 1242    852   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 1243    853   
            .await
 1244    854   
            .expect("unable to make an HTTP request");
 1245         -
        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  +
        );
 1246    859   
    }
 1247    860   
}
 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
 1253         -
    #[::tokio::test]
 1254         -
    async fn rest_json_constant_and_variable_query_string_missing_one_value_request() {
 1255         -
        #[allow(unused_mut)]
 1256         -
        let mut http_request = http::Request::builder()
 1257         -
            .uri("/ConstantAndVariableQueryString")
 1258         -
            .method("GET")
 1259         -
            .body(::aws_smithy_http_server::body::Body::from(
 1260         -
                ::bytes::Bytes::from_static("".as_bytes()),
 1261         -
            ))
 1262         -
            .unwrap();
 1263         -
        *http_request.uri_mut() = "/ConstantAndVariableQueryString?foo=bar&baz=bam"
 1264         -
            .parse()
 1265         -
            .unwrap();
 1266         -
        #[allow(unused_mut)]
 1267         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 1268         -
        let config = crate::service::RestJsonConfig::builder().build();
 1269         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 1270         -
            .constant_and_variable_query_string(
 1271         -
                move |input: crate::input::ConstantAndVariableQueryStringInput| {
 1272         -
                    let sender = sender.clone();
 1273         -
                    async move {
 1274         -
                        let result = {
 1275         -
                            let expected = crate::input::ConstantAndVariableQueryStringInput {
 1276         -
                                baz: ::std::option::Option::Some("bam".to_owned()),
 1277         -
                                maybe_set: ::std::option::Option::None,
 1278         -
                            };
 1279         -
                            ::pretty_assertions::assert_eq!(input, expected);
 1280         -
                            let response = crate::output::ConstantAndVariableQueryStringOutput {};
 1281         -
                            response
 1282         -
                        };
 1283         -
                        sender.send(()).await.expect("receiver dropped early");
 1284         -
                        result
 1285         -
                    }
 1286         -
                },
         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,
 1287    912   
            )
 1288         -
            .build_unchecked();
 1289         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 1290    913   
            .await
 1291         -
            .expect("unable to make an HTTP request");
 1292         -
        assert!(receiver.recv().await.is_some());
         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  +
        }
 1293    928   
    }
 1294         -
    /// Mixes constant and variable query string parameters
 1295         -
    /// Test ID: RestJsonConstantAndVariableQueryStringAllValues
 1296         -
    #[::tokio::test]
 1297         -
    async fn rest_json_constant_and_variable_query_string_all_values_request() {
 1298         -
        #[allow(unused_mut)]
 1299         -
        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()
 1308         -
            .unwrap();
 1309         -
        #[allow(unused_mut)]
 1310         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 1311         -
        let config = crate::service::RestJsonConfig::builder().build();
 1312         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 1313         -
            .constant_and_variable_query_string(
 1314         -
                move |input: crate::input::ConstantAndVariableQueryStringInput| {
 1315         -
                    let sender = sender.clone();
 1316         -
                    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         -
                        };
 1326         -
                        sender.send(()).await.expect("receiver dropped early");
 1327         -
                        result
         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  +
                        }
 1328    942   
                    }
 1329         -
                },
 1330         -
            )
 1331         -
            .build_unchecked();
 1332         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 1333         -
            .await
 1334         -
            .expect("unable to make an HTTP request");
 1335         -
        assert!(receiver.recv().await.is_some());
 1336    943   
    }
 1337    944   
}
 1338         -
#[cfg(test)]
         945  +
 1339    946   
#[allow(unreachable_code, unused_variables)]
 1340         -
mod server_constant_query_string_test {
 1341         -
    /// Includes constant query string parameters
 1342         -
    /// Test ID: RestJsonConstantQueryString
         947  +
#[cfg(test)]
         948  +
mod test_body_structure_test {
         949  +
         950  +
    /// Serializes a structure
         951  +
    /// Test ID: RestJsonTestBodyStructure
 1343    952   
    #[::tokio::test]
 1344         -
    async fn rest_json_constant_query_string_request() {
         953  +
    #[::tracing_test::traced_test]
         954  +
    async fn rest_json_test_body_structure_request() {
 1345    955   
        #[allow(unused_mut)]
 1346    956   
        let mut http_request = http::Request::builder()
 1347         -
            .uri("/ConstantQueryString/hi")
 1348         -
            .method("GET")
         957  +
            .uri("/body")
         958  +
            .method("POST")
         959  +
            .header("Content-Type", "application/json")
 1349    960   
            .body(::aws_smithy_http_server::body::Body::from(
 1350         -
                ::bytes::Bytes::from_static("".as_bytes()),
         961  +
                ::bytes::Bytes::from_static(
         962  +
                    "{\"testConfig\":\n    {\"timeout\": 10}\n}".as_bytes(),
         963  +
                ),
 1351    964   
            ))
 1352    965   
            .unwrap();
 1353         -
        *http_request.uri_mut() = "/ConstantQueryString/hi?foo=bar&hello".parse().unwrap();
 1354    966   
        #[allow(unused_mut)]
 1355    967   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 1356    968   
        let config = crate::service::RestJsonConfig::builder().build();
 1357    969   
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 1358         -
            .constant_query_string(move |input: crate::input::ConstantQueryStringInput| {
         970  +
            .test_body_structure(move |input: crate::input::TestBodyStructureInput| {
 1359    971   
                let sender = sender.clone();
 1360    972   
                async move {
 1361    973   
                    let result = {
 1362         -
                        let expected = crate::input::ConstantQueryStringInput {
 1363         -
                            hello: "hi".to_owned(),
         974  +
                        let expected = crate::input::TestBodyStructureInput {
         975  +
                            test_config: ::std::option::Option::Some(crate::model::TestConfig {
         976  +
                                timeout: ::std::option::Option::Some(10),
         977  +
                            }),
         978  +
                            test_id: ::std::option::Option::None,
 1364    979   
                        };
 1365    980   
                        ::pretty_assertions::assert_eq!(input, expected);
 1366         -
                        let response = crate::output::ConstantQueryStringOutput {};
 1367         -
                        Ok(response)
         981  +
                        let response = crate::output::TestBodyStructureOutput {
         982  +
                            test_id: ::std::option::Option::None,
         983  +
                            test_config: ::std::option::Option::None,
         984  +
                        };
         985  +
                        response
 1368    986   
                    };
 1369    987   
                    sender.send(()).await.expect("receiver dropped early");
 1370    988   
                    result
 1371    989   
                }
 1372    990   
            })
 1373    991   
            .build_unchecked();
 1374    992   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 1375    993   
            .await
 1376    994   
            .expect("unable to make an HTTP request");
 1377         -
        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  +
        );
 1378    999   
    }
 1379         -
}
 1380         -
#[cfg(test)]
 1381         -
#[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
        1000  +
    /// Serializes an empty structure in the body
        1001  +
    /// Test ID: RestJsonHttpWithEmptyBody
 1385   1002   
    #[::tokio::test]
 1386         -
    async fn document_type_input_with_object_request() {
        1003  +
    #[::tracing_test::traced_test]
        1004  +
    async fn rest_json_http_with_empty_body_request() {
 1387   1005   
        #[allow(unused_mut)]
 1388         -
                    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();
        1006  +
        let mut http_request = http::Request::builder()
        1007  +
            .uri("/body")
        1008  +
            .method("POST")
        1009  +
            .header("Content-Type", "application/json")
        1010  +
            .body(::aws_smithy_http_server::body::Body::from(
        1011  +
                ::bytes::Bytes::from_static("{}".as_bytes()),
        1012  +
            ))
        1013  +
            .unwrap();
 1393   1014   
        #[allow(unused_mut)]
 1394   1015   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 1395   1016   
        let config = crate::service::RestJsonConfig::builder().build();
 1396   1017   
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 1397         -
            .document_type(move |input: crate::input::DocumentTypeInput| {
        1018  +
            .test_body_structure(move |input: crate::input::TestBodyStructureInput| {
 1398   1019   
                let sender = sender.clone();
 1399   1020   
                async move {
 1400   1021   
                    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         -
                            }),
        1022  +
                        let expected = crate::input::TestBodyStructureInput {
        1023  +
                            test_id: ::std::option::Option::None,
        1024  +
                            test_config: ::std::option::Option::None,
 1413   1025   
                        };
 1414   1026   
                        ::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         -
                            }),
        1027  +
                        let response = crate::output::TestBodyStructureOutput {
        1028  +
                            test_id: ::std::option::Option::None,
        1029  +
                            test_config: ::std::option::Option::None,
 1425   1030   
                        };
 1426   1031   
                        response
 1427   1032   
                    };
 1428   1033   
                    sender.send(()).await.expect("receiver dropped early");
 1429   1034   
                    result
 1430   1035   
                }
 1431   1036   
            })
 1432   1037   
            .build_unchecked();
 1433   1038   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 1434   1039   
            .await
 1435   1040   
            .expect("unable to make an HTTP request");
 1436         -
        assert!(receiver.recv().await.is_some());
 1437         -
    }
 1438         -
    /// Serializes document types using a string.
 1439         -
    /// Test ID: DocumentInputWithString
 1440         -
    #[::tokio::test]
 1441         -
    async fn document_input_with_string_request() {
 1442         -
        #[allow(unused_mut)]
 1443         -
        let mut http_request = http::Request::builder()
 1444         -
            .uri("/DocumentType")
 1445         -
            .method("PUT")
 1446         -
            .header("Content-Type", "application/json")
 1447         -
            .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         -
                ),
 1452         -
            ))
 1453         -
            .unwrap();
 1454         -
        #[allow(unused_mut)]
 1455         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 1456         -
        let config = crate::service::RestJsonConfig::builder().build();
 1457         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 1458         -
            .document_type(move |input: crate::input::DocumentTypeInput| {
 1459         -
                let sender = sender.clone();
 1460         -
                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         -
                    };
 1487         -
                    sender.send(()).await.expect("receiver dropped early");
 1488         -
                    result
 1489         -
                }
 1490         -
            })
 1491         -
            .build_unchecked();
 1492         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 1493         -
            .await
 1494         -
            .expect("unable to make an HTTP request");
 1495         -
        assert!(receiver.recv().await.is_some());
 1496         -
    }
 1497         -
    /// Serializes document types using a number.
 1498         -
    /// Test ID: DocumentInputWithNumber
 1499         -
    #[::tokio::test]
 1500         -
    async fn document_input_with_number_request() {
 1501         -
        #[allow(unused_mut)]
 1502         -
        let mut http_request = http::Request::builder()
 1503         -
            .uri("/DocumentType")
 1504         -
            .method("PUT")
 1505         -
            .header("Content-Type", "application/json")
 1506         -
            .body(::aws_smithy_http_server::body::Body::from(
 1507         -
                ::bytes::Bytes::from_static(
 1508         -
                    "{\n    \"stringValue\": \"string\",\n    \"documentValue\": 10\n}".as_bytes(),
 1509         -
                ),
 1510         -
            ))
 1511         -
            .unwrap();
 1512         -
        #[allow(unused_mut)]
 1513         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 1514         -
        let config = crate::service::RestJsonConfig::builder().build();
 1515         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 1516         -
            .document_type(move |input: crate::input::DocumentTypeInput| {
 1517         -
                let sender = sender.clone();
 1518         -
                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         -
                    };
 1545         -
                    sender.send(()).await.expect("receiver dropped early");
 1546         -
                    result
 1547         -
                }
 1548         -
            })
 1549         -
            .build_unchecked();
 1550         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 1551         -
            .await
 1552         -
            .expect("unable to make an HTTP request");
 1553         -
        assert!(receiver.recv().await.is_some());
 1554         -
    }
 1555         -
    /// Serializes document types using a boolean.
 1556         -
    /// Test ID: DocumentInputWithBoolean
 1557         -
    #[::tokio::test]
 1558         -
    async fn document_input_with_boolean_request() {
 1559         -
        #[allow(unused_mut)]
 1560         -
        let mut http_request = http::Request::builder()
 1561         -
            .uri("/DocumentType")
 1562         -
            .method("PUT")
 1563         -
            .header("Content-Type", "application/json")
 1564         -
            .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         -
                ),
 1569         -
            ))
 1570         -
            .unwrap();
 1571         -
        #[allow(unused_mut)]
 1572         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 1573         -
        let config = crate::service::RestJsonConfig::builder().build();
 1574         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 1575         -
            .document_type(move |input: crate::input::DocumentTypeInput| {
 1576         -
                let sender = sender.clone();
 1577         -
                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         -
                    };
 1604         -
                    sender.send(()).await.expect("receiver dropped early");
 1605         -
                    result
 1606         -
                }
 1607         -
            })
 1608         -
            .build_unchecked();
 1609         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 1610         -
            .await
 1611         -
            .expect("unable to make an HTTP request");
 1612         -
        assert!(receiver.recv().await.is_some());
 1613         -
    }
 1614         -
    /// Serializes document types using a list.
 1615         -
    /// Test ID: DocumentInputWithList
 1616         -
    #[::tokio::test]
 1617         -
    async fn document_input_with_list_request() {
 1618         -
        #[allow(unused_mut)]
 1619         -
                    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();
 1624         -
        #[allow(unused_mut)]
 1625         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 1626         -
        let config = crate::service::RestJsonConfig::builder().build();
 1627         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 1628         -
            .document_type(move |input: crate::input::DocumentTypeInput| {
 1629         -
                let sender = sender.clone();
 1630         -
                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         -
                    };
 1672         -
                    sender.send(()).await.expect("receiver dropped early");
 1673         -
                    result
 1674         -
                }
 1675         -
            })
 1676         -
            .build_unchecked();
 1677         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 1678         -
            .await
 1679         -
            .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         -
        ::pretty_assertions::assert_eq!(
 1701         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
 1702         -
            http_response.status()
 1703         -
        );
 1704         -
        let expected_headers = [("Content-Type", "application/json")];
 1705         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 1706         -
            http_response.headers(),
 1707         -
            expected_headers,
 1708         -
        ));
 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"))
        1041  +
        assert!(
        1042  +
            receiver.recv().await.is_some(),
        1043  +
            "we expected operation handler to be invoked but it was not entered"
 1714   1044   
        );
 1715   1045   
    }
 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         -
        ));
        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>>
 1749   1059   
    }
 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         -
            }),
 1763         -
        };
 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()
 1769         -
        );
 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         -
        ));
        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)
 1783   1074   
    }
 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         -
            }),
        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)
 1797   1104   
        };
 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()
        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  +
            },
 1803   1113   
        );
 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         -
        ));
        1114  +
        MalformedAcceptWithGenericStringInputFuture {
        1115  +
            inner: Box::pin(fut),
        1116  +
        }
 1817   1117   
    }
 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         -
        );
        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  +
                    }
 1852   1132   
    }
 1853   1133   
}
 1854         -
#[cfg(test)]
        1134  +
 1855   1135   
#[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
        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
 1859   1142   
    #[::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         -
                        };
 1922         -
                        response
 1923         -
                    };
 1924         -
                    sender.send(()).await.expect("receiver dropped early");
 1925         -
                    result
 1926         -
                }
 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());
        1143  +
    #[::tracing_test::traced_test]
        1144  +
    async fn rest_json_with_payload_expects_implied_accept_malformed_request() {
        1145  +
        {
        1146  +
            #[allow(unused_mut)]
        1147  +
            let mut http_request = http::Request::builder()
        1148  +
                .uri("/MalformedAcceptWithGenericString")
        1149  +
                .method("POST")
        1150  +
                .header("accept", "application/json")
        1151  +
                .body(::aws_smithy_http_server::body::Body::empty())
        1152  +
                .unwrap();
        1153  +
            #[allow(unused_mut)]
        1154  +
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
        1155  +
            let config = crate::service::RestJsonConfig::builder().build();
        1156  +
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
        1157  +
                            .malformed_accept_with_generic_string(move |input: crate::input::MalformedAcceptWithGenericStringInput| {
        1158  +
                                let sender = sender.clone();
        1159  +
                                async move {
        1160  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedAcceptWithGenericStringOutput };
        1161  +
                                    sender.send(()).await.expect("receiver dropped early");
        1162  +
                                    result
        1163  +
                                }
        1164  +
                            })
        1165  +
                            .build_unchecked();
        1166  +
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
        1167  +
                .await
        1168  +
                .expect("unable to make an HTTP request");
        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  +
        }
 1933   1179   
    }
 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         -
            }),
        1180  +
}
        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)
 1971   1238   
        };
 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"))
        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  +
            },
 1988   1247   
        );
        1248  +
        MalformedAcceptWithPayloadInputFuture {
        1249  +
            inner: Box::pin(fut),
        1250  +
        }
 1989   1251   
    }
 1990   1252   
}
 1991         -
#[cfg(test)]
        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  +
 1992   1269   
#[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
        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
 1996   1275   
    #[::tokio::test]
 1997         -
    async fn document_type_as_payload_input_request() {
 1998         -
        #[allow(unused_mut)]
 1999         -
        let mut http_request = http::Request::builder()
 2000         -
            .uri("/DocumentTypeAsPayload")
 2001         -
            .method("PUT")
 2002         -
            .header("Content-Type", "application/json")
 2003         -
            .body(::aws_smithy_http_server::body::Body::from(
 2004         -
                ::bytes::Bytes::from_static("{\n    \"foo\": \"bar\"\n}".as_bytes()),
 2005         -
            ))
 2006         -
            .unwrap();
 2007         -
        #[allow(unused_mut)]
 2008         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 2009         -
        let config = crate::service::RestJsonConfig::builder().build();
 2010         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 2011         -
            .document_type_as_payload(move |input: crate::input::DocumentTypeAsPayloadInput| {
 2012         -
                let sender = sender.clone();
 2013         -
                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         -
                    };
 2040         -
                    sender.send(()).await.expect("receiver dropped early");
 2041         -
                    result
 2042         -
                }
 2043         -
            })
 2044         -
            .build_unchecked();
 2045         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 2046         -
            .await
 2047         -
            .expect("unable to make an HTTP request");
 2048         -
        assert!(receiver.recv().await.is_some());
        1276  +
    #[::tracing_test::traced_test]
        1277  +
    async fn rest_json_with_payload_expects_modeled_accept_malformed_request() {
        1278  +
        {
        1279  +
            #[allow(unused_mut)]
        1280  +
            let mut http_request = http::Request::builder()
        1281  +
                .uri("/MalformedAcceptWithPayload")
        1282  +
                .method("POST")
        1283  +
                .header("accept", "application/json")
        1284  +
                .body(::aws_smithy_http_server::body::Body::empty())
        1285  +
                .unwrap();
        1286  +
            #[allow(unused_mut)]
        1287  +
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
        1288  +
            let config = crate::service::RestJsonConfig::builder().build();
        1289  +
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
        1290  +
                            .malformed_accept_with_payload(move |input: crate::input::MalformedAcceptWithPayloadInput| {
        1291  +
                                let sender = sender.clone();
        1292  +
                                async move {
        1293  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedAcceptWithPayloadOutput };
        1294  +
                                    sender.send(()).await.expect("receiver dropped early");
        1295  +
                                    result
        1296  +
                                }
        1297  +
                            })
        1298  +
                            .build_unchecked();
        1299  +
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
        1300  +
                .await
        1301  +
                .expect("unable to make an HTTP request");
        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  +
        }
 2049   1312   
    }
 2050         -
    /// Serializes a document as the target of the httpPayload trait using a string.
 2051         -
    /// Test ID: DocumentTypeAsPayloadInputString
 2052         -
    #[::tokio::test]
 2053         -
    async fn document_type_as_payload_input_string_request() {
 2054         -
        #[allow(unused_mut)]
 2055         -
        let mut http_request = http::Request::builder()
 2056         -
            .uri("/DocumentTypeAsPayload")
 2057         -
            .method("PUT")
 2058         -
            .header("Content-Type", "application/json")
 2059         -
            .body(::aws_smithy_http_server::body::Body::from(
 2060         -
                ::bytes::Bytes::from_static("\"hello\"".as_bytes()),
 2061         -
            ))
 2062         -
            .unwrap();
 2063         -
        #[allow(unused_mut)]
 2064         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 2065         -
        let config = crate::service::RestJsonConfig::builder().build();
 2066         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 2067         -
            .document_type_as_payload(move |input: crate::input::DocumentTypeAsPayloadInput| {
 2068         -
                let sender = sender.clone();
 2069         -
                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         -
                    };
 2094         -
                    sender.send(()).await.expect("receiver dropped early");
 2095         -
                    result
 2096         -
                }
 2097         -
            })
 2098         -
            .build_unchecked();
 2099         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 2100         -
            .await
 2101         -
            .expect("unable to make an HTTP request");
 2102         -
        assert!(receiver.recv().await.is_some());
        1313  +
}
        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>>
 2103   1321   
    }
 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         -
        ::pretty_assertions::assert_eq!(
 2122         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
 2123         -
            http_response.status()
 2124         -
        );
 2125         -
        let expected_headers = [("Content-Type", "application/json")];
 2126         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 2127         -
            http_response.headers(),
 2128         -
            expected_headers,
 2129         -
        ));
 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         -
        ));
        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)
 2138   1336   
    }
 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         -
            }),
        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)
 2151   1366   
        };
 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()
        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  +
            },
 2157   1375   
        );
 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         -
        ));
        1376  +
        MalformedAcceptWithBodyInputFuture {
        1377  +
            inner: Box::pin(fut),
        1378  +
        }
 2171   1379   
    }
 2172   1380   
}
 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
 2180         -
    #[::tokio::test]
 2181         -
    async fn rest_json_empty_input_and_empty_output_request() {
 2182         -
        #[allow(unused_mut)]
 2183         -
        let mut http_request = http::Request::builder()
 2184         -
            .uri("/EmptyInputAndEmptyOutput")
 2185         -
            .method("POST")
 2186         -
            .body(::aws_smithy_http_server::body::Body::from(
 2187         -
                ::bytes::Bytes::from_static("".as_bytes()),
 2188         -
            ))
 2189         -
            .unwrap();
 2190         -
        #[allow(unused_mut)]
 2191         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 2192         -
        let config = crate::service::RestJsonConfig::builder().build();
 2193         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 2194         -
            .empty_input_and_empty_output(
 2195         -
                move |input: crate::input::EmptyInputAndEmptyOutputInput| {
 2196         -
                    let sender = sender.clone();
 2197         -
                    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         -
                        };
 2204         -
                        sender.send(()).await.expect("receiver dropped early");
 2205         -
                        result
 2206         -
                    }
 2207         -
                },
 2208         -
            )
 2209         -
            .build_unchecked();
 2210         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 2211         -
            .await
 2212         -
            .expect("unable to make an HTTP request");
 2213         -
        assert!(receiver.recv().await.is_some());
 2214         -
    }
 2215         -
    /// Similar to RestJsonEmptyInputAndEmptyOutput, but ensures that
 2216         -
    /// services gracefully handles receiving a JSON object.
 2217         -
    /// Test ID: RestJsonEmptyInputAndEmptyOutputWithJson
 2218         -
    #[::tokio::test]
 2219         -
    async fn rest_json_empty_input_and_empty_output_with_json_request() {
 2220         -
        #[allow(unused_mut)]
 2221         -
        let mut http_request = http::Request::builder()
 2222         -
            .uri("/EmptyInputAndEmptyOutput")
 2223         -
            .method("POST")
 2224         -
            .header("Content-Type", "application/json")
 2225         -
            .body(::aws_smithy_http_server::body::Body::from(
 2226         -
                ::bytes::Bytes::from_static("{}".as_bytes()),
 2227         -
            ))
 2228         -
            .unwrap();
 2229         -
        #[allow(unused_mut)]
 2230         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 2231         -
        let config = crate::service::RestJsonConfig::builder().build();
 2232         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 2233         -
            .empty_input_and_empty_output(
 2234         -
                move |input: crate::input::EmptyInputAndEmptyOutputInput| {
 2235         -
                    let sender = sender.clone();
 2236         -
                    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         -
                        };
 2243         -
                        sender.send(()).await.expect("receiver dropped early");
 2244         -
                        result
        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  +
                        }
 2245   1393   
                    }
 2246         -
                },
 2247         -
            )
 2248         -
            .build_unchecked();
 2249         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 2250         -
            .await
 2251         -
            .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         -
        ::pretty_assertions::assert_eq!(
 2264         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
 2265         -
            http_response.status()
 2266         -
        );
 2267         -
        let expected_headers = [("Content-Type", "application/json")];
 2268         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 2269         -
            http_response.headers(),
 2270         -
            expected_headers,
 2271         -
        ));
 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   1394   
    }
 2281   1395   
}
 2282         -
#[cfg(test)]
        1396  +
 2283   1397   
#[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
        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
 2288   1403   
    #[::tokio::test]
 2289         -
    #[should_panic]
 2290         -
    async fn rest_json_endpoint_trait_request() {
 2291         -
        #[allow(unused_mut)]
 2292         -
        let mut http_request = http::Request::builder()
 2293         -
            .uri("/EndpointOperation")
 2294         -
            .method("POST")
 2295         -
            .body(::aws_smithy_http_server::body::Body::from(
 2296         -
                ::bytes::Bytes::from_static("".as_bytes()),
 2297         -
            ))
 2298         -
            .unwrap();
 2299         -
        todo!("endpoint trait not supported yet");
 2300         -
        #[allow(unused_mut)]
 2301         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 2302         -
        let config = crate::service::RestJsonConfig::builder().build();
 2303         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 2304         -
            .endpoint_operation(move |input: crate::input::EndpointOperationInput| {
 2305         -
                let sender = sender.clone();
 2306         -
                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         -
                    };
 2313         -
                    sender.send(()).await.expect("receiver dropped early");
 2314         -
                    result
 2315         -
                }
 2316         -
            })
 2317         -
            .build_unchecked();
 2318         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 2319         -
            .await
 2320         -
            .expect("unable to make an HTTP request");
 2321         -
        assert!(receiver.recv().await.is_some());
        1404  +
    #[::tracing_test::traced_test]
        1405  +
    async fn rest_json_with_body_expects_application_json_accept_malformed_request() {
        1406  +
        {
        1407  +
            #[allow(unused_mut)]
        1408  +
            let mut http_request = http::Request::builder()
        1409  +
                .uri("/MalformedAcceptWithBody")
        1410  +
                .method("POST")
        1411  +
                .header("accept", "application/hal+json")
        1412  +
                .body(::aws_smithy_http_server::body::Body::empty())
        1413  +
                .unwrap();
        1414  +
            #[allow(unused_mut)]
        1415  +
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
        1416  +
            let config = crate::service::RestJsonConfig::builder().build();
        1417  +
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
        1418  +
                            .malformed_accept_with_body(move |input: crate::input::MalformedAcceptWithBodyInput| {
        1419  +
                                let sender = sender.clone();
        1420  +
                                async move {
        1421  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedAcceptWithBodyOutput };
        1422  +
                                    sender.send(()).await.expect("receiver dropped early");
        1423  +
                                    result
        1424  +
                                }
        1425  +
                            })
        1426  +
                            .build_unchecked();
        1427  +
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
        1428  +
                .await
        1429  +
                .expect("unable to make an HTTP request");
        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  +
            ));
        1439  +
        }
 2322   1440   
    }
 2323   1441   
}
 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
 2331         -
    #[::tokio::test]
 2332         -
    #[should_panic]
 2333         -
    async fn rest_json_endpoint_trait_with_host_label_request() {
 2334         -
        #[allow(unused_mut)]
 2335         -
        let mut http_request = http::Request::builder()
 2336         -
            .uri("/EndpointWithHostLabelOperation")
 2337         -
            .method("POST")
 2338         -
            .body(::aws_smithy_http_server::body::Body::from(
 2339         -
                ::bytes::Bytes::from_static("{\"label\": \"bar\"}".as_bytes()),
 2340         -
            ))
 2341         -
            .unwrap();
 2342         -
        todo!("endpoint trait not supported yet");
 2343         -
        #[allow(unused_mut)]
 2344         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 2345         -
        let config = crate::service::RestJsonConfig::builder().build();
 2346         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 2347         -
            .endpoint_with_host_label_operation(
 2348         -
                move |input: crate::input::EndpointWithHostLabelOperationInput| {
 2349         -
                    let sender = sender.clone();
 2350         -
                    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         -
                        };
 2359         -
                        sender.send(()).await.expect("receiver dropped early");
 2360         -
                        result
 2361         -
                    }
 2362         -
                },
 2363         -
            )
 2364         -
            .build_unchecked();
 2365         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 2366         -
            .await
 2367         -
            .expect("unable to make an HTTP request");
 2368         -
        assert!(receiver.recv().await.is_some());
        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>>
 2369   1449   
    }
 2370   1450   
}
 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         -
        ));
        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)
 2404   1464   
    }
 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()),
        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)
 2411   1494   
        };
 2412         -
        let output = crate::error::GreetingWithErrorsError::InvalidGreeting(output);
 2413         -
        use ::aws_smithy_http_server::response::IntoResponse;
 2414         -
        let http_response = output.into_response();
 2415         -
        ::pretty_assertions::assert_eq!(
 2416         -
            http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 2417         -
            http_response.status()
        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  +
            },
 2418   1503   
        );
 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         -
        ));
        1504  +
        MalformedContentTypeWithGenericStringInputFuture {
        1505  +
            inner: Box::pin(fut),
        1506  +
        }
 2435   1507   
    }
 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         -
        ];
 2459         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 2460         -
            http_response.headers(),
 2461         -
            expected_headers,
 2462         -
        ));
 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         -
        );
        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  +
                    }
 2469   1522   
    }
 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,
        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)
 2477   1576   
        };
 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()
        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  +
            },
 2484   1585   
        );
 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         -
        ));
        1586  +
        MalformedContentTypeWithPayloadInputFuture {
        1587  +
            inner: Box::pin(fut),
        1588  +
        }
 2501   1589   
    }
 2502   1590   
}
 2503         -
#[cfg(test)]
        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  +
 2504   1607   
#[allow(unreachable_code, unused_variables)]
 2505         -
mod server_http_checksum_required_test {
 2506         -
    /// Adds Content-MD5 header
 2507         -
    /// Test ID: RestJsonHttpChecksumRequired
        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
 2508   1613   
    #[::tokio::test]
 2509         -
    async fn rest_json_http_checksum_required_request() {
 2510         -
        #[allow(unused_mut)]
 2511         -
        let mut http_request = http::Request::builder()
 2512         -
            .uri("/HttpChecksumRequired")
 2513         -
            .method("POST")
 2514         -
            .header("Content-MD5", "iB0/3YSo7maijL0IGOgA9g==")
 2515         -
            .header("Content-Type", "application/json")
 2516         -
            .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         -
                ),
 2520         -
            ))
 2521         -
            .unwrap();
 2522         -
        #[allow(unused_mut)]
 2523         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 2524         -
        let config = crate::service::RestJsonConfig::builder().build();
 2525         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 2526         -
            .http_checksum_required(move |input: crate::input::HttpChecksumRequiredInput| {
 2527         -
                let sender = sender.clone();
 2528         -
                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         -
                    };
 2541         -
                    sender.send(()).await.expect("receiver dropped early");
 2542         -
                    result
 2543         -
                }
 2544         -
            })
 2545         -
            .build_unchecked();
 2546         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 2547         -
            .await
 2548         -
            .expect("unable to make an HTTP request");
 2549         -
        assert!(receiver.recv().await.is_some());
 2550         -
    }
 2551         -
}
 2552         -
#[cfg(test)]
 2553         -
#[allow(unreachable_code, unused_variables)]
 2554         -
mod server_http_enum_payload_test {
 2555         -
    /// Test ID: RestJsonEnumPayloadRequest
 2556         -
    #[::tokio::test]
 2557         -
    #[should_panic]
 2558         -
    async fn rest_json_enum_payload_request_request() {
 2559         -
        #[allow(unused_mut)]
 2560         -
        let mut http_request = http::Request::builder()
 2561         -
            .uri("/EnumPayload")
 2562         -
            .method("POST")
 2563         -
            .body(::aws_smithy_http_server::body::Body::from(
 2564         -
                ::bytes::Bytes::from_static("enumvalue".as_bytes()),
 2565         -
            ))
 2566         -
            .unwrap();
 2567         -
        #[allow(unused_mut)]
 2568         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 2569         -
        let config = crate::service::RestJsonConfig::builder().build();
 2570         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 2571         -
            .http_enum_payload(move |input: crate::input::HttpEnumPayloadInput| {
 2572         -
                let sender = sender.clone();
 2573         -
                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         -
                    };
 2588         -
                    sender.send(()).await.expect("receiver dropped early");
 2589         -
                    result
 2590         -
                }
 2591         -
            })
 2592         -
            .build_unchecked();
 2593         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 2594         -
            .await
 2595         -
            .expect("unable to make an HTTP request");
 2596         -
        assert!(receiver.recv().await.is_some());
        1614  +
    #[::tracing_test::traced_test]
        1615  +
    async fn rest_json_with_payload_expects_modeled_content_type_malformed_request() {
        1616  +
        {
        1617  +
            #[allow(unused_mut)]
        1618  +
            let mut http_request = http::Request::builder()
        1619  +
                .uri("/MalformedContentTypeWithPayload")
        1620  +
                .method("POST")
        1621  +
                .header("content-type", "application/json")
        1622  +
                .body(::aws_smithy_http_server::body::Body::from(
        1623  +
                    ::bytes::Bytes::from_static("{}".as_bytes()),
        1624  +
                ))
        1625  +
                .unwrap();
        1626  +
            #[allow(unused_mut)]
        1627  +
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
        1628  +
            let config = crate::service::RestJsonConfig::builder().build();
        1629  +
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
        1630  +
                            .malformed_content_type_with_payload(move |input: crate::input::MalformedContentTypeWithPayloadInput| {
        1631  +
                                let sender = sender.clone();
        1632  +
                                async move {
        1633  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedContentTypeWithPayloadOutput };
        1634  +
                                    sender.send(()).await.expect("receiver dropped early");
        1635  +
                                    result
        1636  +
                                }
        1637  +
                            })
        1638  +
                            .build_unchecked();
        1639  +
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
        1640  +
                .await
        1641  +
                .expect("unable to make an HTTP request");
        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  +
            ));
        1651  +
        }
 2597   1652   
    }
 2598         -
    /// Test ID: RestJsonEnumPayloadResponse
        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
 2599   1656   
    #[::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         -
        ::pretty_assertions::assert_eq!(
 2611         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
 2612         -
            http_response.status()
 2613         -
        );
 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"),
 2621         -
        ));
        1657  +
    #[::tracing_test::traced_test]
        1658  +
    async fn rest_json_with_payload_expects_implied_content_type_malformed_request() {
        1659  +
        {
        1660  +
            #[allow(unused_mut)]
        1661  +
            let mut http_request = http::Request::builder()
        1662  +
                .uri("/MalformedContentTypeWithPayload")
        1663  +
                .method("POST")
        1664  +
                .header("content-type", "application/json")
        1665  +
                .body(::aws_smithy_http_server::body::Body::from(
        1666  +
                    ::bytes::Bytes::from_static("{}".as_bytes()),
        1667  +
                ))
        1668  +
                .unwrap();
        1669  +
            #[allow(unused_mut)]
        1670  +
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
        1671  +
            let config = crate::service::RestJsonConfig::builder().build();
        1672  +
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
        1673  +
                            .malformed_content_type_with_payload(move |input: crate::input::MalformedContentTypeWithPayloadInput| {
        1674  +
                                let sender = sender.clone();
        1675  +
                                async move {
        1676  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedContentTypeWithPayloadOutput };
        1677  +
                                    sender.send(()).await.expect("receiver dropped early");
        1678  +
                                    result
        1679  +
                                }
        1680  +
                            })
        1681  +
                            .build_unchecked();
        1682  +
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
        1683  +
                .await
        1684  +
                .expect("unable to make an HTTP request");
        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  +
            ));
        1694  +
        }
 2622   1695   
    }
 2623   1696   
}
 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
 2629         -
    #[::tokio::test]
 2630         -
    async fn rest_json_http_payload_traits_with_blob_request() {
 2631         -
        #[allow(unused_mut)]
 2632         -
        let mut http_request = http::Request::builder()
 2633         -
            .uri("/HttpPayloadTraits")
 2634         -
            .method("POST")
 2635         -
            .header("Content-Type", "application/octet-stream")
 2636         -
            .header("X-Foo", "Foo")
 2637         -
            .body(::aws_smithy_http_server::body::Body::from(
 2638         -
                ::bytes::Bytes::from_static("blobby blob blob".as_bytes()),
 2639         -
            ))
 2640         -
            .unwrap();
 2641         -
        #[allow(unused_mut)]
 2642         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 2643         -
        let config = crate::service::RestJsonConfig::builder().build();
 2644         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 2645         -
            .http_payload_traits(move |input: crate::input::HttpPayloadTraitsInput| {
 2646         -
                let sender = sender.clone();
 2647         -
                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         -
                    };
 2662         -
                    sender.send(()).await.expect("receiver dropped early");
 2663         -
                    result
 2664         -
                }
 2665         -
            })
 2666         -
            .build_unchecked();
 2667         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 2668         -
            .await
 2669         -
            .expect("unable to make an HTTP request");
 2670         -
        assert!(receiver.recv().await.is_some());
 2671         -
    }
 2672         -
    /// Serializes an empty blob in the HTTP payload
 2673         -
    /// Test ID: RestJsonHttpPayloadTraitsWithNoBlobBody
 2674         -
    #[::tokio::test]
 2675         -
    async fn rest_json_http_payload_traits_with_no_blob_body_request() {
 2676         -
        #[allow(unused_mut)]
 2677         -
        let mut http_request = http::Request::builder()
 2678         -
            .uri("/HttpPayloadTraits")
 2679         -
            .method("POST")
 2680         -
            .header("X-Foo", "Foo")
 2681         -
            .body(::aws_smithy_http_server::body::Body::from(
 2682         -
                ::bytes::Bytes::from_static("".as_bytes()),
 2683         -
            ))
 2684         -
            .unwrap();
 2685         -
        #[allow(unused_mut)]
 2686         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 2687         -
        let config = crate::service::RestJsonConfig::builder().build();
 2688         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 2689         -
            .http_payload_traits(move |input: crate::input::HttpPayloadTraitsInput| {
 2690         -
                let sender = sender.clone();
 2691         -
                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         -
                    };
 2704         -
                    sender.send(()).await.expect("receiver dropped early");
 2705         -
                    result
 2706         -
                }
 2707         -
            })
 2708         -
            .build_unchecked();
 2709         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 2710         -
            .await
 2711         -
            .expect("unable to make an HTTP request");
 2712         -
        assert!(receiver.recv().await.is_some());
 2713         -
    }
 2714         -
    /// Servers must accept any content type for blob inputs
 2715         -
    /// without the media type trait.
 2716         -
    /// Test ID: RestJsonHttpPayloadTraitsWithBlobAcceptsAllContentTypes
 2717         -
    #[::tokio::test]
 2718         -
    async fn rest_json_http_payload_traits_with_blob_accepts_all_content_types_request() {
 2719         -
        #[allow(unused_mut)]
 2720         -
        let mut http_request = http::Request::builder()
 2721         -
            .uri("/HttpPayloadTraits")
 2722         -
            .method("POST")
 2723         -
            .header("Content-Type", "image/jpeg")
 2724         -
            .header("X-Foo", "Foo")
 2725         -
            .body(::aws_smithy_http_server::body::Body::from(
 2726         -
                ::bytes::Bytes::from_static("This is definitely a jpeg".as_bytes()),
 2727         -
            ))
 2728         -
            .unwrap();
 2729         -
        #[allow(unused_mut)]
 2730         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 2731         -
        let config = crate::service::RestJsonConfig::builder().build();
 2732         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 2733         -
            .http_payload_traits(move |input: crate::input::HttpPayloadTraitsInput| {
 2734         -
                let sender = sender.clone();
 2735         -
                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         -
                    };
 2750         -
                    sender.send(()).await.expect("receiver dropped early");
 2751         -
                    result
 2752         -
                }
 2753         -
            })
 2754         -
            .build_unchecked();
 2755         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 2756         -
            .await
 2757         -
            .expect("unable to make an HTTP request");
 2758         -
        assert!(receiver.recv().await.is_some());
        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>>
 2759   1704   
    }
 2760         -
    /// Servers must accept any accept header for blob inputs
 2761         -
    /// without the media type trait.
 2762         -
    /// Test ID: RestJsonHttpPayloadTraitsWithBlobAcceptsAllAccepts
 2763         -
    #[::tokio::test]
 2764         -
    async fn rest_json_http_payload_traits_with_blob_accepts_all_accepts_request() {
 2765         -
        #[allow(unused_mut)]
 2766         -
        let mut http_request = http::Request::builder()
 2767         -
            .uri("/HttpPayloadTraits")
 2768         -
            .method("POST")
 2769         -
            .header("Accept", "image/jpeg")
 2770         -
            .header("X-Foo", "Foo")
 2771         -
            .body(::aws_smithy_http_server::body::Body::from(
 2772         -
                ::bytes::Bytes::from_static("This is definitely a jpeg".as_bytes()),
 2773         -
            ))
 2774         -
            .unwrap();
 2775         -
        #[allow(unused_mut)]
 2776         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 2777         -
        let config = crate::service::RestJsonConfig::builder().build();
 2778         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 2779         -
            .http_payload_traits(move |input: crate::input::HttpPayloadTraitsInput| {
 2780         -
                let sender = sender.clone();
 2781         -
                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         -
                    };
 2796         -
                    sender.send(()).await.expect("receiver dropped early");
 2797         -
                    result
 2798         -
                }
 2799         -
            })
 2800         -
            .build_unchecked();
 2801         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 2802         -
            .await
 2803         -
            .expect("unable to make an HTTP request");
 2804         -
        assert!(receiver.recv().await.is_some());
        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)
 2805   1719   
    }
 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")),
        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)
 2813   1749   
        };
 2814         -
        use ::aws_smithy_http_server::response::IntoResponse;
 2815         -
        let http_response = output.into_response();
 2816         -
        ::pretty_assertions::assert_eq!(
 2817         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
 2818         -
            http_response.status()
        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  +
            },
 2819   1758   
        );
 2820         -
        let expected_headers = [("X-Foo", "Foo")];
 2821         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 2822         -
            http_response.headers(),
 2823         -
            expected_headers,
 2824         -
        ));
 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         -
        ));
        1759  +
        MalformedContentTypeWithBodyInputFuture {
        1760  +
            inner: Box::pin(fut),
        1761  +
        }
 2833   1762   
    }
 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(), "");
        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  +
                    }
 2858   1777   
    }
 2859   1778   
}
 2860         -
#[cfg(test)]
        1779  +
 2861   1780   
#[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
        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
 2865   1786   
    #[::tokio::test]
 2866         -
    async fn rest_json_http_payload_traits_with_media_type_with_blob_request() {
 2867         -
        #[allow(unused_mut)]
 2868         -
        let mut http_request = http::Request::builder()
 2869         -
            .uri("/HttpPayloadTraitsWithMediaType")
 2870         -
            .method("POST")
 2871         -
            .header("Content-Type", "text/plain")
 2872         -
            .header("X-Foo", "Foo")
 2873         -
            .body(::aws_smithy_http_server::body::Body::from(
 2874         -
                ::bytes::Bytes::from_static("blobby blob blob".as_bytes()),
 2875         -
            ))
 2876         -
            .unwrap();
 2877         -
        #[allow(unused_mut)]
 2878         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 2879         -
        let config = crate::service::RestJsonConfig::builder().build();
 2880         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 2881         -
            .http_payload_traits_with_media_type(
 2882         -
                move |input: crate::input::HttpPayloadTraitsWithMediaTypeInput| {
 2883         -
                    let sender = sender.clone();
 2884         -
                    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         -
                        };
 2899         -
                        sender.send(()).await.expect("receiver dropped early");
 2900         -
                        result
 2901         -
                    }
 2902         -
                },
 2903         -
            )
 2904         -
            .build_unchecked();
 2905         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 2906         -
            .await
 2907         -
            .expect("unable to make an HTTP request");
 2908         -
        assert!(receiver.recv().await.is_some());
        1787  +
    #[::tracing_test::traced_test]
        1788  +
    async fn rest_json_with_body_expects_application_json_content_type_malformed_request() {
        1789  +
        {
        1790  +
            #[allow(unused_mut)]
        1791  +
            let mut http_request = http::Request::builder()
        1792  +
                .uri("/MalformedContentTypeWithBody")
        1793  +
                .method("POST")
        1794  +
                .header("content-type", "application/hal+json")
        1795  +
                .body(::aws_smithy_http_server::body::Body::from(
        1796  +
                    ::bytes::Bytes::from_static("{}".as_bytes()),
        1797  +
                ))
        1798  +
                .unwrap();
        1799  +
            #[allow(unused_mut)]
        1800  +
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
        1801  +
            let config = crate::service::RestJsonConfig::builder().build();
        1802  +
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
        1803  +
                            .malformed_content_type_with_body(move |input: crate::input::MalformedContentTypeWithBodyInput| {
        1804  +
                                let sender = sender.clone();
        1805  +
                                async move {
        1806  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedContentTypeWithBodyOutput };
        1807  +
                                    sender.send(()).await.expect("receiver dropped early");
        1808  +
                                    result
        1809  +
                                }
        1810  +
                            })
        1811  +
                            .build_unchecked();
        1812  +
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
        1813  +
                .await
        1814  +
                .expect("unable to make an HTTP request");
        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  +
            ));
        1824  +
        }
 2909   1825   
    }
 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         -
        ::pretty_assertions::assert_eq!(
 2921         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
 2922         -
            http_response.status()
 2923         -
        );
 2924         -
        let expected_headers = [("Content-Type", "text/plain"), ("X-Foo", "Foo")];
 2925         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 2926         -
            http_response.headers(),
 2927         -
            expected_headers,
 2928         -
        ));
 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         -
        ));
        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>>
 2937   1834   
    }
 2938   1835   
}
 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
 2944         -
    #[::tokio::test]
 2945         -
    async fn rest_json_http_payload_with_structure_request() {
 2946         -
        #[allow(unused_mut)]
 2947         -
        let mut http_request = http::Request::builder()
 2948         -
            .uri("/HttpPayloadWithStructure")
 2949         -
            .method("PUT")
 2950         -
            .header("Content-Type", "application/json")
 2951         -
            .body(::aws_smithy_http_server::body::Body::from(
 2952         -
                ::bytes::Bytes::from_static(
 2953         -
                    "{\n    \"greeting\": \"hello\",\n    \"name\": \"Phreddy\"\n}".as_bytes(),
 2954         -
                ),
 2955         -
            ))
 2956         -
            .unwrap();
 2957         -
        #[allow(unused_mut)]
 2958         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 2959         -
        let config = crate::service::RestJsonConfig::builder().build();
 2960         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 2961         -
            .http_payload_with_structure(
 2962         -
                move |input: crate::input::HttpPayloadWithStructureInput| {
 2963         -
                    let sender = sender.clone();
 2964         -
                    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         -
                        };
 2981         -
                        sender.send(()).await.expect("receiver dropped early");
 2982         -
                        result
 2983         -
                    }
 2984         -
                },
 2985         -
            )
 2986         -
            .build_unchecked();
 2987         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 2988         -
            .await
 2989         -
            .expect("unable to make an HTTP request");
 2990         -
        assert!(receiver.recv().await.is_some());
        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)
 2991   1849   
    }
 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         -
            }),
        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)
 3001   1879   
        };
 3002         -
        use ::aws_smithy_http_server::response::IntoResponse;
 3003         -
        let http_response = output.into_response();
 3004         -
        ::pretty_assertions::assert_eq!(
 3005         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
 3006         -
            http_response.status()
        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  +
            },
 3007   1888   
        );
 3008         -
        let expected_headers = [("Content-Type", "application/json")];
 3009         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 3010         -
            http_response.headers(),
 3011         -
            expected_headers,
 3012         -
        ));
 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         -
        ));
        1889  +
        MalformedContentTypeWithoutBodyInputFuture {
        1890  +
            inner: Box::pin(fut),
        1891  +
        }
 3021   1892   
    }
 3022   1893   
}
 3023         -
#[cfg(test)]
        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  +
 3024   1910   
#[allow(unreachable_code, unused_variables)]
 3025         -
mod server_http_payload_with_union_test {
 3026         -
    /// Serializes a union in the payload.
 3027         -
    /// Test ID: RestJsonHttpPayloadWithUnion
        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
 3028   1916   
    #[::tokio::test]
 3029         -
    async fn rest_json_http_payload_with_union_request() {
 3030         -
        #[allow(unused_mut)]
 3031         -
        let mut http_request = http::Request::builder()
 3032         -
            .uri("/HttpPayloadWithUnion")
 3033         -
            .method("PUT")
 3034         -
            .header("Content-Type", "application/json")
 3035         -
            .body(::aws_smithy_http_server::body::Body::from(
 3036         -
                ::bytes::Bytes::from_static("{\n    \"greeting\": \"hello\"\n}".as_bytes()),
 3037         -
            ))
 3038         -
            .unwrap();
 3039         -
        #[allow(unused_mut)]
 3040         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 3041         -
        let config = crate::service::RestJsonConfig::builder().build();
 3042         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 3043         -
            .http_payload_with_union(move |input: crate::input::HttpPayloadWithUnionInput| {
 3044         -
                let sender = sender.clone();
 3045         -
                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         -
                    };
 3058         -
                    sender.send(()).await.expect("receiver dropped early");
 3059         -
                    result
 3060         -
                }
 3061         -
            })
 3062         -
            .build_unchecked();
 3063         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 3064         -
            .await
 3065         -
            .expect("unable to make an HTTP request");
 3066         -
        assert!(receiver.recv().await.is_some());
        1917  +
    #[::tracing_test::traced_test]
        1918  +
    async fn rest_json_without_body_expects_empty_content_type_malformed_request() {
        1919  +
        {
        1920  +
            #[allow(unused_mut)]
        1921  +
            let mut http_request = http::Request::builder()
        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();
        1929  +
            #[allow(unused_mut)]
        1930  +
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
        1931  +
            let config = crate::service::RestJsonConfig::builder().build();
        1932  +
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
        1933  +
                            .malformed_content_type_without_body(move |input: crate::input::MalformedContentTypeWithoutBodyInput| {
        1934  +
                                let sender = sender.clone();
        1935  +
                                async move {
        1936  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedContentTypeWithoutBodyOutput };
        1937  +
                                    sender.send(()).await.expect("receiver dropped early");
        1938  +
                                    result
        1939  +
                                }
        1940  +
                            })
        1941  +
                            .build_unchecked();
        1942  +
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
        1943  +
                .await
        1944  +
                .expect("unable to make an HTTP request");
        1945  +
            ::pretty_assertions::assert_eq!(
        1946  +
                http::StatusCode::from_u16(415).expect("invalid expected HTTP status code"),
        1947  +
                http_response.status()
        1948  +
            );
        1949  +
            let expected_headers = [("x-amzn-errortype", "UnsupportedMediaTypeException")];
        1950  +
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
        1951  +
                http_response.headers(),
        1952  +
                expected_headers,
        1953  +
            ));
        1954  +
        }
 3067   1955   
    }
 3068         -
    /// No payload is sent if the union has no value.
 3069         -
    /// Test ID: RestJsonHttpPayloadWithUnsetUnion
 3070         -
    #[::tokio::test]
 3071         -
    async fn rest_json_http_payload_with_unset_union_request() {
 3072         -
        #[allow(unused_mut)]
 3073         -
        let mut http_request = http::Request::builder()
 3074         -
            .uri("/HttpPayloadWithUnion")
 3075         -
            .method("PUT")
 3076         -
            .body(::aws_smithy_http_server::body::Body::from(
 3077         -
                ::bytes::Bytes::from_static("".as_bytes()),
 3078         -
            ))
 3079         -
            .unwrap();
 3080         -
        #[allow(unused_mut)]
 3081         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 3082         -
        let config = crate::service::RestJsonConfig::builder().build();
 3083         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 3084         -
            .http_payload_with_union(move |input: crate::input::HttpPayloadWithUnionInput| {
 3085         -
                let sender = sender.clone();
 3086         -
                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         -
                    };
 3097         -
                    sender.send(()).await.expect("receiver dropped early");
 3098         -
                    result
 3099         -
                }
 3100         -
            })
 3101         -
            .build_unchecked();
 3102         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 3103         -
            .await
 3104         -
            .expect("unable to make an HTTP request");
 3105         -
        assert!(receiver.recv().await.is_some());
        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>>
 3106   1964   
    }
 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         -
        ::pretty_assertions::assert_eq!(
 3119         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
 3120         -
            http_response.status()
 3121         -
        );
 3122         -
        let expected_headers = [("Content-Type", "application/json")];
 3123         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 3124         -
            http_response.headers(),
 3125         -
            expected_headers,
 3126         -
        ));
 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         -
        ));
        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)
 3135   1979   
    }
 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,
        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)
 3142   2009   
        };
 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()
        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  +
            },
 3148   2018   
        );
 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(), "");
        2019  +
        MalformedTimestampBodyHttpDateInputFuture {
        2020  +
            inner: Box::pin(fut),
        2021  +
        }
 3159   2022   
    }
 3160   2023   
}
 3161         -
#[cfg(test)]
        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))
        2035  +
                        }
        2036  +
                    }
        2037  +
    }
        2038  +
}
        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()));
        2048  +
                response
        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))
        2053  +
            }
        2054  +
        }
        2055  +
    }
        2056  +
}
        2057  +
 3162   2058   
#[allow(unreachable_code, unused_variables)]
 3163         -
mod server_http_prefix_headers_test {
 3164         -
    /// Adds headers by prefix
 3165         -
    /// Test ID: RestJsonHttpPrefixHeadersArePresent
        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
 3166   2065   
    #[::tokio::test]
 3167         -
    async fn rest_json_http_prefix_headers_are_present_request() {
 3168         -
        #[allow(unused_mut)]
 3169         -
        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")
 3175         -
            .body(::aws_smithy_http_server::body::Body::from(
 3176         -
                ::bytes::Bytes::from_static("".as_bytes()),
 3177         -
            ))
 3178         -
            .unwrap();
 3179         -
        #[allow(unused_mut)]
 3180         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 3181         -
        let config = crate::service::RestJsonConfig::builder().build();
 3182         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 3183         -
            .http_prefix_headers(move |input: crate::input::HttpPrefixHeadersInput| {
 3184         -
                let sender = sender.clone();
 3185         -
                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         -
                    };
 3209         -
                    sender.send(()).await.expect("receiver dropped early");
 3210         -
                    result
 3211         -
                }
 3212         -
            })
 3213         -
            .build_unchecked();
 3214         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 3215         -
            .await
 3216         -
            .expect("unable to make an HTTP request");
 3217         -
        assert!(receiver.recv().await.is_some());
        2066  +
    #[::tracing_test::traced_test]
        2067  +
    async fn rest_json_body_timestamp_http_date_rejects_date_time_case0_malformed_request() {
        2068  +
        {
        2069  +
            #[allow(unused_mut)]
        2070  +
            let mut http_request = http::Request::builder()
        2071  +
                .uri("/MalformedTimestampBodyHttpDate")
        2072  +
                .method("POST")
        2073  +
                .header("content-type", "application/json")
        2074  +
                .body(::aws_smithy_http_server::body::Body::from(
        2075  +
                    ::bytes::Bytes::from_static(
        2076  +
                        "{ \"timestamp\": \"1985-04-12T23:20:50.52Z\" }".as_bytes(),
        2077  +
                    ),
        2078  +
                ))
        2079  +
                .unwrap();
        2080  +
            #[allow(unused_mut)]
        2081  +
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
        2082  +
            let config = crate::service::RestJsonConfig::builder().build();
        2083  +
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
        2084  +
                            .malformed_timestamp_body_http_date(move |input: crate::input::MalformedTimestampBodyHttpDateInput| {
        2085  +
                                let sender = sender.clone();
        2086  +
                                async move {
        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> };
        2088  +
                                    sender.send(()).await.expect("receiver dropped early");
        2089  +
                                    result
        2090  +
                                }
        2091  +
                            })
        2092  +
                            .build_unchecked();
        2093  +
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
        2094  +
                .await
        2095  +
                .expect("unable to make an HTTP request");
        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  +
            ));
        2105  +
        }
 3218   2106   
    }
 3219         -
    /// Adds headers by prefix
 3220         -
    /// Test ID: RestJsonHttpPrefixHeadersArePresent
        2107  +
    /// When the format is http-date, RFC3339 timestamps are rejected with a
        2108  +
    /// 400 SerializationException
        2109  +
    /// Test ID: RestJsonBodyTimestampHttpDateRejectsDateTime_case1
 3221   2110   
    #[::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         -
        ::pretty_assertions::assert_eq!(
 3241         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
 3242         -
            http_response.status()
 3243         -
        );
 3244         -
        let expected_headers = [
 3245         -
            ("X-Foo", "Foo"),
 3246         -
            ("X-Foo-Abc", "Abc value"),
 3247         -
            ("X-Foo-Def", "Def value"),
 3248         -
        ];
 3249         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 3250         -
            http_response.headers(),
 3251         -
            expected_headers,
 3252         -
        ));
        2111  +
    #[::tracing_test::traced_test]
        2112  +
    async fn rest_json_body_timestamp_http_date_rejects_date_time_case1_malformed_request() {
        2113  +
        {
        2114  +
            #[allow(unused_mut)]
        2115  +
            let mut http_request = http::Request::builder()
        2116  +
                .uri("/MalformedTimestampBodyHttpDate")
        2117  +
                .method("POST")
        2118  +
                .header("content-type", "application/json")
        2119  +
                .body(::aws_smithy_http_server::body::Body::from(
        2120  +
                    ::bytes::Bytes::from_static(
        2121  +
                        "{ \"timestamp\": \"1985-04-12T23:20:50Z\" }".as_bytes(),
        2122  +
                    ),
        2123  +
                ))
        2124  +
                .unwrap();
        2125  +
            #[allow(unused_mut)]
        2126  +
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
        2127  +
            let config = crate::service::RestJsonConfig::builder().build();
        2128  +
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
        2129  +
                            .malformed_timestamp_body_http_date(move |input: crate::input::MalformedTimestampBodyHttpDateInput| {
        2130  +
                                let sender = sender.clone();
        2131  +
                                async move {
        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> };
        2133  +
                                    sender.send(()).await.expect("receiver dropped early");
        2134  +
                                    result
        2135  +
                                }
        2136  +
                            })
        2137  +
                            .build_unchecked();
        2138  +
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
        2139  +
                .await
        2140  +
                .expect("unable to make an HTTP request");
        2141  +
            ::pretty_assertions::assert_eq!(
        2142  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
        2143  +
                http_response.status()
        2144  +
            );
        2145  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
        2146  +
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
        2147  +
                http_response.headers(),
        2148  +
                expected_headers,
        2149  +
            ));
        2150  +
        }
 3253   2151   
    }
 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
        2152  +
    /// When the format is http-date, RFC3339 timestamps are rejected with a
        2153  +
    /// 400 SerializationException
        2154  +
    /// Test ID: RestJsonBodyTimestampHttpDateRejectsDateTime_case2
 3260   2155   
    #[::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         -
        ));
        2156  +
    #[::tracing_test::traced_test]
        2157  +
    async fn rest_json_body_timestamp_http_date_rejects_date_time_case2_malformed_request() {
        2158  +
        {
        2159  +
            #[allow(unused_mut)]
        2160  +
            let mut http_request = http::Request::builder()
        2161  +
                .uri("/MalformedTimestampBodyHttpDate")
        2162  +
                .method("POST")
        2163  +
                .header("content-type", "application/json")
        2164  +
                .body(::aws_smithy_http_server::body::Body::from(
        2165  +
                    ::bytes::Bytes::from_static(
        2166  +
                        "{ \"timestamp\": \"1996-12-19T16:39:57-08:00\" }".as_bytes(),
        2167  +
                    ),
        2168  +
                ))
        2169  +
                .unwrap();
        2170  +
            #[allow(unused_mut)]
        2171  +
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
        2172  +
            let config = crate::service::RestJsonConfig::builder().build();
        2173  +
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
        2174  +
                            .malformed_timestamp_body_http_date(move |input: crate::input::MalformedTimestampBodyHttpDateInput| {
        2175  +
                                let sender = sender.clone();
        2176  +
                                async move {
        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> };
        2178  +
                                    sender.send(()).await.expect("receiver dropped early");
        2179  +
                                    result
        2180  +
                                }
        2181  +
                            })
        2182  +
                            .build_unchecked();
        2183  +
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
        2184  +
                .await
        2185  +
                .expect("unable to make an HTTP request");
        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  +
            ));
        2195  +
        }
 3281   2196   
    }
 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
        2197  +
    /// When the format is http-date, epoch-seconds timestamps are rejected with a
        2198  +
    /// 400 SerializationException
        2199  +
    /// Test ID: RestJsonBodyTimestampHttpDateRejectsEpoch_case0
 3288   2200   
    #[::tokio::test]
 3289         -
    async fn rest_json_supports_na_n_float_labels_request() {
 3290         -
        #[allow(unused_mut)]
 3291         -
        let mut http_request = http::Request::builder()
 3292         -
            .uri("/FloatHttpLabels/NaN/NaN")
 3293         -
            .method("GET")
 3294         -
            .body(::aws_smithy_http_server::body::Body::from(
 3295         -
                ::bytes::Bytes::from_static("".as_bytes()),
 3296         -
            ))
 3297         -
            .unwrap();
 3298         -
        #[allow(unused_mut)]
 3299         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 3300         -
        let config = crate::service::RestJsonConfig::builder().build();
 3301         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 3302         -
                        .http_request_with_float_labels(move |input: crate::input::HttpRequestWithFloatLabelsInput| {
 3303         -
                            let sender = sender.clone();
 3304         -
                            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) };
 3325         -
                                sender.send(()).await.expect("receiver dropped early");
 3326         -
                                result
 3327         -
                            }
 3328         -
                        })
 3329         -
                        .build_unchecked();
 3330         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 3331         -
            .await
 3332         -
            .expect("unable to make an HTTP request");
 3333         -
        assert!(receiver.recv().await.is_some());
        2201  +
    #[::tracing_test::traced_test]
        2202  +
    async fn rest_json_body_timestamp_http_date_rejects_epoch_case0_malformed_request() {
        2203  +
        {
        2204  +
            #[allow(unused_mut)]
        2205  +
            let mut http_request = http::Request::builder()
        2206  +
                .uri("/MalformedTimestampBodyHttpDate")
        2207  +
                .method("POST")
        2208  +
                .header("content-type", "application/json")
        2209  +
                .body(::aws_smithy_http_server::body::Body::from(
        2210  +
                    ::bytes::Bytes::from_static("{ \"timestamp\": 1515531081.1234 }".as_bytes()),
        2211  +
                ))
        2212  +
                .unwrap();
        2213  +
            #[allow(unused_mut)]
        2214  +
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
        2215  +
            let config = crate::service::RestJsonConfig::builder().build();
        2216  +
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
        2217  +
                            .malformed_timestamp_body_http_date(move |input: crate::input::MalformedTimestampBodyHttpDateInput| {
        2218  +
                                let sender = sender.clone();
        2219  +
                                async move {
        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> };
        2221  +
                                    sender.send(()).await.expect("receiver dropped early");
        2222  +
                                    result
        2223  +
                                }
        2224  +
                            })
        2225  +
                            .build_unchecked();
        2226  +
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
        2227  +
                .await
        2228  +
                .expect("unable to make an HTTP request");
        2229  +
            ::pretty_assertions::assert_eq!(
        2230  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
        2231  +
                http_response.status()
        2232  +
            );
        2233  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
        2234  +
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
        2235  +
                http_response.headers(),
        2236  +
                expected_headers,
        2237  +
            ));
        2238  +
        }
 3334   2239   
    }
 3335         -
    /// Supports handling Infinity float label values.
 3336         -
    /// Test ID: RestJsonSupportsInfinityFloatLabels
        2240  +
    /// When the format is http-date, epoch-seconds timestamps are rejected with a
        2241  +
    /// 400 SerializationException
        2242  +
    /// Test ID: RestJsonBodyTimestampHttpDateRejectsEpoch_case1
 3337   2243   
    #[::tokio::test]
 3338         -
    async fn rest_json_supports_infinity_float_labels_request() {
 3339         -
        #[allow(unused_mut)]
 3340         -
        let mut http_request = http::Request::builder()
 3341         -
            .uri("/FloatHttpLabels/Infinity/Infinity")
 3342         -
            .method("GET")
 3343         -
            .body(::aws_smithy_http_server::body::Body::from(
 3344         -
                ::bytes::Bytes::from_static("".as_bytes()),
 3345         -
            ))
 3346         -
            .unwrap();
 3347         -
        #[allow(unused_mut)]
 3348         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 3349         -
        let config = crate::service::RestJsonConfig::builder().build();
 3350         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 3351         -
                        .http_request_with_float_labels(move |input: crate::input::HttpRequestWithFloatLabelsInput| {
 3352         -
                            let sender = sender.clone();
 3353         -
                            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) };
 3374         -
                                sender.send(()).await.expect("receiver dropped early");
 3375         -
                                result
 3376         -
                            }
 3377         -
                        })
 3378         -
                        .build_unchecked();
 3379         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 3380         -
            .await
 3381         -
            .expect("unable to make an HTTP request");
 3382         -
        assert!(receiver.recv().await.is_some());
        2244  +
    #[::tracing_test::traced_test]
        2245  +
    async fn rest_json_body_timestamp_http_date_rejects_epoch_case1_malformed_request() {
        2246  +
        {
        2247  +
            #[allow(unused_mut)]
        2248  +
            let mut http_request = http::Request::builder()
        2249  +
                .uri("/MalformedTimestampBodyHttpDate")
        2250  +
                .method("POST")
        2251  +
                .header("content-type", "application/json")
        2252  +
                .body(::aws_smithy_http_server::body::Body::from(
        2253  +
                    ::bytes::Bytes::from_static("{ \"timestamp\": 1515531081 }".as_bytes()),
        2254  +
                ))
        2255  +
                .unwrap();
        2256  +
            #[allow(unused_mut)]
        2257  +
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
        2258  +
            let config = crate::service::RestJsonConfig::builder().build();
        2259  +
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
        2260  +
                            .malformed_timestamp_body_http_date(move |input: crate::input::MalformedTimestampBodyHttpDateInput| {
        2261  +
                                let sender = sender.clone();
        2262  +
                                async move {
        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> };
        2264  +
                                    sender.send(()).await.expect("receiver dropped early");
        2265  +
                                    result
        2266  +
                                }
        2267  +
                            })
        2268  +
                            .build_unchecked();
        2269  +
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
        2270  +
                .await
        2271  +
                .expect("unable to make an HTTP request");
        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  +
        }
 3383   2282   
    }
 3384         -
    /// Supports handling -Infinity float label values.
 3385         -
    /// Test ID: RestJsonSupportsNegativeInfinityFloatLabels
 3386         -
    #[::tokio::test]
 3387         -
    async fn rest_json_supports_negative_infinity_float_labels_request() {
 3388         -
        #[allow(unused_mut)]
 3389         -
        let mut http_request = http::Request::builder()
 3390         -
            .uri("/FloatHttpLabels/-Infinity/-Infinity")
 3391         -
            .method("GET")
 3392         -
            .body(::aws_smithy_http_server::body::Body::from(
 3393         -
                ::bytes::Bytes::from_static("".as_bytes()),
 3394         -
            ))
 3395         -
            .unwrap();
 3396         -
        #[allow(unused_mut)]
 3397         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 3398         -
        let config = crate::service::RestJsonConfig::builder().build();
 3399         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 3400         -
                        .http_request_with_float_labels(move |input: crate::input::HttpRequestWithFloatLabelsInput| {
 3401         -
                            let sender = sender.clone();
 3402         -
                            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) };
 3423         -
                                sender.send(()).await.expect("receiver dropped early");
 3424         -
                                result
 3425         -
                            }
 3426         -
                        })
 3427         -
                        .build_unchecked();
 3428         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 3429         -
            .await
 3430         -
            .expect("unable to make an HTTP request");
 3431         -
        assert!(receiver.recv().await.is_some());
        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>>
 3432   2291   
    }
 3433   2292   
}
 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
 3439         -
    #[::tokio::test]
 3440         -
    async fn rest_json_http_request_with_greedy_label_in_path_request() {
 3441         -
        #[allow(unused_mut)]
 3442         -
        let mut http_request = http::Request::builder()
 3443         -
            .uri("/HttpRequestWithGreedyLabelInPath/foo/hello%2Fescape/baz/there/guy")
 3444         -
            .method("GET")
 3445         -
            .body(::aws_smithy_http_server::body::Body::from(
 3446         -
                ::bytes::Bytes::from_static("".as_bytes()),
 3447         -
            ))
 3448         -
            .unwrap();
 3449         -
        #[allow(unused_mut)]
 3450         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 3451         -
        let config = crate::service::RestJsonConfig::builder().build();
 3452         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 3453         -
            .http_request_with_greedy_label_in_path(
 3454         -
                move |input: crate::input::HttpRequestWithGreedyLabelInPathInput| {
 3455         -
                    let sender = sender.clone();
 3456         -
                    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         -
                        };
 3466         -
                        sender.send(()).await.expect("receiver dropped early");
 3467         -
                        result
 3468         -
                    }
 3469         -
                },
 3470         -
            )
 3471         -
            .build_unchecked();
 3472         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 3473         -
            .await
 3474         -
            .expect("unable to make an HTTP request");
 3475         -
        assert!(receiver.recv().await.is_some());
        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)
 3476   2306   
    }
 3477   2307   
}
 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
 3483         -
    #[::tokio::test]
 3484         -
    async fn rest_json_input_with_headers_and_all_params_request() {
 3485         -
        #[allow(unused_mut)]
 3486         -
        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")
 3489         -
            .body(::aws_smithy_http_server::body::Body::from(
 3490         -
                ::bytes::Bytes::from_static("".as_bytes()),
 3491         -
            ))
 3492         -
            .unwrap();
 3493         -
        #[allow(unused_mut)]
 3494         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 3495         -
        let config = crate::service::RestJsonConfig::builder().build();
 3496         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 3497         -
            .http_request_with_labels(move |input: crate::input::HttpRequestWithLabelsInput| {
 3498         -
                let sender = sender.clone();
 3499         -
                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         -
                    };
 3559         -
                    sender.send(()).await.expect("receiver dropped early");
 3560         -
                    result
 3561         -
                }
 3562         -
            })
 3563         -
            .build_unchecked();
 3564         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 3565         -
            .await
 3566         -
            .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         -
                        ::pretty_assertions::assert_eq!(
 3637         -
                            input.timestamp,
 3638         -
                            expected.timestamp,
 3639         -
                            "Unexpected value for `timestamp`"
 3640         -
                        );
 3641         -
                        let response = crate::output::HttpRequestWithLabelsOutput {};
 3642         -
                        Ok(response)
 3643         -
                    };
 3644         -
                    sender.send(()).await.expect("receiver dropped early");
 3645         -
                    result
 3646         -
                }
 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         -
    }
 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
 3660         -
    #[::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 =
 3677         -
                                {
 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 {
        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);
 3706   2332   
            }
 3707         -
        ;
 3708         -
                                    Ok(response)
 3709         -
                                };
 3710         -
                            sender.send(()).await.expect("receiver dropped early");
 3711         -
                            result
 3712         -
                        }
 3713         -
                    },
        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,
 3714   2343   
                )
 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());
        2344  +
            },
        2345  +
        );
        2346  +
        MalformedTimestampBodyDateTimeInputFuture {
        2347  +
            inner: Box::pin(fut),
        2348  +
        }
 3720   2349   
    }
 3721   2350   
}
 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         -
        #[allow(unused_mut)]
 3730         -
        let mut http_request = http::Request::builder()
 3731         -
            .uri("/ReDosLiteral/abc/(a+)+")
 3732         -
            .method("GET")
 3733         -
            .body(::aws_smithy_http_server::body::Body::from(
 3734         -
                ::bytes::Bytes::from_static("".as_bytes()),
 3735         -
            ))
 3736         -
            .unwrap();
 3737         -
        #[allow(unused_mut)]
 3738         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 3739         -
        let config = crate::service::RestJsonConfig::builder().build();
 3740         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 3741         -
            .http_request_with_regex_literal(
 3742         -
                move |input: crate::input::HttpRequestWithRegexLiteralInput| {
 3743         -
                    let sender = sender.clone();
 3744         -
                    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         -
                        };
 3753         -
                        sender.send(()).await.expect("receiver dropped early");
 3754         -
                        result
        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  +
                        }
 3755   2363   
                    }
 3756         -
                },
 3757         -
            )
 3758         -
            .build_unchecked();
 3759         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 3760         -
            .await
 3761         -
            .expect("unable to make an HTTP request");
 3762         -
        assert!(receiver.recv().await.is_some());
 3763   2364   
    }
 3764   2365   
}
 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         -
        ::pretty_assertions::assert_eq!(
 3782         -
            http::StatusCode::from_u16(201).expect("invalid expected HTTP status code"),
 3783         -
            http_response.status()
 3784         -
        );
 3785         -
        let expected_headers = [("Content-Type", "application/json")];
 3786         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 3787         -
            http_response.headers(),
 3788         -
            expected_headers,
 3789         -
        ));
 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         -
    }
 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         -
        ));
        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  +
        }
 3828   2382   
    }
 3829   2383   
}
 3830         -
#[cfg(test)]
        2384  +
 3831   2385   
#[allow(unreachable_code, unused_variables)]
 3832         -
mod server_http_string_payload_test {
 3833         -
    /// Test ID: RestJsonStringPayloadRequest
 3834         -
    #[::tokio::test]
 3835         -
    #[should_panic]
 3836         -
    async fn rest_json_string_payload_request_request() {
 3837         -
        #[allow(unused_mut)]
 3838         -
        let mut http_request = http::Request::builder()
 3839         -
            .uri("/StringPayload")
 3840         -
            .method("POST")
 3841         -
            .body(::aws_smithy_http_server::body::Body::from(
 3842         -
                ::bytes::Bytes::from_static("rawstring".as_bytes()),
 3843         -
            ))
 3844         -
            .unwrap();
 3845         -
        #[allow(unused_mut)]
 3846         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 3847         -
        let config = crate::service::RestJsonConfig::builder().build();
 3848         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 3849         -
            .http_string_payload(move |input: crate::input::HttpStringPayloadInput| {
 3850         -
                let sender = sender.clone();
 3851         -
                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         -
                    };
 3862         -
                    sender.send(()).await.expect("receiver dropped early");
 3863         -
                    result
 3864         -
                }
 3865         -
            })
 3866         -
            .build_unchecked();
 3867         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 3868         -
            .await
 3869         -
            .expect("unable to make an HTTP request");
 3870         -
        assert!(receiver.recv().await.is_some());
 3871         -
    }
 3872         -
    /// Test ID: RestJsonStringPayloadResponse
        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
 3873   2392   
    #[::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         -
        ::pretty_assertions::assert_eq!(
 3881         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
 3882         -
            http_response.status()
 3883         -
        );
 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         -
        ));
        2393  +
    #[::tracing_test::traced_test]
        2394  +
    async fn rest_json_body_timestamp_date_time_rejects_http_date_case0_malformed_request() {
        2395  +
        {
        2396  +
            #[allow(unused_mut)]
        2397  +
            let mut http_request = http::Request::builder()
        2398  +
                .uri("/MalformedTimestampBodyDateTime")
        2399  +
                .method("POST")
        2400  +
                .header("content-type", "application/json")
        2401  +
                .body(::aws_smithy_http_server::body::Body::from(
        2402  +
                    ::bytes::Bytes::from_static(
        2403  +
                        "{ \"timestamp\": \"Tue, 29 Apr 2014 18:30:38 GMT\" }".as_bytes(),
        2404  +
                    ),
        2405  +
                ))
        2406  +
                .unwrap();
        2407  +
            #[allow(unused_mut)]
        2408  +
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
        2409  +
            let config = crate::service::RestJsonConfig::builder().build();
        2410  +
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
        2411  +
                            .malformed_timestamp_body_date_time(move |input: crate::input::MalformedTimestampBodyDateTimeInput| {
        2412  +
                                let sender = sender.clone();
        2413  +
                                async move {
        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> };
        2415  +
                                    sender.send(()).await.expect("receiver dropped early");
        2416  +
                                    result
        2417  +
                                }
        2418  +
                            })
        2419  +
                            .build_unchecked();
        2420  +
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
        2421  +
                .await
        2422  +
                .expect("unable to make an HTTP request");
        2423  +
            ::pretty_assertions::assert_eq!(
        2424  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
        2425  +
                http_response.status()
        2426  +
            );
        2427  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
        2428  +
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
        2429  +
                http_response.headers(),
        2430  +
                expected_headers,
        2431  +
            ));
        2432  +
        }
 3892   2433   
    }
 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
        2434  +
    /// When the format is date-time, epoch-seconds timestamps are rejected with a
        2435  +
    /// 400 SerializationException
        2436  +
    /// Test ID: RestJsonBodyTimestampDateTimeRejectsEpochSeconds_case0
 3902   2437   
    #[::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")];
 3914         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 3915         -
            http_response.headers(),
 3916         -
            expected_headers,
 3917         -
        ));
 3918         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
 3919         -
            .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         -
        ));
        2438  +
    #[::tracing_test::traced_test]
        2439  +
    async fn rest_json_body_timestamp_date_time_rejects_epoch_seconds_case0_malformed_request() {
        2440  +
        {
        2441  +
            #[allow(unused_mut)]
        2442  +
            let mut http_request = http::Request::builder()
        2443  +
                .uri("/MalformedTimestampBodyDateTime")
        2444  +
                .method("POST")
        2445  +
                .header("content-type", "application/json")
        2446  +
                .body(::aws_smithy_http_server::body::Body::from(
        2447  +
                    ::bytes::Bytes::from_static("{ \"timestamp\": 1515531081.1234 }".as_bytes()),
        2448  +
                ))
        2449  +
                .unwrap();
        2450  +
            #[allow(unused_mut)]
        2451  +
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
        2452  +
            let config = crate::service::RestJsonConfig::builder().build();
        2453  +
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
        2454  +
                            .malformed_timestamp_body_date_time(move |input: crate::input::MalformedTimestampBodyDateTimeInput| {
        2455  +
                                let sender = sender.clone();
        2456  +
                                async move {
        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> };
        2458  +
                                    sender.send(()).await.expect("receiver dropped early");
        2459  +
                                    result
        2460  +
                                }
        2461  +
                            })
        2462  +
                            .build_unchecked();
        2463  +
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
        2464  +
                .await
        2465  +
                .expect("unable to make an HTTP request");
        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  +
            ));
        2475  +
        }
 3926   2476   
    }
 3927         -
}
 3928         -
#[cfg(test)]
 3929         -
#[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
        2477  +
    /// When the format is date-time, epoch-seconds timestamps are rejected with a
        2478  +
    /// 400 SerializationException
        2479  +
    /// Test ID: RestJsonBodyTimestampDateTimeRejectsEpochSeconds_case1
 3933   2480   
    #[::tokio::test]
 3934         -
    async fn rest_json_input_and_output_with_string_headers_request() {
 3935         -
        #[allow(unused_mut)]
 3936         -
        let mut http_request = http::Request::builder()
 3937         -
            .uri("/InputAndOutputWithHeaders")
 3938         -
            .method("POST")
 3939         -
            .header("X-String", "Hello")
 3940         -
            .header("X-StringList", "a, b, c")
 3941         -
            .header("X-StringSet", "a, b, c")
 3942         -
            .body(::aws_smithy_http_server::body::Body::from(
 3943         -
                ::bytes::Bytes::from_static("".as_bytes()),
 3944         -
            ))
 3945         -
            .unwrap();
 3946         -
        #[allow(unused_mut)]
 3947         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 3948         -
        let config = crate::service::RestJsonConfig::builder().build();
 3949         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 3950         -
            .input_and_output_with_headers(
 3951         -
                move |input: crate::input::InputAndOutputWithHeadersInput| {
 3952         -
                    let sender = sender.clone();
 3953         -
                    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         -
                        };
 4098         -
                        sender.send(()).await.expect("receiver dropped early");
 4099         -
                        result
 4100         -
                    }
 4101         -
                },
 4102         -
            )
 4103         -
            .build_unchecked();
 4104         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 4105         -
            .await
 4106         -
            .expect("unable to make an HTTP request");
 4107         -
        assert!(receiver.recv().await.is_some());
        2481  +
    #[::tracing_test::traced_test]
        2482  +
    async fn rest_json_body_timestamp_date_time_rejects_epoch_seconds_case1_malformed_request() {
        2483  +
        {
        2484  +
            #[allow(unused_mut)]
        2485  +
            let mut http_request = http::Request::builder()
        2486  +
                .uri("/MalformedTimestampBodyDateTime")
        2487  +
                .method("POST")
        2488  +
                .header("content-type", "application/json")
        2489  +
                .body(::aws_smithy_http_server::body::Body::from(
        2490  +
                    ::bytes::Bytes::from_static("{ \"timestamp\": 1515531081 }".as_bytes()),
        2491  +
                ))
        2492  +
                .unwrap();
        2493  +
            #[allow(unused_mut)]
        2494  +
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
        2495  +
            let config = crate::service::RestJsonConfig::builder().build();
        2496  +
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
        2497  +
                            .malformed_timestamp_body_date_time(move |input: crate::input::MalformedTimestampBodyDateTimeInput| {
        2498  +
                                let sender = sender.clone();
        2499  +
                                async move {
        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> };
        2501  +
                                    sender.send(()).await.expect("receiver dropped early");
        2502  +
                                    result
        2503  +
                                }
        2504  +
                            })
        2505  +
                            .build_unchecked();
        2506  +
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
        2507  +
                .await
        2508  +
                .expect("unable to make an HTTP request");
        2509  +
            ::pretty_assertions::assert_eq!(
        2510  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
        2511  +
                http_response.status()
        2512  +
            );
        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,
        2517  +
            ));
        2518  +
        }
 4108   2519   
    }
 4109         -
    /// Tests requests with string list header bindings that require quoting
 4110         -
    /// Test ID: RestJsonInputAndOutputWithQuotedStringHeaders
        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
 4111   2523   
    #[::tokio::test]
 4112         -
    async fn rest_json_input_and_output_with_quoted_string_headers_request() {
 4113         -
        #[allow(unused_mut)]
 4114         -
        let mut http_request = http::Request::builder()
 4115         -
            .uri("/InputAndOutputWithHeaders")
 4116         -
            .method("POST")
 4117         -
            .header("X-StringList", "\"b,c\", \"\\\"def\\\"\", a")
 4118         -
            .body(::aws_smithy_http_server::body::Body::from(
 4119         -
                ::bytes::Bytes::from_static("".as_bytes()),
 4120         -
            ))
 4121         -
            .unwrap();
 4122         -
        #[allow(unused_mut)]
 4123         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 4124         -
        let config = crate::service::RestJsonConfig::builder().build();
 4125         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 4126         -
            .input_and_output_with_headers(
 4127         -
                move |input: crate::input::InputAndOutputWithHeadersInput| {
 4128         -
                    let sender = sender.clone();
 4129         -
                    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         -
                        };
 4270         -
                        sender.send(()).await.expect("receiver dropped early");
 4271         -
                        result
 4272         -
                    }
 4273         -
                },
 4274         -
            )
 4275         -
            .build_unchecked();
 4276         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 4277         -
            .await
 4278         -
            .expect("unable to make an HTTP request");
 4279         -
        assert!(receiver.recv().await.is_some());
        2524  +
    #[::tracing_test::traced_test]
        2525  +
    async fn rest_json_body_timestamp_date_time_rejects_utc_offsets_case0_malformed_request() {
        2526  +
        {
        2527  +
            #[allow(unused_mut)]
        2528  +
            let mut http_request = http::Request::builder()
        2529  +
                .uri("/MalformedTimestampBodyDateTime")
        2530  +
                .method("POST")
        2531  +
                .header("content-type", "application/json")
        2532  +
                .body(::aws_smithy_http_server::body::Body::from(
        2533  +
                    ::bytes::Bytes::from_static(
        2534  +
                        "{ \"timestamp\": \"1996-12-19T16:39:57-08:00\" }".as_bytes(),
        2535  +
                    ),
        2536  +
                ))
        2537  +
                .unwrap();
        2538  +
            #[allow(unused_mut)]
        2539  +
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
        2540  +
            let config = crate::service::RestJsonConfig::builder().build();
        2541  +
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
        2542  +
                            .malformed_timestamp_body_date_time(move |input: crate::input::MalformedTimestampBodyDateTimeInput| {
        2543  +
                                let sender = sender.clone();
        2544  +
                                async move {
        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> };
        2546  +
                                    sender.send(()).await.expect("receiver dropped early");
        2547  +
                                    result
        2548  +
                                }
        2549  +
                            })
        2550  +
                            .build_unchecked();
        2551  +
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
        2552  +
                .await
        2553  +
                .expect("unable to make an HTTP request");
        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  +
            ));
        2563  +
        }
 4280   2564   
    }
 4281         -
    /// Tests requests with numeric header bindings
 4282         -
    /// Test ID: RestJsonInputAndOutputWithNumericHeaders
        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
 4283   2568   
    #[::tokio::test]
 4284         -
    async fn rest_json_input_and_output_with_numeric_headers_request() {
 4285         -
        #[allow(unused_mut)]
 4286         -
        let mut http_request = http::Request::builder()
 4287         -
            .uri("/InputAndOutputWithHeaders")
 4288         -
            .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")
 4296         -
            .body(::aws_smithy_http_server::body::Body::from(
 4297         -
                ::bytes::Bytes::from_static("".as_bytes()),
 4298         -
            ))
 4299         -
            .unwrap();
 4300         -
        #[allow(unused_mut)]
 4301         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 4302         -
        let config = crate::service::RestJsonConfig::builder().build();
 4303         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 4304         -
            .input_and_output_with_headers(
 4305         -
                move |input: crate::input::InputAndOutputWithHeadersInput| {
 4306         -
                    let sender = sender.clone();
 4307         -
                    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         -
                        };
 4444         -
                        sender.send(()).await.expect("receiver dropped early");
 4445         -
                        result
 4446         -
                    }
 4447         -
                },
 4448         -
            )
 4449         -
            .build_unchecked();
 4450         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 4451         -
            .await
 4452         -
            .expect("unable to make an HTTP request");
 4453         -
        assert!(receiver.recv().await.is_some());
 4454         -
    }
 4455         -
    /// Tests requests with boolean header bindings
 4456         -
    /// Test ID: RestJsonInputAndOutputWithBooleanHeaders
 4457         -
    #[::tokio::test]
 4458         -
    async fn rest_json_input_and_output_with_boolean_headers_request() {
 4459         -
        #[allow(unused_mut)]
 4460         -
        let mut http_request = http::Request::builder()
 4461         -
            .uri("/InputAndOutputWithHeaders")
 4462         -
            .method("POST")
 4463         -
            .header("X-Boolean1", "true")
 4464         -
            .header("X-Boolean2", "false")
 4465         -
            .header("X-BooleanList", "true, false, true")
 4466         -
            .body(::aws_smithy_http_server::body::Body::from(
 4467         -
                ::bytes::Bytes::from_static("".as_bytes()),
 4468         -
            ))
 4469         -
            .unwrap();
 4470         -
        #[allow(unused_mut)]
 4471         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 4472         -
        let config = crate::service::RestJsonConfig::builder().build();
 4473         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 4474         -
            .input_and_output_with_headers(
 4475         -
                move |input: crate::input::InputAndOutputWithHeadersInput| {
 4476         -
                    let sender = sender.clone();
 4477         -
                    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         -
                        };
 4616         -
                        sender.send(()).await.expect("receiver dropped early");
 4617         -
                        result
 4618         -
                    }
 4619         -
                },
 4620         -
            )
 4621         -
            .build_unchecked();
 4622         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 4623         -
            .await
 4624         -
            .expect("unable to make an HTTP request");
 4625         -
        assert!(receiver.recv().await.is_some());
 4626         -
    }
 4627         -
    /// Tests requests with timestamp header bindings
 4628         -
    /// Test ID: RestJsonInputAndOutputWithTimestampHeaders
 4629         -
    #[::tokio::test]
 4630         -
    async fn rest_json_input_and_output_with_timestamp_headers_request() {
 4631         -
        #[allow(unused_mut)]
 4632         -
        let mut http_request = http::Request::builder()
 4633         -
            .uri("/InputAndOutputWithHeaders")
 4634         -
            .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         -
            )
 4639         -
            .body(::aws_smithy_http_server::body::Body::from(
 4640         -
                ::bytes::Bytes::from_static("".as_bytes()),
 4641         -
            ))
 4642         -
            .unwrap();
 4643         -
        #[allow(unused_mut)]
 4644         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 4645         -
        let config = crate::service::RestJsonConfig::builder().build();
 4646         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 4647         -
            .input_and_output_with_headers(
 4648         -
                move |input: crate::input::InputAndOutputWithHeadersInput| {
 4649         -
                    let sender = sender.clone();
 4650         -
                    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         -
                        };
 4794         -
                        sender.send(()).await.expect("receiver dropped early");
 4795         -
                        result
 4796         -
                    }
 4797         -
                },
 4798         -
            )
 4799         -
            .build_unchecked();
 4800         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 4801         -
            .await
 4802         -
            .expect("unable to make an HTTP request");
 4803         -
        assert!(receiver.recv().await.is_some());
 4804         -
    }
 4805         -
    /// Tests requests with enum header bindings
 4806         -
    /// Test ID: RestJsonInputAndOutputWithEnumHeaders
 4807         -
    #[::tokio::test]
 4808         -
    async fn rest_json_input_and_output_with_enum_headers_request() {
 4809         -
        #[allow(unused_mut)]
 4810         -
        let mut http_request = http::Request::builder()
 4811         -
            .uri("/InputAndOutputWithHeaders")
 4812         -
            .method("POST")
 4813         -
            .header("X-Enum", "Foo")
 4814         -
            .header("X-EnumList", "Foo, Bar, Baz")
 4815         -
            .body(::aws_smithy_http_server::body::Body::from(
 4816         -
                ::bytes::Bytes::from_static("".as_bytes()),
 4817         -
            ))
 4818         -
            .unwrap();
 4819         -
        #[allow(unused_mut)]
 4820         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 4821         -
        let config = crate::service::RestJsonConfig::builder().build();
 4822         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 4823         -
            .input_and_output_with_headers(
 4824         -
                move |input: crate::input::InputAndOutputWithHeadersInput| {
 4825         -
                    let sender = sender.clone();
 4826         -
                    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         -
                        };
 4977         -
                        sender.send(()).await.expect("receiver dropped early");
 4978         -
                        result
 4979         -
                    }
 4980         -
                },
 4981         -
            )
 4982         -
            .build_unchecked();
 4983         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 4984         -
            .await
 4985         -
            .expect("unable to make an HTTP request");
 4986         -
        assert!(receiver.recv().await.is_some());
 4987         -
    }
 4988         -
    /// Tests requests with intEnum header bindings
 4989         -
    /// Test ID: RestJsonInputAndOutputWithIntEnumHeaders
 4990         -
    #[::tokio::test]
 4991         -
    async fn rest_json_input_and_output_with_int_enum_headers_request() {
 4992         -
        #[allow(unused_mut)]
 4993         -
        let mut http_request = http::Request::builder()
 4994         -
            .uri("/InputAndOutputWithHeaders")
 4995         -
            .method("POST")
 4996         -
            .header("X-IntegerEnum", "1")
 4997         -
            .header("X-IntegerEnumList", "1, 2, 3")
 4998         -
            .body(::aws_smithy_http_server::body::Body::from(
 4999         -
                ::bytes::Bytes::from_static("".as_bytes()),
 5000         -
            ))
 5001         -
            .unwrap();
 5002         -
        #[allow(unused_mut)]
 5003         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 5004         -
        let config = crate::service::RestJsonConfig::builder().build();
 5005         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 5006         -
            .input_and_output_with_headers(
 5007         -
                move |input: crate::input::InputAndOutputWithHeadersInput| {
 5008         -
                    let sender = sender.clone();
 5009         -
                    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         -
                        };
 5148         -
                        sender.send(()).await.expect("receiver dropped early");
 5149         -
                        result
 5150         -
                    }
 5151         -
                },
 5152         -
            )
 5153         -
            .build_unchecked();
 5154         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 5155         -
            .await
 5156         -
            .expect("unable to make an HTTP request");
 5157         -
        assert!(receiver.recv().await.is_some());
 5158         -
    }
 5159         -
    /// Supports handling NaN float header values.
 5160         -
    /// Test ID: RestJsonSupportsNaNFloatHeaderInputs
 5161         -
    #[::tokio::test]
 5162         -
    async fn rest_json_supports_na_n_float_header_inputs_request() {
 5163         -
        #[allow(unused_mut)]
 5164         -
        let mut http_request = http::Request::builder()
 5165         -
            .uri("/InputAndOutputWithHeaders")
 5166         -
            .method("POST")
 5167         -
            .header("X-Double", "NaN")
 5168         -
            .header("X-Float", "NaN")
 5169         -
            .body(::aws_smithy_http_server::body::Body::from(
 5170         -
                ::bytes::Bytes::from_static("".as_bytes()),
 5171         -
            ))
 5172         -
            .unwrap();
 5173         -
        #[allow(unused_mut)]
 5174         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 5175         -
        let config = crate::service::RestJsonConfig::builder().build();
 5176         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 5177         -
                        .input_and_output_with_headers(move |input: crate::input::InputAndOutputWithHeadersInput| {
 5178         -
                            let sender = sender.clone();
 5179         -
                            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) };
 5322         -
                                sender.send(()).await.expect("receiver dropped early");
 5323         -
                                result
 5324         -
                            }
 5325         -
                        })
 5326         -
                        .build_unchecked();
 5327         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 5328         -
            .await
 5329         -
            .expect("unable to make an HTTP request");
 5330         -
        assert!(receiver.recv().await.is_some());
 5331         -
    }
 5332         -
    /// Supports handling Infinity float header values.
 5333         -
    /// Test ID: RestJsonSupportsInfinityFloatHeaderInputs
 5334         -
    #[::tokio::test]
 5335         -
    async fn rest_json_supports_infinity_float_header_inputs_request() {
 5336         -
        #[allow(unused_mut)]
 5337         -
        let mut http_request = http::Request::builder()
 5338         -
            .uri("/InputAndOutputWithHeaders")
 5339         -
            .method("POST")
 5340         -
            .header("X-Double", "Infinity")
 5341         -
            .header("X-Float", "Infinity")
 5342         -
            .body(::aws_smithy_http_server::body::Body::from(
 5343         -
                ::bytes::Bytes::from_static("".as_bytes()),
 5344         -
            ))
 5345         -
            .unwrap();
 5346         -
        #[allow(unused_mut)]
 5347         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 5348         -
        let config = crate::service::RestJsonConfig::builder().build();
 5349         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 5350         -
                        .input_and_output_with_headers(move |input: crate::input::InputAndOutputWithHeadersInput| {
 5351         -
                            let sender = sender.clone();
 5352         -
                            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) };
 5495         -
                                sender.send(()).await.expect("receiver dropped early");
 5496         -
                                result
 5497         -
                            }
 5498         -
                        })
 5499         -
                        .build_unchecked();
 5500         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 5501         -
            .await
 5502         -
            .expect("unable to make an HTTP request");
 5503         -
        assert!(receiver.recv().await.is_some());
 5504         -
    }
 5505         -
    /// Supports handling -Infinity float header values.
 5506         -
    /// Test ID: RestJsonSupportsNegativeInfinityFloatHeaderInputs
 5507         -
    #[::tokio::test]
 5508         -
    async fn rest_json_supports_negative_infinity_float_header_inputs_request() {
 5509         -
        #[allow(unused_mut)]
 5510         -
        let mut http_request = http::Request::builder()
 5511         -
            .uri("/InputAndOutputWithHeaders")
 5512         -
            .method("POST")
 5513         -
            .header("X-Double", "-Infinity")
 5514         -
            .header("X-Float", "-Infinity")
 5515         -
            .body(::aws_smithy_http_server::body::Body::from(
 5516         -
                ::bytes::Bytes::from_static("".as_bytes()),
 5517         -
            ))
 5518         -
            .unwrap();
 5519         -
        #[allow(unused_mut)]
 5520         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 5521         -
        let config = crate::service::RestJsonConfig::builder().build();
 5522         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 5523         -
                        .input_and_output_with_headers(move |input: crate::input::InputAndOutputWithHeadersInput| {
 5524         -
                            let sender = sender.clone();
 5525         -
                            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) };
 5668         -
                                sender.send(()).await.expect("receiver dropped early");
 5669         -
                                result
 5670         -
                            }
 5671         -
                        })
 5672         -
                        .build_unchecked();
 5673         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 5674         -
            .await
 5675         -
            .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         -
        ::pretty_assertions::assert_eq!(
 5713         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
 5714         -
            http_response.status()
 5715         -
        );
 5716         -
        let expected_headers = [
 5717         -
            ("X-String", "Hello"),
 5718         -
            ("X-StringList", "a, b, c"),
 5719         -
            ("X-StringSet", "a, b, c"),
 5720         -
        ];
 5721         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 5722         -
            http_response.headers(),
 5723         -
            expected_headers,
 5724         -
        ));
 5725         -
    }
 5726         -
    /// Tests responses with string list header bindings that require quoting
 5727         -
    /// Test ID: RestJsonInputAndOutputWithQuotedStringHeaders
 5728         -
    #[::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();
 5756         -
        ::pretty_assertions::assert_eq!(
 5757         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
 5758         -
            http_response.status()
 5759         -
        );
 5760         -
        let expected_headers = [("X-StringList", "\"b,c\", \"\\\"def\\\"\", a")];
 5761         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 5762         -
            http_response.headers(),
 5763         -
            expected_headers,
 5764         -
        ));
 5765         -
    }
 5766         -
    /// Tests responses with numeric header bindings
 5767         -
    /// Test ID: RestJsonInputAndOutputWithNumericHeaders
 5768         -
    #[::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();
 5792         -
        ::pretty_assertions::assert_eq!(
 5793         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
 5794         -
            http_response.status()
 5795         -
        );
 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         -
        ];
 5805         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 5806         -
            http_response.headers(),
 5807         -
            expected_headers,
 5808         -
        ));
 5809         -
    }
 5810         -
    /// Tests responses with boolean header bindings
 5811         -
    /// Test ID: RestJsonInputAndOutputWithBooleanHeaders
 5812         -
    #[::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         -
        ));
 5891         -
    }
 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();
 5932         -
        ::pretty_assertions::assert_eq!(
 5933         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
 5934         -
            http_response.status()
 5935         -
        );
 5936         -
        let expected_headers = [("X-Enum", "Foo"), ("X-EnumList", "Foo, Bar, Baz")];
 5937         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 5938         -
            http_response.headers(),
 5939         -
            expected_headers,
 5940         -
        ));
 5941         -
    }
 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         -
    }
 5978         -
    /// Supports handling NaN float header values.
 5979         -
    /// Test ID: RestJsonSupportsNaNFloatHeaderOutputs
 5980         -
    #[::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         -
        ));
 6019         -
    }
 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();
 6052         -
        ::pretty_assertions::assert_eq!(
 6053         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
 6054         -
            http_response.status()
 6055         -
        );
 6056         -
        let expected_headers = [("X-Double", "Infinity"), ("X-Float", "Infinity")];
 6057         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 6058         -
            http_response.headers(),
 6059         -
            expected_headers,
 6060         -
        ));
 6061         -
    }
 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         -
    }
 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
 6110         -
    #[::tokio::test]
 6111         -
    async fn rest_json_json_blobs_request() {
 6112         -
        #[allow(unused_mut)]
 6113         -
        let mut http_request = http::Request::builder()
 6114         -
            .uri("/JsonBlobs")
 6115         -
            .method("POST")
 6116         -
            .header("Content-Type", "application/json")
 6117         -
            .body(::aws_smithy_http_server::body::Body::from(
 6118         -
                ::bytes::Bytes::from_static("{\n    \"data\": \"dmFsdWU=\"\n}".as_bytes()),
 6119         -
            ))
 6120         -
            .unwrap();
 6121         -
        #[allow(unused_mut)]
 6122         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 6123         -
        let config = crate::service::RestJsonConfig::builder().build();
 6124         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 6125         -
            .json_blobs(move |input: crate::input::JsonBlobsInput| {
 6126         -
                let sender = sender.clone();
 6127         -
                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         -
                    };
 6140         -
                    sender.send(()).await.expect("receiver dropped early");
 6141         -
                    result
 6142         -
                }
 6143         -
            })
 6144         -
            .build_unchecked();
 6145         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 6146         -
            .await
 6147         -
            .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         -
        ::pretty_assertions::assert_eq!(
 6160         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
 6161         -
            http_response.status()
 6162         -
        );
 6163         -
        let expected_headers = [("Content-Type", "application/json")];
 6164         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 6165         -
            http_response.headers(),
 6166         -
            expected_headers,
 6167         -
        ));
 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         -
    }
 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
 6183         -
    #[::tokio::test]
 6184         -
    async fn rest_json_json_enums_request() {
 6185         -
        #[allow(unused_mut)]
 6186         -
                    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();
 6191         -
        #[allow(unused_mut)]
 6192         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 6193         -
        let config = crate::service::RestJsonConfig::builder().build();
 6194         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 6195         -
            .json_enums(move |input: crate::input::JsonEnumsInput| {
 6196         -
                let sender = sender.clone();
 6197         -
                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         -
                    };
 6258         -
                    sender.send(()).await.expect("receiver dropped early");
 6259         -
                    result
 6260         -
                }
 6261         -
            })
 6262         -
            .build_unchecked();
 6263         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 6264         -
            .await
 6265         -
            .expect("unable to make an HTTP request");
 6266         -
        assert!(receiver.recv().await.is_some());
 6267         -
    }
 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())
 6332         -
            .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"))
 6336         -
        );
 6337         -
    }
 6338         -
}
 6339         -
#[cfg(test)]
 6340         -
#[allow(unreachable_code, unused_variables)]
 6341         -
mod server_json_int_enums_test {
 6342         -
    /// Serializes intEnums as integers
 6343         -
    /// Test ID: RestJsonJsonIntEnums
 6344         -
    #[::tokio::test]
 6345         -
    async fn rest_json_json_int_enums_request() {
 6346         -
        #[allow(unused_mut)]
 6347         -
                    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();
 6352         -
        #[allow(unused_mut)]
 6353         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 6354         -
        let config = crate::service::RestJsonConfig::builder().build();
 6355         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 6356         -
            .json_int_enums(move |input: crate::input::JsonIntEnumsInput| {
 6357         -
                let sender = sender.clone();
 6358         -
                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         -
                    };
 6386         -
                    sender.send(()).await.expect("receiver dropped early");
 6387         -
                    result
 6388         -
                }
 6389         -
            })
 6390         -
            .build_unchecked();
 6391         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 6392         -
            .await
 6393         -
            .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         -
        ::pretty_assertions::assert_eq!(
 6418         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
 6419         -
            http_response.status()
 6420         -
        );
 6421         -
        let expected_headers = [("Content-Type", "application/json")];
 6422         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 6423         -
            http_response.headers(),
 6424         -
            expected_headers,
 6425         -
        ));
 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         -
    }
 6433         -
}
 6434         -
#[cfg(test)]
 6435         -
#[allow(unreachable_code, unused_variables)]
 6436         -
mod server_json_lists_test {
 6437         -
    /// Serializes JSON lists
 6438         -
    /// Test ID: RestJsonLists
 6439         -
    #[::tokio::test]
 6440         -
    async fn rest_json_lists_request() {
 6441         -
        #[allow(unused_mut)]
 6442         -
                    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();
 6447         -
        #[allow(unused_mut)]
 6448         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 6449         -
        let config = crate::service::RestJsonConfig::builder().build();
 6450         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 6451         -
            .json_lists(move |input: crate::input::JsonListsInput| {
 6452         -
                let sender = sender.clone();
 6453         -
                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         -
                    };
 6512         -
                    sender.send(()).await.expect("receiver dropped early");
 6513         -
                    result
 6514         -
                }
 6515         -
            })
 6516         -
            .build_unchecked();
 6517         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 6518         -
            .await
 6519         -
            .expect("unable to make an HTTP request");
 6520         -
        assert!(receiver.recv().await.is_some());
 6521         -
    }
 6522         -
    /// Serializes empty JSON lists
 6523         -
    /// Test ID: RestJsonListsEmpty
 6524         -
    #[::tokio::test]
 6525         -
    async fn rest_json_lists_empty_request() {
 6526         -
        #[allow(unused_mut)]
 6527         -
        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         -
            ))
 6534         -
            .unwrap();
 6535         -
        #[allow(unused_mut)]
 6536         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 6537         -
        let config = crate::service::RestJsonConfig::builder().build();
 6538         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 6539         -
            .json_lists(move |input: crate::input::JsonListsInput| {
 6540         -
                let sender = sender.clone();
 6541         -
                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         -
                    };
 6568         -
                    sender.send(()).await.expect("receiver dropped early");
 6569         -
                    result
 6570         -
                }
 6571         -
            })
 6572         -
            .build_unchecked();
 6573         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 6574         -
            .await
 6575         -
            .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         -
        ::pretty_assertions::assert_eq!(
 6621         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
 6622         -
            http_response.status()
 6623         -
        );
 6624         -
        let expected_headers = [("Content-Type", "application/json")];
 6625         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 6626         -
            http_response.headers(),
 6627         -
            expected_headers,
 6628         -
        ));
 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         -
    }
 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         -
    }
 6671         -
}
 6672         -
#[cfg(test)]
 6673         -
#[allow(unreachable_code, unused_variables)]
 6674         -
mod server_json_maps_test {
 6675         -
    /// Serializes JSON maps
 6676         -
    /// Test ID: RestJsonJsonMaps
 6677         -
    #[::tokio::test]
 6678         -
    async fn rest_json_json_maps_request() {
 6679         -
        #[allow(unused_mut)]
 6680         -
                    let mut http_request = http::Request::builder()
 6681         -
                        .uri("/JsonMaps")
 6682         -
                        .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();
 6685         -
        #[allow(unused_mut)]
 6686         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 6687         -
        let config = crate::service::RestJsonConfig::builder().build();
 6688         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 6689         -
            .json_maps(move |input: crate::input::JsonMapsInput| {
 6690         -
                let sender = sender.clone();
 6691         -
                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         -
                    };
 6725         -
                    sender.send(()).await.expect("receiver dropped early");
 6726         -
                    result
 6727         -
                }
 6728         -
            })
 6729         -
            .build_unchecked();
 6730         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 6731         -
            .await
 6732         -
            .expect("unable to make an HTTP request");
 6733         -
        assert!(receiver.recv().await.is_some());
 6734         -
    }
 6735         -
    /// Ensure that 0 and false are sent over the wire in all maps and lists
 6736         -
    /// Test ID: RestJsonSerializesZeroValuesInMaps
 6737         -
    #[::tokio::test]
 6738         -
    async fn rest_json_serializes_zero_values_in_maps_request() {
 6739         -
        #[allow(unused_mut)]
 6740         -
                    let mut http_request = http::Request::builder()
 6741         -
                        .uri("/JsonMaps")
 6742         -
                        .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();
 6745         -
        #[allow(unused_mut)]
 6746         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 6747         -
        let config = crate::service::RestJsonConfig::builder().build();
 6748         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 6749         -
            .json_maps(move |input: crate::input::JsonMapsInput| {
 6750         -
                let sender = sender.clone();
 6751         -
                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         -
                    };
 6778         -
                    sender.send(()).await.expect("receiver dropped early");
 6779         -
                    result
 6780         -
                }
 6781         -
            })
 6782         -
            .build_unchecked();
 6783         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 6784         -
            .await
 6785         -
            .expect("unable to make an HTTP request");
 6786         -
        assert!(receiver.recv().await.is_some());
 6787         -
    }
 6788         -
    /// A request that contains a dense map of sets.
 6789         -
    /// Test ID: RestJsonSerializesDenseSetMap
 6790         -
    #[::tokio::test]
 6791         -
    async fn rest_json_serializes_dense_set_map_request() {
 6792         -
        #[allow(unused_mut)]
 6793         -
                    let mut http_request = http::Request::builder()
 6794         -
                        .uri("/JsonMaps")
 6795         -
                        .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();
 6798         -
        #[allow(unused_mut)]
 6799         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 6800         -
        let config = crate::service::RestJsonConfig::builder().build();
 6801         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 6802         -
            .json_maps(move |input: crate::input::JsonMapsInput| {
 6803         -
                let sender = sender.clone();
 6804         -
                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         -
                    };
 6836         -
                    sender.send(()).await.expect("receiver dropped early");
 6837         -
                    result
 6838         -
                }
 6839         -
            })
 6840         -
            .build_unchecked();
 6841         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 6842         -
            .await
 6843         -
            .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         -
        ::pretty_assertions::assert_eq!(
 6912         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
 6913         -
            http_response.status()
 6914         -
        );
 6915         -
        let expected_headers = [("Content-Type", "application/json")];
 6916         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 6917         -
            http_response.headers(),
 6918         -
            expected_headers,
 6919         -
        ));
 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         -
    }
 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         -
    }
 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
 6975         -
    #[::tokio::test]
 6976         -
    async fn rest_json_json_timestamps_request() {
 6977         -
        #[allow(unused_mut)]
 6978         -
        let mut http_request = http::Request::builder()
 6979         -
            .uri("/JsonTimestamps")
 6980         -
            .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         -
            ))
 6985         -
            .unwrap();
 6986         -
        #[allow(unused_mut)]
 6987         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 6988         -
        let config = crate::service::RestJsonConfig::builder().build();
 6989         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 6990         -
            .json_timestamps(move |input: crate::input::JsonTimestampsInput| {
 6991         -
                let sender = sender.clone();
 6992         -
                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         -
                    };
 7019         -
                    sender.send(()).await.expect("receiver dropped early");
 7020         -
                    result
 7021         -
                }
 7022         -
            })
 7023         -
            .build_unchecked();
 7024         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 7025         -
            .await
 7026         -
            .expect("unable to make an HTTP request");
 7027         -
        assert!(receiver.recv().await.is_some());
 7028         -
    }
 7029         -
    /// Ensures that the timestampFormat of date-time works like normal timestamps
 7030         -
    /// Test ID: RestJsonJsonTimestampsWithDateTimeFormat
 7031         -
    #[::tokio::test]
 7032         -
    async fn rest_json_json_timestamps_with_date_time_format_request() {
 7033         -
        #[allow(unused_mut)]
 7034         -
        let mut http_request = http::Request::builder()
 7035         -
            .uri("/JsonTimestamps")
 7036         -
            .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         -
            ))
 7043         -
            .unwrap();
 7044         -
        #[allow(unused_mut)]
 7045         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 7046         -
        let config = crate::service::RestJsonConfig::builder().build();
 7047         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 7048         -
            .json_timestamps(move |input: crate::input::JsonTimestampsInput| {
 7049         -
                let sender = sender.clone();
 7050         -
                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         -
                    };
 7077         -
                    sender.send(()).await.expect("receiver dropped early");
 7078         -
                    result
 7079         -
                }
 7080         -
            })
 7081         -
            .build_unchecked();
 7082         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 7083         -
            .await
 7084         -
            .expect("unable to make an HTTP request");
 7085         -
        assert!(receiver.recv().await.is_some());
 7086         -
    }
 7087         -
    /// Ensures that the timestampFormat of date-time on the target shape works like normal timestamps
 7088         -
    /// Test ID: RestJsonJsonTimestampsWithDateTimeOnTargetFormat
 7089         -
    #[::tokio::test]
 7090         -
    async fn rest_json_json_timestamps_with_date_time_on_target_format_request() {
 7091         -
        #[allow(unused_mut)]
 7092         -
        let mut http_request = http::Request::builder()
 7093         -
            .uri("/JsonTimestamps")
 7094         -
            .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         -
            ))
 7101         -
            .unwrap();
 7102         -
        #[allow(unused_mut)]
 7103         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 7104         -
        let config = crate::service::RestJsonConfig::builder().build();
 7105         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 7106         -
            .json_timestamps(move |input: crate::input::JsonTimestampsInput| {
 7107         -
                let sender = sender.clone();
 7108         -
                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         -
                    };
 7135         -
                    sender.send(()).await.expect("receiver dropped early");
 7136         -
                    result
 7137         -
                }
 7138         -
            })
 7139         -
            .build_unchecked();
 7140         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 7141         -
            .await
 7142         -
            .expect("unable to make an HTTP request");
 7143         -
        assert!(receiver.recv().await.is_some());
 7144         -
    }
 7145         -
    /// Ensures that the timestampFormat of epoch-seconds works
 7146         -
    /// Test ID: RestJsonJsonTimestampsWithEpochSecondsFormat
 7147         -
    #[::tokio::test]
 7148         -
    async fn rest_json_json_timestamps_with_epoch_seconds_format_request() {
 7149         -
        #[allow(unused_mut)]
 7150         -
        let mut http_request = http::Request::builder()
 7151         -
            .uri("/JsonTimestamps")
 7152         -
            .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         -
            ))
 7157         -
            .unwrap();
 7158         -
        #[allow(unused_mut)]
 7159         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 7160         -
        let config = crate::service::RestJsonConfig::builder().build();
 7161         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 7162         -
            .json_timestamps(move |input: crate::input::JsonTimestampsInput| {
 7163         -
                let sender = sender.clone();
 7164         -
                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         -
                    };
 7191         -
                    sender.send(()).await.expect("receiver dropped early");
 7192         -
                    result
 7193         -
                }
 7194         -
            })
 7195         -
            .build_unchecked();
 7196         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 7197         -
            .await
 7198         -
            .expect("unable to make an HTTP request");
 7199         -
        assert!(receiver.recv().await.is_some());
 7200         -
    }
 7201         -
    /// Ensures that the timestampFormat of epoch-seconds on the target shape works
 7202         -
    /// Test ID: RestJsonJsonTimestampsWithEpochSecondsOnTargetFormat
 7203         -
    #[::tokio::test]
 7204         -
    async fn rest_json_json_timestamps_with_epoch_seconds_on_target_format_request() {
 7205         -
        #[allow(unused_mut)]
 7206         -
        let mut http_request = http::Request::builder()
 7207         -
            .uri("/JsonTimestamps")
 7208         -
            .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         -
            ))
 7215         -
            .unwrap();
 7216         -
        #[allow(unused_mut)]
 7217         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 7218         -
        let config = crate::service::RestJsonConfig::builder().build();
 7219         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 7220         -
            .json_timestamps(move |input: crate::input::JsonTimestampsInput| {
 7221         -
                let sender = sender.clone();
 7222         -
                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         -
                    };
 7249         -
                    sender.send(()).await.expect("receiver dropped early");
 7250         -
                    result
 7251         -
                }
 7252         -
            })
 7253         -
            .build_unchecked();
 7254         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 7255         -
            .await
 7256         -
            .expect("unable to make an HTTP request");
 7257         -
        assert!(receiver.recv().await.is_some());
 7258         -
    }
 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,
 7304         -
                        };
 7305         -
                        response
 7306         -
                    };
 7307         -
                    sender.send(()).await.expect("receiver dropped early");
 7308         -
                    result
 7309         -
                }
 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         -
    }
 7317         -
    /// Ensures that the timestampFormat of http-date on the target shape works
 7318         -
    /// Test ID: RestJsonJsonTimestampsWithHttpDateOnTargetFormat
 7319         -
    #[::tokio::test]
 7320         -
    async fn rest_json_json_timestamps_with_http_date_on_target_format_request() {
 7321         -
        #[allow(unused_mut)]
 7322         -
        let mut http_request = http::Request::builder()
 7323         -
            .uri("/JsonTimestamps")
 7324         -
            .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         -
            ))
 7331         -
            .unwrap();
 7332         -
        #[allow(unused_mut)]
 7333         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 7334         -
        let config = crate::service::RestJsonConfig::builder().build();
 7335         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 7336         -
            .json_timestamps(move |input: crate::input::JsonTimestampsInput| {
 7337         -
                let sender = sender.clone();
 7338         -
                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         -
                    };
 7365         -
                    sender.send(()).await.expect("receiver dropped early");
 7366         -
                    result
 7367         -
                }
 7368         -
            })
 7369         -
            .build_unchecked();
 7370         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 7371         -
            .await
 7372         -
            .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         -
        ::pretty_assertions::assert_eq!(
 7393         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
 7394         -
            http_response.status()
 7395         -
        );
 7396         -
        let expected_headers = [("Content-Type", "application/json")];
 7397         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 7398         -
            http_response.headers(),
 7399         -
            expected_headers,
 7400         -
        ));
 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         -
    }
 7410         -
    /// Ensures that the timestampFormat of date-time works like normal timestamps
 7411         -
    /// Test ID: RestJsonJsonTimestampsWithDateTimeFormat
 7412         -
    #[::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();
 7427         -
        ::pretty_assertions::assert_eq!(
 7428         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
 7429         -
            http_response.status()
 7430         -
        );
 7431         -
        let expected_headers = [("Content-Type", "application/json")];
 7432         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 7433         -
            http_response.headers(),
 7434         -
            expected_headers,
 7435         -
        ));
 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         -
    }
 7445         -
    /// Ensures that the timestampFormat of date-time on the target shape works like normal timestamps
 7446         -
    /// Test ID: RestJsonJsonTimestampsWithDateTimeOnTargetFormat
 7447         -
    #[::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();
 7462         -
        ::pretty_assertions::assert_eq!(
 7463         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
 7464         -
            http_response.status()
 7465         -
        );
 7466         -
        let expected_headers = [("Content-Type", "application/json")];
 7467         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 7468         -
            http_response.headers(),
 7469         -
            expected_headers,
 7470         -
        ));
 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         -
    }
 7480         -
    /// Ensures that the timestampFormat of epoch-seconds works
 7481         -
    /// Test ID: RestJsonJsonTimestampsWithEpochSecondsFormat
 7482         -
    #[::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();
 7497         -
        ::pretty_assertions::assert_eq!(
 7498         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
 7499         -
            http_response.status()
 7500         -
        );
 7501         -
        let expected_headers = [("Content-Type", "application/json")];
 7502         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 7503         -
            http_response.headers(),
 7504         -
            expected_headers,
 7505         -
        ));
 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         -
    }
 7515         -
    /// Ensures that the timestampFormat of epoch-seconds on the target shape works
 7516         -
    /// Test ID: RestJsonJsonTimestampsWithEpochSecondsOnTargetFormat
 7517         -
    #[::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();
 7532         -
        ::pretty_assertions::assert_eq!(
 7533         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
 7534         -
            http_response.status()
 7535         -
        );
 7536         -
        let expected_headers = [("Content-Type", "application/json")];
 7537         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 7538         -
            http_response.headers(),
 7539         -
            expected_headers,
 7540         -
        ));
 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         -
    }
 7550         -
    /// Ensures that the timestampFormat of http-date works
 7551         -
    /// Test ID: RestJsonJsonTimestampsWithHttpDateFormat
 7552         -
    #[::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();
 7567         -
        ::pretty_assertions::assert_eq!(
 7568         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
 7569         -
            http_response.status()
 7570         -
        );
 7571         -
        let expected_headers = [("Content-Type", "application/json")];
 7572         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 7573         -
            http_response.headers(),
 7574         -
            expected_headers,
 7575         -
        ));
 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         -
    }
 7585         -
    /// Ensures that the timestampFormat of http-date on the target shape works
 7586         -
    /// Test ID: RestJsonJsonTimestampsWithHttpDateOnTargetFormat
 7587         -
    #[::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() {
 7628         -
        #[allow(unused_mut)]
 7629         -
        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         -
            ))
 7638         -
            .unwrap();
 7639         -
        #[allow(unused_mut)]
 7640         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 7641         -
        let config = crate::service::RestJsonConfig::builder().build();
 7642         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 7643         -
            .json_unions(move |input: crate::input::JsonUnionsInput| {
 7644         -
                let sender = sender.clone();
 7645         -
                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         -
                    };
 7658         -
                    sender.send(()).await.expect("receiver dropped early");
 7659         -
                    result
 7660         -
                }
 7661         -
            })
 7662         -
            .build_unchecked();
 7663         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 7664         -
            .await
 7665         -
            .expect("unable to make an HTTP request");
 7666         -
        assert!(receiver.recv().await.is_some());
 7667         -
    }
 7668         -
    /// Serializes a boolean union value
 7669         -
    /// Test ID: RestJsonSerializeBooleanUnionValue
 7670         -
    #[::tokio::test]
 7671         -
    async fn rest_json_serialize_boolean_union_value_request() {
 7672         -
        #[allow(unused_mut)]
 7673         -
        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         -
            ))
 7682         -
            .unwrap();
 7683         -
        #[allow(unused_mut)]
 7684         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 7685         -
        let config = crate::service::RestJsonConfig::builder().build();
 7686         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 7687         -
            .json_unions(move |input: crate::input::JsonUnionsInput| {
 7688         -
                let sender = sender.clone();
 7689         -
                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         -
                    };
 7702         -
                    sender.send(()).await.expect("receiver dropped early");
 7703         -
                    result
 7704         -
                }
 7705         -
            })
 7706         -
            .build_unchecked();
 7707         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 7708         -
            .await
 7709         -
            .expect("unable to make an HTTP request");
 7710         -
        assert!(receiver.recv().await.is_some());
 7711         -
    }
 7712         -
    /// Serializes a number union value
 7713         -
    /// Test ID: RestJsonSerializeNumberUnionValue
 7714         -
    #[::tokio::test]
 7715         -
    async fn rest_json_serialize_number_union_value_request() {
 7716         -
        #[allow(unused_mut)]
 7717         -
        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         -
            ))
 7726         -
            .unwrap();
 7727         -
        #[allow(unused_mut)]
 7728         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 7729         -
        let config = crate::service::RestJsonConfig::builder().build();
 7730         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 7731         -
            .json_unions(move |input: crate::input::JsonUnionsInput| {
 7732         -
                let sender = sender.clone();
 7733         -
                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         -
                    };
 7746         -
                    sender.send(()).await.expect("receiver dropped early");
 7747         -
                    result
 7748         -
                }
 7749         -
            })
 7750         -
            .build_unchecked();
 7751         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 7752         -
            .await
 7753         -
            .expect("unable to make an HTTP request");
 7754         -
        assert!(receiver.recv().await.is_some());
 7755         -
    }
 7756         -
    /// Serializes a blob union value
 7757         -
    /// Test ID: RestJsonSerializeBlobUnionValue
 7758         -
    #[::tokio::test]
 7759         -
    async fn rest_json_serialize_blob_union_value_request() {
 7760         -
        #[allow(unused_mut)]
 7761         -
        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         -
            ))
 7770         -
            .unwrap();
 7771         -
        #[allow(unused_mut)]
 7772         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 7773         -
        let config = crate::service::RestJsonConfig::builder().build();
 7774         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 7775         -
            .json_unions(move |input: crate::input::JsonUnionsInput| {
 7776         -
                let sender = sender.clone();
 7777         -
                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         -
                    };
 7792         -
                    sender.send(()).await.expect("receiver dropped early");
 7793         -
                    result
 7794         -
                }
 7795         -
            })
 7796         -
            .build_unchecked();
 7797         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 7798         -
            .await
 7799         -
            .expect("unable to make an HTTP request");
 7800         -
        assert!(receiver.recv().await.is_some());
 7801         -
    }
 7802         -
    /// Serializes a timestamp union value
 7803         -
    /// Test ID: RestJsonSerializeTimestampUnionValue
 7804         -
    #[::tokio::test]
 7805         -
    async fn rest_json_serialize_timestamp_union_value_request() {
 7806         -
        #[allow(unused_mut)]
 7807         -
        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         -
            ))
 7817         -
            .unwrap();
 7818         -
        #[allow(unused_mut)]
 7819         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 7820         -
        let config = crate::service::RestJsonConfig::builder().build();
 7821         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 7822         -
            .json_unions(move |input: crate::input::JsonUnionsInput| {
 7823         -
                let sender = sender.clone();
 7824         -
                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         -
                    };
 7841         -
                    sender.send(()).await.expect("receiver dropped early");
 7842         -
                    result
 7843         -
                }
 7844         -
            })
 7845         -
            .build_unchecked();
 7846         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 7847         -
            .await
 7848         -
            .expect("unable to make an HTTP request");
 7849         -
        assert!(receiver.recv().await.is_some());
 7850         -
    }
 7851         -
    /// Serializes an enum union value
 7852         -
    /// Test ID: RestJsonSerializeEnumUnionValue
 7853         -
    #[::tokio::test]
 7854         -
    async fn rest_json_serialize_enum_union_value_request() {
 7855         -
        #[allow(unused_mut)]
 7856         -
        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         -
            ))
 7865         -
            .unwrap();
 7866         -
        #[allow(unused_mut)]
 7867         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 7868         -
        let config = crate::service::RestJsonConfig::builder().build();
 7869         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 7870         -
            .json_unions(move |input: crate::input::JsonUnionsInput| {
 7871         -
                let sender = sender.clone();
 7872         -
                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         -
                    };
 7889         -
                    sender.send(()).await.expect("receiver dropped early");
 7890         -
                    result
 7891         -
                }
 7892         -
            })
 7893         -
            .build_unchecked();
 7894         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 7895         -
            .await
 7896         -
            .expect("unable to make an HTTP request");
 7897         -
        assert!(receiver.recv().await.is_some());
 7898         -
    }
 7899         -
    /// Serializes a list union value
 7900         -
    /// Test ID: RestJsonSerializeListUnionValue
 7901         -
    #[::tokio::test]
 7902         -
    async fn rest_json_serialize_list_union_value_request() {
 7903         -
        #[allow(unused_mut)]
 7904         -
        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         -
            ))
 7914         -
            .unwrap();
 7915         -
        #[allow(unused_mut)]
 7916         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 7917         -
        let config = crate::service::RestJsonConfig::builder().build();
 7918         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 7919         -
            .json_unions(move |input: crate::input::JsonUnionsInput| {
 7920         -
                let sender = sender.clone();
 7921         -
                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         -
                    };
 7937         -
                    sender.send(()).await.expect("receiver dropped early");
 7938         -
                    result
 7939         -
                }
 7940         -
            })
 7941         -
            .build_unchecked();
 7942         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 7943         -
            .await
 7944         -
            .expect("unable to make an HTTP request");
 7945         -
        assert!(receiver.recv().await.is_some());
 7946         -
    }
 7947         -
    /// Serializes a map union value
 7948         -
    /// Test ID: RestJsonSerializeMapUnionValue
 7949         -
    #[::tokio::test]
 7950         -
    async fn rest_json_serialize_map_union_value_request() {
 7951         -
        #[allow(unused_mut)]
 7952         -
                    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();
 7957         -
        #[allow(unused_mut)]
 7958         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 7959         -
        let config = crate::service::RestJsonConfig::builder().build();
 7960         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 7961         -
            .json_unions(move |input: crate::input::JsonUnionsInput| {
 7962         -
                let sender = sender.clone();
 7963         -
                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         -
                    };
 7981         -
                    sender.send(()).await.expect("receiver dropped early");
 7982         -
                    result
 7983         -
                }
 7984         -
            })
 7985         -
            .build_unchecked();
 7986         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 7987         -
            .await
 7988         -
            .expect("unable to make an HTTP request");
 7989         -
        assert!(receiver.recv().await.is_some());
 7990         -
    }
 7991         -
    /// Serializes a structure union value
 7992         -
    /// Test ID: RestJsonSerializeStructureUnionValue
 7993         -
    #[::tokio::test]
 7994         -
    async fn rest_json_serialize_structure_union_value_request() {
 7995         -
        #[allow(unused_mut)]
 7996         -
                    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();
 8001         -
        #[allow(unused_mut)]
 8002         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 8003         -
        let config = crate::service::RestJsonConfig::builder().build();
 8004         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 8005         -
            .json_unions(move |input: crate::input::JsonUnionsInput| {
 8006         -
                let sender = sender.clone();
 8007         -
                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         -
                    };
 8024         -
                    sender.send(()).await.expect("receiver dropped early");
 8025         -
                    result
 8026         -
                }
 8027         -
            })
 8028         -
            .build_unchecked();
 8029         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 8030         -
            .await
 8031         -
            .expect("unable to make an HTTP request");
 8032         -
        assert!(receiver.recv().await.is_some());
 8033         -
    }
 8034         -
    /// Serializes a renamed structure union value
 8035         -
    /// Test ID: RestJsonSerializeRenamedStructureUnionValue
 8036         -
    #[::tokio::test]
 8037         -
    async fn rest_json_serialize_renamed_structure_union_value_request() {
 8038         -
        #[allow(unused_mut)]
 8039         -
                    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();
 8044         -
        #[allow(unused_mut)]
 8045         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 8046         -
        let config = crate::service::RestJsonConfig::builder().build();
 8047         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 8048         -
            .json_unions(move |input: crate::input::JsonUnionsInput| {
 8049         -
                let sender = sender.clone();
 8050         -
                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         -
                    };
 8069         -
                    sender.send(()).await.expect("receiver dropped early");
 8070         -
                    result
 8071         -
                }
 8072         -
            })
 8073         -
            .build_unchecked();
 8074         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 8075         -
            .await
 8076         -
            .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         -
        ::pretty_assertions::assert_eq!(
 8091         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
 8092         -
            http_response.status()
 8093         -
        );
 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")];
 8300         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 8301         -
            http_response.headers(),
 8302         -
            expected_headers,
 8303         -
        ));
 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         -
    }
 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         -
    }
 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
 8346         -
    #[::tokio::test]
 8347         -
    async fn rest_json_with_body_expects_application_json_accept_malformed_request() {
 8348         -
        {
 8349         -
            #[allow(unused_mut)]
 8350         -
            let mut http_request = http::Request::builder()
 8351         -
                .uri("/MalformedAcceptWithBody")
 8352         -
                .method("POST")
 8353         -
                .header("accept", "application/hal+json")
 8354         -
                .body(::aws_smithy_http_server::body::Body::empty())
 8355         -
                .unwrap();
 8356         -
            #[allow(unused_mut)]
 8357         -
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 8358         -
            let config = crate::service::RestJsonConfig::builder().build();
 8359         -
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 8360         -
                            .malformed_accept_with_body(move |input: crate::input::MalformedAcceptWithBodyInput| {
 8361         -
                                let sender = sender.clone();
 8362         -
                                async move {
 8363         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedAcceptWithBodyOutput };
 8364         -
                                    sender.send(()).await.expect("receiver dropped early");
 8365         -
                                    result
 8366         -
                                }
 8367         -
                            })
 8368         -
                            .build_unchecked();
 8369         -
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 8370         -
                .await
 8371         -
                .expect("unable to make an HTTP request");
 8372         -
            ::pretty_assertions::assert_eq!(
 8373         -
                http::StatusCode::from_u16(406).expect("invalid expected HTTP status code"),
 8374         -
                http_response.status()
 8375         -
            );
 8376         -
            let expected_headers = [("x-amzn-errortype", "NotAcceptableException")];
 8377         -
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 8378         -
                http_response.headers(),
 8379         -
                expected_headers,
 8380         -
            ));
 8381         -
        }
 8382         -
    }
 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
 8390         -
    #[::tokio::test]
 8391         -
    async fn rest_json_with_payload_expects_implied_accept_malformed_request() {
 8392         -
        {
 8393         -
            #[allow(unused_mut)]
 8394         -
            let mut http_request = http::Request::builder()
 8395         -
                .uri("/MalformedAcceptWithGenericString")
 8396         -
                .method("POST")
 8397         -
                .header("accept", "application/json")
 8398         -
                .body(::aws_smithy_http_server::body::Body::empty())
 8399         -
                .unwrap();
 8400         -
            #[allow(unused_mut)]
 8401         -
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 8402         -
            let config = crate::service::RestJsonConfig::builder().build();
 8403         -
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 8404         -
                            .malformed_accept_with_generic_string(move |input: crate::input::MalformedAcceptWithGenericStringInput| {
 8405         -
                                let sender = sender.clone();
 8406         -
                                async move {
 8407         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedAcceptWithGenericStringOutput };
 8408         -
                                    sender.send(()).await.expect("receiver dropped early");
 8409         -
                                    result
 8410         -
                                }
 8411         -
                            })
 8412         -
                            .build_unchecked();
 8413         -
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 8414         -
                .await
 8415         -
                .expect("unable to make an HTTP request");
 8416         -
            ::pretty_assertions::assert_eq!(
 8417         -
                http::StatusCode::from_u16(406).expect("invalid expected HTTP status code"),
 8418         -
                http_response.status()
 8419         -
            );
 8420         -
            let expected_headers = [("x-amzn-errortype", "NotAcceptableException")];
 8421         -
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 8422         -
                http_response.headers(),
 8423         -
                expected_headers,
 8424         -
            ));
 8425         -
        }
 8426         -
    }
 8427         -
}
 8428         -
#[cfg(test)]
 8429         -
#[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
 8433         -
    #[::tokio::test]
 8434         -
    async fn rest_json_with_payload_expects_modeled_accept_malformed_request() {
 8435         -
        {
 8436         -
            #[allow(unused_mut)]
 8437         -
            let mut http_request = http::Request::builder()
 8438         -
                .uri("/MalformedAcceptWithPayload")
 8439         -
                .method("POST")
 8440         -
                .header("accept", "application/json")
 8441         -
                .body(::aws_smithy_http_server::body::Body::empty())
 8442         -
                .unwrap();
 8443         -
            #[allow(unused_mut)]
 8444         -
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 8445         -
            let config = crate::service::RestJsonConfig::builder().build();
 8446         -
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 8447         -
                            .malformed_accept_with_payload(move |input: crate::input::MalformedAcceptWithPayloadInput| {
 8448         -
                                let sender = sender.clone();
 8449         -
                                async move {
 8450         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedAcceptWithPayloadOutput };
 8451         -
                                    sender.send(()).await.expect("receiver dropped early");
 8452         -
                                    result
 8453         -
                                }
 8454         -
                            })
 8455         -
                            .build_unchecked();
 8456         -
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 8457         -
                .await
 8458         -
                .expect("unable to make an HTTP request");
 8459         -
            ::pretty_assertions::assert_eq!(
 8460         -
                http::StatusCode::from_u16(406).expect("invalid expected HTTP status code"),
 8461         -
                http_response.status()
 8462         -
            );
 8463         -
            let expected_headers = [("x-amzn-errortype", "NotAcceptableException")];
 8464         -
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 8465         -
                http_response.headers(),
 8466         -
                expected_headers,
 8467         -
            ));
 8468         -
        }
 8469         -
    }
 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
 8477         -
    #[::tokio::test]
 8478         -
    async fn rest_json_body_malformed_blob_invalid_base64_case0_malformed_request() {
 8479         -
        {
 8480         -
            #[allow(unused_mut)]
 8481         -
            let mut http_request = http::Request::builder()
 8482         -
                .uri("/MalformedBlob")
 8483         -
                .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         -
                ))
 8488         -
                .unwrap();
 8489         -
            #[allow(unused_mut)]
 8490         -
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 8491         -
            let config = crate::service::RestJsonConfig::builder().build();
 8492         -
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 8493         -
                            .malformed_blob(move |input: crate::input::MalformedBlobInput| {
 8494         -
                                let sender = sender.clone();
 8495         -
                                async move {
 8496         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedBlobOutput };
 8497         -
                                    sender.send(()).await.expect("receiver dropped early");
 8498         -
                                    result
 8499         -
                                }
 8500         -
                            })
 8501         -
                            .build_unchecked();
 8502         -
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 8503         -
                .await
 8504         -
                .expect("unable to make an HTTP request");
 8505         -
            ::pretty_assertions::assert_eq!(
 8506         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 8507         -
                http_response.status()
 8508         -
            );
 8509         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 8510         -
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 8511         -
                http_response.headers(),
 8512         -
                expected_headers,
 8513         -
            ));
 8514         -
        }
 8515         -
    }
 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
 8519         -
    #[::tokio::test]
 8520         -
    async fn rest_json_body_malformed_blob_invalid_base64_case1_malformed_request() {
 8521         -
        {
 8522         -
            #[allow(unused_mut)]
 8523         -
            let mut http_request = http::Request::builder()
 8524         -
                .uri("/MalformedBlob")
 8525         -
                .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         -
                ))
 8530         -
                .unwrap();
 8531         -
            #[allow(unused_mut)]
 8532         -
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 8533         -
            let config = crate::service::RestJsonConfig::builder().build();
 8534         -
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 8535         -
                            .malformed_blob(move |input: crate::input::MalformedBlobInput| {
 8536         -
                                let sender = sender.clone();
 8537         -
                                async move {
 8538         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedBlobOutput };
 8539         -
                                    sender.send(()).await.expect("receiver dropped early");
 8540         -
                                    result
 8541         -
                                }
 8542         -
                            })
 8543         -
                            .build_unchecked();
 8544         -
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 8545         -
                .await
 8546         -
                .expect("unable to make an HTTP request");
 8547         -
            ::pretty_assertions::assert_eq!(
 8548         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 8549         -
                http_response.status()
 8550         -
            );
 8551         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 8552         -
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 8553         -
                http_response.headers(),
 8554         -
                expected_headers,
 8555         -
            ));
 8556         -
        }
 8557         -
    }
 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
 8561         -
    #[::tokio::test]
 8562         -
    async fn rest_json_body_malformed_blob_invalid_base64_case2_malformed_request() {
 8563         -
        {
 8564         -
            #[allow(unused_mut)]
 8565         -
            let mut http_request = http::Request::builder()
 8566         -
                .uri("/MalformedBlob")
 8567         -
                .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         -
                ))
 8572         -
                .unwrap();
 8573         -
            #[allow(unused_mut)]
 8574         -
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 8575         -
            let config = crate::service::RestJsonConfig::builder().build();
 8576         -
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 8577         -
                            .malformed_blob(move |input: crate::input::MalformedBlobInput| {
 8578         -
                                let sender = sender.clone();
 8579         -
                                async move {
 8580         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedBlobOutput };
 8581         -
                                    sender.send(()).await.expect("receiver dropped early");
 8582         -
                                    result
 8583         -
                                }
 8584         -
                            })
 8585         -
                            .build_unchecked();
 8586         -
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 8587         -
                .await
 8588         -
                .expect("unable to make an HTTP request");
 8589         -
            ::pretty_assertions::assert_eq!(
 8590         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 8591         -
                http_response.status()
 8592         -
            );
 8593         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 8594         -
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 8595         -
                http_response.headers(),
 8596         -
                expected_headers,
 8597         -
            ));
 8598         -
        }
 8599         -
    }
 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
 8603         -
    #[::tokio::test]
 8604         -
    async fn rest_json_body_malformed_blob_invalid_base64_case3_malformed_request() {
 8605         -
        {
 8606         -
            #[allow(unused_mut)]
 8607         -
            let mut http_request = http::Request::builder()
 8608         -
                .uri("/MalformedBlob")
 8609         -
                .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         -
                ))
 8614         -
                .unwrap();
 8615         -
            #[allow(unused_mut)]
 8616         -
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 8617         -
            let config = crate::service::RestJsonConfig::builder().build();
 8618         -
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 8619         -
                            .malformed_blob(move |input: crate::input::MalformedBlobInput| {
 8620         -
                                let sender = sender.clone();
 8621         -
                                async move {
 8622         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedBlobOutput };
 8623         -
                                    sender.send(()).await.expect("receiver dropped early");
 8624         -
                                    result
 8625         -
                                }
 8626         -
                            })
 8627         -
                            .build_unchecked();
 8628         -
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 8629         -
                .await
 8630         -
                .expect("unable to make an HTTP request");
 8631         -
            ::pretty_assertions::assert_eq!(
 8632         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 8633         -
                http_response.status()
 8634         -
            );
 8635         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 8636         -
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 8637         -
                http_response.headers(),
 8638         -
                expected_headers,
 8639         -
            ));
 8640         -
        }
 8641         -
    }
 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)]
 8660         -
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 8661         -
            let config = crate::service::RestJsonConfig::builder().build();
 8662         -
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 8663         -
                            .malformed_blob(move |input: crate::input::MalformedBlobInput| {
 8664         -
                                let sender = sender.clone();
 8665         -
                                async move {
 8666         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedBlobOutput };
 8667         -
                                    sender.send(()).await.expect("receiver dropped early");
 8668         -
                                    result
 8669         -
                                }
 8670         -
                            })
 8671         -
                            .build_unchecked();
 8672         -
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 8673         -
                .await
 8674         -
                .expect("unable to make an HTTP request");
 8675         -
            ::pretty_assertions::assert_eq!(
 8676         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 8677         -
                http_response.status()
 8678         -
            );
 8679         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 8680         -
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 8681         -
                http_response.headers(),
 8682         -
                expected_headers,
 8683         -
            ));
 8684         -
        }
 8685         -
    }
 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
 8689         -
    #[::tokio::test]
 8690         -
    async fn rest_json_body_malformed_blob_invalid_base64_case5_malformed_request() {
 8691         -
        {
 8692         -
            #[allow(unused_mut)]
 8693         -
            let mut http_request = http::Request::builder()
 8694         -
                .uri("/MalformedBlob")
 8695         -
                .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         -
                ))
 8700         -
                .unwrap();
 8701         -
            #[allow(unused_mut)]
 8702         -
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 8703         -
            let config = crate::service::RestJsonConfig::builder().build();
 8704         -
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 8705         -
                            .malformed_blob(move |input: crate::input::MalformedBlobInput| {
 8706         -
                                let sender = sender.clone();
 8707         -
                                async move {
 8708         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedBlobOutput };
 8709         -
                                    sender.send(()).await.expect("receiver dropped early");
 8710         -
                                    result
 8711         -
                                }
 8712         -
                            })
 8713         -
                            .build_unchecked();
 8714         -
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 8715         -
                .await
 8716         -
                .expect("unable to make an HTTP request");
 8717         -
            ::pretty_assertions::assert_eq!(
 8718         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 8719         -
                http_response.status()
 8720         -
            );
 8721         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 8722         -
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 8723         -
                http_response.headers(),
 8724         -
                expected_headers,
 8725         -
            ));
 8726         -
        }
 8727         -
    }
 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
 8731         -
    #[::tokio::test]
 8732         -
    async fn rest_json_body_malformed_blob_invalid_base64_case6_malformed_request() {
 8733         -
        {
 8734         -
            #[allow(unused_mut)]
 8735         -
            let mut http_request = http::Request::builder()
 8736         -
                .uri("/MalformedBlob")
 8737         -
                .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         -
                ))
 8742         -
                .unwrap();
 8743         -
            #[allow(unused_mut)]
 8744         -
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 8745         -
            let config = crate::service::RestJsonConfig::builder().build();
 8746         -
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 8747         -
                            .malformed_blob(move |input: crate::input::MalformedBlobInput| {
 8748         -
                                let sender = sender.clone();
 8749         -
                                async move {
 8750         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedBlobOutput };
 8751         -
                                    sender.send(()).await.expect("receiver dropped early");
 8752         -
                                    result
 8753         -
                                }
 8754         -
                            })
 8755         -
                            .build_unchecked();
 8756         -
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 8757         -
                .await
 8758         -
                .expect("unable to make an HTTP request");
 8759         -
            ::pretty_assertions::assert_eq!(
 8760         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 8761         -
                http_response.status()
 8762         -
            );
 8763         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 8764         -
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 8765         -
                http_response.headers(),
 8766         -
                expected_headers,
 8767         -
            ));
 8768         -
        }
 8769         -
    }
 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
 8773         -
    #[::tokio::test]
 8774         -
    async fn rest_json_body_malformed_blob_invalid_base64_case7_malformed_request() {
 8775         -
        {
 8776         -
            #[allow(unused_mut)]
 8777         -
            let mut http_request = http::Request::builder()
 8778         -
                .uri("/MalformedBlob")
 8779         -
                .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         -
                ))
 8784         -
                .unwrap();
 8785         -
            #[allow(unused_mut)]
 8786         -
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 8787         -
            let config = crate::service::RestJsonConfig::builder().build();
 8788         -
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 8789         -
                            .malformed_blob(move |input: crate::input::MalformedBlobInput| {
 8790         -
                                let sender = sender.clone();
 8791         -
                                async move {
 8792         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedBlobOutput };
 8793         -
                                    sender.send(()).await.expect("receiver dropped early");
 8794         -
                                    result
 8795         -
                                }
 8796         -
                            })
 8797         -
                            .build_unchecked();
 8798         -
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 8799         -
                .await
 8800         -
                .expect("unable to make an HTTP request");
 8801         -
            ::pretty_assertions::assert_eq!(
 8802         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 8803         -
                http_response.status()
 8804         -
            );
 8805         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 8806         -
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 8807         -
                http_response.headers(),
 8808         -
                expected_headers,
 8809         -
            ));
 8810         -
        }
 8811         -
    }
 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
 8815         -
    #[::tokio::test]
 8816         -
    async fn rest_json_body_malformed_blob_invalid_base64_case8_malformed_request() {
 8817         -
        {
 8818         -
            #[allow(unused_mut)]
 8819         -
            let mut http_request = http::Request::builder()
 8820         -
                .uri("/MalformedBlob")
 8821         -
                .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         -
                ))
 8826         -
                .unwrap();
 8827         -
            #[allow(unused_mut)]
 8828         -
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 8829         -
            let config = crate::service::RestJsonConfig::builder().build();
 8830         -
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 8831         -
                            .malformed_blob(move |input: crate::input::MalformedBlobInput| {
 8832         -
                                let sender = sender.clone();
 8833         -
                                async move {
 8834         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedBlobOutput };
 8835         -
                                    sender.send(()).await.expect("receiver dropped early");
 8836         -
                                    result
 8837         -
                                }
 8838         -
                            })
 8839         -
                            .build_unchecked();
 8840         -
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 8841         -
                .await
 8842         -
                .expect("unable to make an HTTP request");
 8843         -
            ::pretty_assertions::assert_eq!(
 8844         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 8845         -
                http_response.status()
 8846         -
            );
 8847         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 8848         -
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 8849         -
                http_response.headers(),
 8850         -
                expected_headers,
 8851         -
            ));
 8852         -
        }
 8853         -
    }
 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
 8860         -
    #[::tokio::test]
 8861         -
    async fn rest_json_body_boolean_string_coercion_case0_malformed_request() {
 8862         -
        {
 8863         -
            #[allow(unused_mut)]
 8864         -
            let mut http_request = http::Request::builder()
 8865         -
                .uri("/MalformedBoolean/true")
 8866         -
                .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         -
                ))
 8871         -
                .unwrap();
 8872         -
            #[allow(unused_mut)]
 8873         -
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 8874         -
            let config = crate::service::RestJsonConfig::builder().build();
 8875         -
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 8876         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
 8877         -
                                let sender = sender.clone();
 8878         -
                                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> };
 8880         -
                                    sender.send(()).await.expect("receiver dropped early");
 8881         -
                                    result
 8882         -
                                }
 8883         -
                            })
 8884         -
                            .build_unchecked();
 8885         -
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 8886         -
                .await
 8887         -
                .expect("unable to make an HTTP request");
 8888         -
            ::pretty_assertions::assert_eq!(
 8889         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 8890         -
                http_response.status()
 8891         -
            );
 8892         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 8893         -
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 8894         -
                http_response.headers(),
 8895         -
                expected_headers,
 8896         -
            ));
 8897         -
        }
 8898         -
    }
 8899         -
    /// Attempted string coercion should result in SerializationException
 8900         -
    /// Test ID: RestJsonBodyBooleanStringCoercion_case1
 8901         -
    #[::tokio::test]
 8902         -
    async fn rest_json_body_boolean_string_coercion_case1_malformed_request() {
 8903         -
        {
 8904         -
            #[allow(unused_mut)]
 8905         -
            let mut http_request = http::Request::builder()
 8906         -
                .uri("/MalformedBoolean/true")
 8907         -
                .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         -
                ))
 8912         -
                .unwrap();
 8913         -
            #[allow(unused_mut)]
 8914         -
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 8915         -
            let config = crate::service::RestJsonConfig::builder().build();
 8916         -
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 8917         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
 8918         -
                                let sender = sender.clone();
 8919         -
                                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> };
 8921         -
                                    sender.send(()).await.expect("receiver dropped early");
 8922         -
                                    result
 8923         -
                                }
 8924         -
                            })
 8925         -
                            .build_unchecked();
 8926         -
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 8927         -
                .await
 8928         -
                .expect("unable to make an HTTP request");
 8929         -
            ::pretty_assertions::assert_eq!(
 8930         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 8931         -
                http_response.status()
 8932         -
            );
 8933         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 8934         -
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 8935         -
                http_response.headers(),
 8936         -
                expected_headers,
 8937         -
            ));
 8938         -
        }
 8939         -
    }
 8940         -
    /// Attempted string coercion should result in SerializationException
 8941         -
    /// Test ID: RestJsonBodyBooleanStringCoercion_case2
 8942         -
    #[::tokio::test]
 8943         -
    async fn rest_json_body_boolean_string_coercion_case2_malformed_request() {
 8944         -
        {
 8945         -
            #[allow(unused_mut)]
 8946         -
            let mut http_request = http::Request::builder()
 8947         -
                .uri("/MalformedBoolean/true")
 8948         -
                .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         -
                ))
 8953         -
                .unwrap();
 8954         -
            #[allow(unused_mut)]
 8955         -
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 8956         -
            let config = crate::service::RestJsonConfig::builder().build();
 8957         -
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 8958         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
 8959         -
                                let sender = sender.clone();
 8960         -
                                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> };
 8962         -
                                    sender.send(()).await.expect("receiver dropped early");
 8963         -
                                    result
 8964         -
                                }
 8965         -
                            })
 8966         -
                            .build_unchecked();
 8967         -
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 8968         -
                .await
 8969         -
                .expect("unable to make an HTTP request");
 8970         -
            ::pretty_assertions::assert_eq!(
 8971         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 8972         -
                http_response.status()
 8973         -
            );
 8974         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 8975         -
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 8976         -
                http_response.headers(),
 8977         -
                expected_headers,
 8978         -
            ));
 8979         -
        }
 8980         -
    }
 8981         -
    /// Attempted string coercion should result in SerializationException
 8982         -
    /// Test ID: RestJsonBodyBooleanStringCoercion_case3
 8983         -
    #[::tokio::test]
 8984         -
    async fn rest_json_body_boolean_string_coercion_case3_malformed_request() {
 8985         -
        {
 8986         -
            #[allow(unused_mut)]
 8987         -
            let mut http_request = http::Request::builder()
 8988         -
                .uri("/MalformedBoolean/true")
 8989         -
                .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         -
                ))
 8994         -
                .unwrap();
 8995         -
            #[allow(unused_mut)]
 8996         -
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 8997         -
            let config = crate::service::RestJsonConfig::builder().build();
 8998         -
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 8999         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
 9000         -
                                let sender = sender.clone();
 9001         -
                                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> };
 9003         -
                                    sender.send(()).await.expect("receiver dropped early");
 9004         -
                                    result
 9005         -
                                }
 9006         -
                            })
 9007         -
                            .build_unchecked();
 9008         -
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 9009         -
                .await
 9010         -
                .expect("unable to make an HTTP request");
 9011         -
            ::pretty_assertions::assert_eq!(
 9012         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 9013         -
                http_response.status()
 9014         -
            );
 9015         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 9016         -
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 9017         -
                http_response.headers(),
 9018         -
                expected_headers,
 9019         -
            ));
 9020         -
        }
 9021         -
    }
 9022         -
    /// Attempted string coercion should result in SerializationException
 9023         -
    /// Test ID: RestJsonBodyBooleanStringCoercion_case4
 9024         -
    #[::tokio::test]
 9025         -
    async fn rest_json_body_boolean_string_coercion_case4_malformed_request() {
 9026         -
        {
 9027         -
            #[allow(unused_mut)]
 9028         -
            let mut http_request = http::Request::builder()
 9029         -
                .uri("/MalformedBoolean/true")
 9030         -
                .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         -
                ))
 9035         -
                .unwrap();
 9036         -
            #[allow(unused_mut)]
 9037         -
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 9038         -
            let config = crate::service::RestJsonConfig::builder().build();
 9039         -
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 9040         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
 9041         -
                                let sender = sender.clone();
 9042         -
                                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> };
 9044         -
                                    sender.send(()).await.expect("receiver dropped early");
 9045         -
                                    result
 9046         -
                                }
 9047         -
                            })
 9048         -
                            .build_unchecked();
 9049         -
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 9050         -
                .await
 9051         -
                .expect("unable to make an HTTP request");
 9052         -
            ::pretty_assertions::assert_eq!(
 9053         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 9054         -
                http_response.status()
 9055         -
            );
 9056         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 9057         -
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 9058         -
                http_response.headers(),
 9059         -
                expected_headers,
 9060         -
            ));
 9061         -
        }
 9062         -
    }
 9063         -
    /// Attempted string coercion should result in SerializationException
 9064         -
    /// Test ID: RestJsonBodyBooleanStringCoercion_case5
 9065         -
    #[::tokio::test]
 9066         -
    async fn rest_json_body_boolean_string_coercion_case5_malformed_request() {
 9067         -
        {
 9068         -
            #[allow(unused_mut)]
 9069         -
            let mut http_request = http::Request::builder()
 9070         -
                .uri("/MalformedBoolean/true")
 9071         -
                .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         -
                ))
 9076         -
                .unwrap();
 9077         -
            #[allow(unused_mut)]
 9078         -
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 9079         -
            let config = crate::service::RestJsonConfig::builder().build();
 9080         -
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 9081         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
 9082         -
                                let sender = sender.clone();
 9083         -
                                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> };
 9085         -
                                    sender.send(()).await.expect("receiver dropped early");
 9086         -
                                    result
 9087         -
                                }
 9088         -
                            })
 9089         -
                            .build_unchecked();
 9090         -
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 9091         -
                .await
 9092         -
                .expect("unable to make an HTTP request");
 9093         -
            ::pretty_assertions::assert_eq!(
 9094         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 9095         -
                http_response.status()
 9096         -
            );
 9097         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 9098         -
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 9099         -
                http_response.headers(),
 9100         -
                expected_headers,
 9101         -
            ));
 9102         -
        }
 9103         -
    }
 9104         -
    /// Attempted string coercion should result in SerializationException
 9105         -
    /// Test ID: RestJsonBodyBooleanStringCoercion_case6
 9106         -
    #[::tokio::test]
 9107         -
    async fn rest_json_body_boolean_string_coercion_case6_malformed_request() {
 9108         -
        {
 9109         -
            #[allow(unused_mut)]
 9110         -
            let mut http_request = http::Request::builder()
 9111         -
                .uri("/MalformedBoolean/true")
 9112         -
                .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         -
                ))
 9117         -
                .unwrap();
 9118         -
            #[allow(unused_mut)]
 9119         -
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 9120         -
            let config = crate::service::RestJsonConfig::builder().build();
 9121         -
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 9122         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
 9123         -
                                let sender = sender.clone();
 9124         -
                                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> };
 9126         -
                                    sender.send(()).await.expect("receiver dropped early");
 9127         -
                                    result
 9128         -
                                }
 9129         -
                            })
 9130         -
                            .build_unchecked();
 9131         -
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 9132         -
                .await
 9133         -
                .expect("unable to make an HTTP request");
 9134         -
            ::pretty_assertions::assert_eq!(
 9135         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 9136         -
                http_response.status()
 9137         -
            );
 9138         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 9139         -
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 9140         -
                http_response.headers(),
 9141         -
                expected_headers,
 9142         -
            ));
 9143         -
        }
 9144         -
    }
 9145         -
    /// Attempted string coercion should result in SerializationException
 9146         -
    /// Test ID: RestJsonBodyBooleanStringCoercion_case7
 9147         -
    #[::tokio::test]
 9148         -
    async fn rest_json_body_boolean_string_coercion_case7_malformed_request() {
 9149         -
        {
 9150         -
            #[allow(unused_mut)]
 9151         -
            let mut http_request = http::Request::builder()
 9152         -
                .uri("/MalformedBoolean/true")
 9153         -
                .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         -
                ))
 9158         -
                .unwrap();
 9159         -
            #[allow(unused_mut)]
 9160         -
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 9161         -
            let config = crate::service::RestJsonConfig::builder().build();
 9162         -
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 9163         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
 9164         -
                                let sender = sender.clone();
 9165         -
                                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> };
 9167         -
                                    sender.send(()).await.expect("receiver dropped early");
 9168         -
                                    result
 9169         -
                                }
 9170         -
                            })
 9171         -
                            .build_unchecked();
 9172         -
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 9173         -
                .await
 9174         -
                .expect("unable to make an HTTP request");
 9175         -
            ::pretty_assertions::assert_eq!(
 9176         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 9177         -
                http_response.status()
 9178         -
            );
 9179         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 9180         -
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 9181         -
                http_response.headers(),
 9182         -
                expected_headers,
 9183         -
            ));
 9184         -
        }
 9185         -
    }
 9186         -
    /// Attempted string coercion should result in SerializationException
 9187         -
    /// Test ID: RestJsonBodyBooleanStringCoercion_case8
 9188         -
    #[::tokio::test]
 9189         -
    async fn rest_json_body_boolean_string_coercion_case8_malformed_request() {
 9190         -
        {
 9191         -
            #[allow(unused_mut)]
 9192         -
            let mut http_request = http::Request::builder()
 9193         -
                .uri("/MalformedBoolean/true")
 9194         -
                .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         -
                ))
 9199         -
                .unwrap();
 9200         -
            #[allow(unused_mut)]
 9201         -
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 9202         -
            let config = crate::service::RestJsonConfig::builder().build();
 9203         -
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 9204         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
 9205         -
                                let sender = sender.clone();
 9206         -
                                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> };
 9208         -
                                    sender.send(()).await.expect("receiver dropped early");
 9209         -
                                    result
 9210         -
                                }
 9211         -
                            })
 9212         -
                            .build_unchecked();
 9213         -
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 9214         -
                .await
 9215         -
                .expect("unable to make an HTTP request");
 9216         -
            ::pretty_assertions::assert_eq!(
 9217         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 9218         -
                http_response.status()
 9219         -
            );
 9220         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 9221         -
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 9222         -
                http_response.headers(),
 9223         -
                expected_headers,
 9224         -
            ));
 9225         -
        }
 9226         -
    }
 9227         -
    /// Attempted string coercion should result in SerializationException
 9228         -
    /// Test ID: RestJsonBodyBooleanStringCoercion_case9
 9229         -
    #[::tokio::test]
 9230         -
    async fn rest_json_body_boolean_string_coercion_case9_malformed_request() {
 9231         -
        {
 9232         -
            #[allow(unused_mut)]
 9233         -
            let mut http_request = http::Request::builder()
 9234         -
                .uri("/MalformedBoolean/true")
 9235         -
                .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         -
                ))
 9240         -
                .unwrap();
 9241         -
            #[allow(unused_mut)]
 9242         -
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 9243         -
            let config = crate::service::RestJsonConfig::builder().build();
 9244         -
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 9245         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
 9246         -
                                let sender = sender.clone();
 9247         -
                                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> };
 9249         -
                                    sender.send(()).await.expect("receiver dropped early");
 9250         -
                                    result
 9251         -
                                }
 9252         -
                            })
 9253         -
                            .build_unchecked();
 9254         -
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 9255         -
                .await
 9256         -
                .expect("unable to make an HTTP request");
 9257         -
            ::pretty_assertions::assert_eq!(
 9258         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 9259         -
                http_response.status()
 9260         -
            );
 9261         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 9262         -
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 9263         -
                http_response.headers(),
 9264         -
                expected_headers,
 9265         -
            ));
 9266         -
        }
 9267         -
    }
 9268         -
    /// Attempted string coercion should result in SerializationException
 9269         -
    /// Test ID: RestJsonBodyBooleanStringCoercion_case10
 9270         -
    #[::tokio::test]
 9271         -
    async fn rest_json_body_boolean_string_coercion_case10_malformed_request() {
 9272         -
        {
 9273         -
            #[allow(unused_mut)]
 9274         -
            let mut http_request = http::Request::builder()
 9275         -
                .uri("/MalformedBoolean/true")
 9276         -
                .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         -
                ))
 9281         -
                .unwrap();
 9282         -
            #[allow(unused_mut)]
 9283         -
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 9284         -
            let config = crate::service::RestJsonConfig::builder().build();
 9285         -
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 9286         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
 9287         -
                                let sender = sender.clone();
 9288         -
                                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> };
 9290         -
                                    sender.send(()).await.expect("receiver dropped early");
 9291         -
                                    result
 9292         -
                                }
 9293         -
                            })
 9294         -
                            .build_unchecked();
 9295         -
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 9296         -
                .await
 9297         -
                .expect("unable to make an HTTP request");
 9298         -
            ::pretty_assertions::assert_eq!(
 9299         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 9300         -
                http_response.status()
 9301         -
            );
 9302         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 9303         -
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 9304         -
                http_response.headers(),
 9305         -
                expected_headers,
 9306         -
            ));
 9307         -
        }
 9308         -
    }
 9309         -
    /// Attempted string coercion should result in SerializationException
 9310         -
    /// Test ID: RestJsonBodyBooleanStringCoercion_case11
 9311         -
    #[::tokio::test]
 9312         -
    async fn rest_json_body_boolean_string_coercion_case11_malformed_request() {
 9313         -
        {
 9314         -
            #[allow(unused_mut)]
 9315         -
            let mut http_request = http::Request::builder()
 9316         -
                .uri("/MalformedBoolean/true")
 9317         -
                .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         -
                ))
 9322         -
                .unwrap();
 9323         -
            #[allow(unused_mut)]
 9324         -
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 9325         -
            let config = crate::service::RestJsonConfig::builder().build();
 9326         -
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 9327         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
 9328         -
                                let sender = sender.clone();
 9329         -
                                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> };
 9331         -
                                    sender.send(()).await.expect("receiver dropped early");
 9332         -
                                    result
 9333         -
                                }
 9334         -
                            })
 9335         -
                            .build_unchecked();
 9336         -
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 9337         -
                .await
 9338         -
                .expect("unable to make an HTTP request");
 9339         -
            ::pretty_assertions::assert_eq!(
 9340         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 9341         -
                http_response.status()
 9342         -
            );
 9343         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 9344         -
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 9345         -
                http_response.headers(),
 9346         -
                expected_headers,
 9347         -
            ));
 9348         -
        }
 9349         -
    }
 9350         -
    /// Attempted string coercion should result in SerializationException
 9351         -
    /// Test ID: RestJsonBodyBooleanStringCoercion_case12
 9352         -
    #[::tokio::test]
 9353         -
    async fn rest_json_body_boolean_string_coercion_case12_malformed_request() {
 9354         -
        {
 9355         -
            #[allow(unused_mut)]
 9356         -
            let mut http_request = http::Request::builder()
 9357         -
                .uri("/MalformedBoolean/true")
 9358         -
                .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         -
                ))
 9363         -
                .unwrap();
 9364         -
            #[allow(unused_mut)]
 9365         -
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 9366         -
            let config = crate::service::RestJsonConfig::builder().build();
 9367         -
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 9368         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
 9369         -
                                let sender = sender.clone();
 9370         -
                                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> };
 9372         -
                                    sender.send(()).await.expect("receiver dropped early");
 9373         -
                                    result
 9374         -
                                }
 9375         -
                            })
 9376         -
                            .build_unchecked();
 9377         -
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 9378         -
                .await
 9379         -
                .expect("unable to make an HTTP request");
 9380         -
            ::pretty_assertions::assert_eq!(
 9381         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 9382         -
                http_response.status()
 9383         -
            );
 9384         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 9385         -
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 9386         -
                http_response.headers(),
 9387         -
                expected_headers,
 9388         -
            ));
 9389         -
        }
 9390         -
    }
 9391         -
    /// Attempted string coercion should result in SerializationException
 9392         -
    /// Test ID: RestJsonBodyBooleanStringCoercion_case13
 9393         -
    #[::tokio::test]
 9394         -
    async fn rest_json_body_boolean_string_coercion_case13_malformed_request() {
 9395         -
        {
 9396         -
            #[allow(unused_mut)]
 9397         -
            let mut http_request = http::Request::builder()
 9398         -
                .uri("/MalformedBoolean/true")
 9399         -
                .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         -
                ))
 9404         -
                .unwrap();
 9405         -
            #[allow(unused_mut)]
 9406         -
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 9407         -
            let config = crate::service::RestJsonConfig::builder().build();
 9408         -
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 9409         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
 9410         -
                                let sender = sender.clone();
 9411         -
                                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> };
 9413         -
                                    sender.send(()).await.expect("receiver dropped early");
 9414         -
                                    result
 9415         -
                                }
 9416         -
                            })
 9417         -
                            .build_unchecked();
 9418         -
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 9419         -
                .await
 9420         -
                .expect("unable to make an HTTP request");
 9421         -
            ::pretty_assertions::assert_eq!(
 9422         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 9423         -
                http_response.status()
 9424         -
            );
 9425         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 9426         -
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 9427         -
                http_response.headers(),
 9428         -
                expected_headers,
 9429         -
            ));
 9430         -
        }
 9431         -
    }
 9432         -
    /// Attempted string coercion should result in SerializationException
 9433         -
    /// Test ID: RestJsonBodyBooleanStringCoercion_case14
 9434         -
    #[::tokio::test]
 9435         -
    async fn rest_json_body_boolean_string_coercion_case14_malformed_request() {
 9436         -
        {
 9437         -
            #[allow(unused_mut)]
 9438         -
            let mut http_request = http::Request::builder()
 9439         -
                .uri("/MalformedBoolean/true")
 9440         -
                .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         -
                ))
 9445         -
                .unwrap();
 9446         -
            #[allow(unused_mut)]
 9447         -
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 9448         -
            let config = crate::service::RestJsonConfig::builder().build();
 9449         -
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 9450         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
 9451         -
                                let sender = sender.clone();
 9452         -
                                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> };
 9454         -
                                    sender.send(()).await.expect("receiver dropped early");
 9455         -
                                    result
 9456         -
                                }
 9457         -
                            })
 9458         -
                            .build_unchecked();
 9459         -
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 9460         -
                .await
 9461         -
                .expect("unable to make an HTTP request");
 9462         -
            ::pretty_assertions::assert_eq!(
 9463         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 9464         -
                http_response.status()
 9465         -
            );
 9466         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 9467         -
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 9468         -
                http_response.headers(),
 9469         -
                expected_headers,
 9470         -
            ));
 9471         -
        }
 9472         -
    }
 9473         -
    /// Attempted string coercion should result in SerializationException
 9474         -
    /// Test ID: RestJsonBodyBooleanStringCoercion_case15
 9475         -
    #[::tokio::test]
 9476         -
    async fn rest_json_body_boolean_string_coercion_case15_malformed_request() {
 9477         -
        {
 9478         -
            #[allow(unused_mut)]
 9479         -
            let mut http_request = http::Request::builder()
 9480         -
                .uri("/MalformedBoolean/true")
 9481         -
                .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         -
                ))
 9486         -
                .unwrap();
 9487         -
            #[allow(unused_mut)]
 9488         -
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 9489         -
            let config = crate::service::RestJsonConfig::builder().build();
 9490         -
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 9491         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
 9492         -
                                let sender = sender.clone();
 9493         -
                                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> };
 9495         -
                                    sender.send(()).await.expect("receiver dropped early");
 9496         -
                                    result
 9497         -
                                }
 9498         -
                            })
 9499         -
                            .build_unchecked();
 9500         -
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 9501         -
                .await
 9502         -
                .expect("unable to make an HTTP request");
 9503         -
            ::pretty_assertions::assert_eq!(
 9504         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 9505         -
                http_response.status()
 9506         -
            );
 9507         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 9508         -
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 9509         -
                http_response.headers(),
 9510         -
                expected_headers,
 9511         -
            ));
 9512         -
        }
 9513         -
    }
 9514         -
    /// Attempted string coercion should result in SerializationException
 9515         -
    /// Test ID: RestJsonBodyBooleanStringCoercion_case16
 9516         -
    #[::tokio::test]
 9517         -
    async fn rest_json_body_boolean_string_coercion_case16_malformed_request() {
 9518         -
        {
 9519         -
            #[allow(unused_mut)]
 9520         -
            let mut http_request = http::Request::builder()
 9521         -
                .uri("/MalformedBoolean/true")
 9522         -
                .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         -
                ))
 9527         -
                .unwrap();
 9528         -
            #[allow(unused_mut)]
 9529         -
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 9530         -
            let config = crate::service::RestJsonConfig::builder().build();
 9531         -
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 9532         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
 9533         -
                                let sender = sender.clone();
 9534         -
                                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> };
 9536         -
                                    sender.send(()).await.expect("receiver dropped early");
 9537         -
                                    result
 9538         -
                                }
 9539         -
                            })
 9540         -
                            .build_unchecked();
 9541         -
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 9542         -
                .await
 9543         -
                .expect("unable to make an HTTP request");
 9544         -
            ::pretty_assertions::assert_eq!(
 9545         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 9546         -
                http_response.status()
 9547         -
            );
 9548         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 9549         -
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 9550         -
                http_response.headers(),
 9551         -
                expected_headers,
 9552         -
            ));
 9553         -
        }
 9554         -
    }
 9555         -
    /// Attempted string coercion should result in SerializationException
 9556         -
    /// Test ID: RestJsonBodyBooleanStringCoercion_case17
 9557         -
    #[::tokio::test]
 9558         -
    async fn rest_json_body_boolean_string_coercion_case17_malformed_request() {
 9559         -
        {
 9560         -
            #[allow(unused_mut)]
 9561         -
            let mut http_request = http::Request::builder()
 9562         -
                .uri("/MalformedBoolean/true")
 9563         -
                .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         -
                ))
 9568         -
                .unwrap();
 9569         -
            #[allow(unused_mut)]
 9570         -
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 9571         -
            let config = crate::service::RestJsonConfig::builder().build();
 9572         -
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 9573         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
 9574         -
                                let sender = sender.clone();
 9575         -
                                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> };
 9577         -
                                    sender.send(()).await.expect("receiver dropped early");
 9578         -
                                    result
 9579         -
                                }
 9580         -
                            })
 9581         -
                            .build_unchecked();
 9582         -
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 9583         -
                .await
 9584         -
                .expect("unable to make an HTTP request");
 9585         -
            ::pretty_assertions::assert_eq!(
 9586         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 9587         -
                http_response.status()
 9588         -
            );
 9589         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 9590         -
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 9591         -
                http_response.headers(),
 9592         -
                expected_headers,
 9593         -
            ));
 9594         -
        }
 9595         -
    }
 9596         -
    /// Attempted string coercion should result in SerializationException
 9597         -
    /// Test ID: RestJsonBodyBooleanStringCoercion_case18
 9598         -
    #[::tokio::test]
 9599         -
    async fn rest_json_body_boolean_string_coercion_case18_malformed_request() {
 9600         -
        {
 9601         -
            #[allow(unused_mut)]
 9602         -
            let mut http_request = http::Request::builder()
 9603         -
                .uri("/MalformedBoolean/true")
 9604         -
                .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         -
                ))
 9609         -
                .unwrap();
 9610         -
            #[allow(unused_mut)]
 9611         -
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 9612         -
            let config = crate::service::RestJsonConfig::builder().build();
 9613         -
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 9614         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
 9615         -
                                let sender = sender.clone();
 9616         -
                                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> };
 9618         -
                                    sender.send(()).await.expect("receiver dropped early");
 9619         -
                                    result
 9620         -
                                }
 9621         -
                            })
 9622         -
                            .build_unchecked();
 9623         -
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 9624         -
                .await
 9625         -
                .expect("unable to make an HTTP request");
 9626         -
            ::pretty_assertions::assert_eq!(
 9627         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 9628         -
                http_response.status()
 9629         -
            );
 9630         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 9631         -
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 9632         -
                http_response.headers(),
 9633         -
                expected_headers,
 9634         -
            ));
 9635         -
        }
 9636         -
    }
 9637         -
    /// Attempted string coercion should result in SerializationException
 9638         -
    /// Test ID: RestJsonBodyBooleanStringCoercion_case19
 9639         -
    #[::tokio::test]
 9640         -
    async fn rest_json_body_boolean_string_coercion_case19_malformed_request() {
 9641         -
        {
 9642         -
            #[allow(unused_mut)]
 9643         -
            let mut http_request = http::Request::builder()
 9644         -
                .uri("/MalformedBoolean/true")
 9645         -
                .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         -
                ))
 9650         -
                .unwrap();
 9651         -
            #[allow(unused_mut)]
 9652         -
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 9653         -
            let config = crate::service::RestJsonConfig::builder().build();
 9654         -
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 9655         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
 9656         -
                                let sender = sender.clone();
 9657         -
                                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> };
 9659         -
                                    sender.send(()).await.expect("receiver dropped early");
 9660         -
                                    result
 9661         -
                                }
 9662         -
                            })
 9663         -
                            .build_unchecked();
 9664         -
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 9665         -
                .await
 9666         -
                .expect("unable to make an HTTP request");
 9667         -
            ::pretty_assertions::assert_eq!(
 9668         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 9669         -
                http_response.status()
 9670         -
            );
 9671         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 9672         -
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 9673         -
                http_response.headers(),
 9674         -
                expected_headers,
 9675         -
            ));
 9676         -
        }
 9677         -
    }
 9678         -
    /// Attempted string coercion should result in SerializationException
 9679         -
    /// Test ID: RestJsonBodyBooleanStringCoercion_case20
 9680         -
    #[::tokio::test]
 9681         -
    async fn rest_json_body_boolean_string_coercion_case20_malformed_request() {
        2569  +
    #[::tracing_test::traced_test]
        2570  +
    async fn rest_json_body_timestamp_date_time_rejects_different8601_formats_case0_malformed_request(
        2571  +
    ) {
 9682   2572   
        {
 9683   2573   
            #[allow(unused_mut)]
 9684   2574   
            let mut http_request = http::Request::builder()
 9685         -
                .uri("/MalformedBoolean/true")
        2575  +
                .uri("/MalformedTimestampBodyDateTime")
 9686   2576   
                .method("POST")
 9687   2577   
                .header("content-type", "application/json")
 9688   2578   
                .body(::aws_smithy_http_server::body::Body::from(
 9689         -
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : \"0\" }".as_bytes()),
        2579  +
                    ::bytes::Bytes::from_static(
        2580  +
                        "{ \"timestamp\": \"1996-12-19T16:39:57+00\" }".as_bytes(),
        2581  +
                    ),
 9690   2582   
                ))
 9691   2583   
                .unwrap();
 9692   2584   
            #[allow(unused_mut)]
 9693   2585   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 9694   2586   
            let config = crate::service::RestJsonConfig::builder().build();
 9695   2587   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 9696         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        2588  +
                            .malformed_timestamp_body_date_time(move |input: crate::input::MalformedTimestampBodyDateTimeInput| {
 9697   2589   
                                let sender = sender.clone();
 9698   2590   
                                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> };
        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> };
 9700   2592   
                                    sender.send(()).await.expect("receiver dropped early");
 9701   2593   
                                    result
 9702   2594   
                                }
 9703   2595   
                            })
 9704   2596   
                            .build_unchecked();
 9705   2597   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 9706   2598   
                .await
 9707   2599   
                .expect("unable to make an HTTP request");
 9708   2600   
            ::pretty_assertions::assert_eq!(
 9709   2601   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 9710   2602   
                http_response.status()
 9711   2603   
            );
 9712   2604   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 9713   2605   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 9714   2606   
                http_response.headers(),
 9715   2607   
                expected_headers,
 9716   2608   
            ));
 9717   2609   
        }
 9718   2610   
    }
 9719         -
    /// Attempted string coercion should result in SerializationException
 9720         -
    /// Test ID: RestJsonBodyBooleanStringCoercion_case21
        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
 9721   2614   
    #[::tokio::test]
 9722         -
    async fn rest_json_body_boolean_string_coercion_case21_malformed_request() {
        2615  +
    #[::tracing_test::traced_test]
        2616  +
    async fn rest_json_body_timestamp_date_time_rejects_different8601_formats_case1_malformed_request(
        2617  +
    ) {
 9723   2618   
        {
 9724   2619   
            #[allow(unused_mut)]
 9725   2620   
            let mut http_request = http::Request::builder()
 9726         -
                .uri("/MalformedBoolean/true")
        2621  +
                .uri("/MalformedTimestampBodyDateTime")
 9727   2622   
                .method("POST")
 9728   2623   
                .header("content-type", "application/json")
 9729   2624   
                .body(::aws_smithy_http_server::body::Body::from(
 9730         -
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : \"off\" }".as_bytes()),
        2625  +
                    ::bytes::Bytes::from_static(
        2626  +
                        "{ \"timestamp\": \"1996-12-19T16:39:57+00Z\" }".as_bytes(),
        2627  +
                    ),
 9731   2628   
                ))
 9732   2629   
                .unwrap();
 9733   2630   
            #[allow(unused_mut)]
 9734   2631   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 9735   2632   
            let config = crate::service::RestJsonConfig::builder().build();
 9736   2633   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 9737         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        2634  +
                            .malformed_timestamp_body_date_time(move |input: crate::input::MalformedTimestampBodyDateTimeInput| {
 9738   2635   
                                let sender = sender.clone();
 9739   2636   
                                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> };
        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> };
 9741   2638   
                                    sender.send(()).await.expect("receiver dropped early");
 9742   2639   
                                    result
 9743   2640   
                                }
 9744   2641   
                            })
 9745   2642   
                            .build_unchecked();
 9746   2643   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 9747   2644   
                .await
 9748   2645   
                .expect("unable to make an HTTP request");
 9749   2646   
            ::pretty_assertions::assert_eq!(
 9750   2647   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 9751   2648   
                http_response.status()
 9752   2649   
            );
 9753   2650   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 9754   2651   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 9755   2652   
                http_response.headers(),
 9756   2653   
                expected_headers,
 9757   2654   
            ));
 9758   2655   
        }
 9759   2656   
    }
 9760         -
    /// Attempted string coercion should result in SerializationException
 9761         -
    /// Test ID: RestJsonBodyBooleanStringCoercion_case22
        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
 9762   2660   
    #[::tokio::test]
 9763         -
    async fn rest_json_body_boolean_string_coercion_case22_malformed_request() {
        2661  +
    #[::tracing_test::traced_test]
        2662  +
    async fn rest_json_body_timestamp_date_time_rejects_different8601_formats_case2_malformed_request(
        2663  +
    ) {
 9764   2664   
        {
 9765   2665   
            #[allow(unused_mut)]
 9766   2666   
            let mut http_request = http::Request::builder()
 9767         -
                .uri("/MalformedBoolean/true")
        2667  +
                .uri("/MalformedTimestampBodyDateTime")
 9768   2668   
                .method("POST")
 9769   2669   
                .header("content-type", "application/json")
 9770   2670   
                .body(::aws_smithy_http_server::body::Body::from(
 9771         -
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : \"Off\" }".as_bytes()),
        2671  +
                    ::bytes::Bytes::from_static(
        2672  +
                        "{ \"timestamp\": \"1996-12-19T16:39:57\" }".as_bytes(),
        2673  +
                    ),
 9772   2674   
                ))
 9773   2675   
                .unwrap();
 9774   2676   
            #[allow(unused_mut)]
 9775   2677   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 9776   2678   
            let config = crate::service::RestJsonConfig::builder().build();
 9777   2679   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 9778         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        2680  +
                            .malformed_timestamp_body_date_time(move |input: crate::input::MalformedTimestampBodyDateTimeInput| {
 9779   2681   
                                let sender = sender.clone();
 9780   2682   
                                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> };
        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> };
 9782   2684   
                                    sender.send(()).await.expect("receiver dropped early");
 9783   2685   
                                    result
 9784   2686   
                                }
 9785   2687   
                            })
 9786   2688   
                            .build_unchecked();
 9787   2689   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 9788   2690   
                .await
 9789   2691   
                .expect("unable to make an HTTP request");
 9790   2692   
            ::pretty_assertions::assert_eq!(
 9791   2693   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 9792   2694   
                http_response.status()
 9793   2695   
            );
 9794   2696   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 9795   2697   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 9796   2698   
                http_response.headers(),
 9797   2699   
                expected_headers,
 9798   2700   
            ));
 9799   2701   
        }
 9800   2702   
    }
 9801         -
    /// Attempted string coercion should result in SerializationException
 9802         -
    /// Test ID: RestJsonBodyBooleanStringCoercion_case23
        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
 9803   2706   
    #[::tokio::test]
 9804         -
    async fn rest_json_body_boolean_string_coercion_case23_malformed_request() {
        2707  +
    #[::tracing_test::traced_test]
        2708  +
    async fn rest_json_body_timestamp_date_time_rejects_different8601_formats_case3_malformed_request(
        2709  +
    ) {
 9805   2710   
        {
 9806   2711   
            #[allow(unused_mut)]
 9807   2712   
            let mut http_request = http::Request::builder()
 9808         -
                .uri("/MalformedBoolean/true")
        2713  +
                .uri("/MalformedTimestampBodyDateTime")
 9809   2714   
                .method("POST")
 9810   2715   
                .header("content-type", "application/json")
 9811   2716   
                .body(::aws_smithy_http_server::body::Body::from(
 9812         -
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : \"OFF\" }".as_bytes()),
        2717  +
                    ::bytes::Bytes::from_static(
        2718  +
                        "{ \"timestamp\": \"1996-12-19T163957\" }".as_bytes(),
        2719  +
                    ),
 9813   2720   
                ))
 9814   2721   
                .unwrap();
 9815   2722   
            #[allow(unused_mut)]
 9816   2723   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 9817   2724   
            let config = crate::service::RestJsonConfig::builder().build();
 9818   2725   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 9819         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        2726  +
                            .malformed_timestamp_body_date_time(move |input: crate::input::MalformedTimestampBodyDateTimeInput| {
 9820   2727   
                                let sender = sender.clone();
 9821   2728   
                                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> };
        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> };
 9823   2730   
                                    sender.send(()).await.expect("receiver dropped early");
 9824   2731   
                                    result
 9825   2732   
                                }
 9826   2733   
                            })
 9827   2734   
                            .build_unchecked();
 9828   2735   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 9829   2736   
                .await
 9830   2737   
                .expect("unable to make an HTTP request");
 9831   2738   
            ::pretty_assertions::assert_eq!(
 9832   2739   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 9833   2740   
                http_response.status()
 9834   2741   
            );
 9835   2742   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 9836   2743   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 9837   2744   
                http_response.headers(),
 9838   2745   
                expected_headers,
 9839   2746   
            ));
 9840   2747   
        }
 9841   2748   
    }
 9842         -
    /// YAML-style alternate boolean literals should result in SerializationException
 9843         -
    /// Test ID: RestJsonBodyBooleanBadLiteral_case0
        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
 9844   2752   
    #[::tokio::test]
 9845         -
    async fn rest_json_body_boolean_bad_literal_case0_malformed_request() {
        2753  +
    #[::tracing_test::traced_test]
        2754  +
    async fn rest_json_body_timestamp_date_time_rejects_different8601_formats_case4_malformed_request(
        2755  +
    ) {
 9846   2756   
        {
 9847   2757   
            #[allow(unused_mut)]
 9848   2758   
            let mut http_request = http::Request::builder()
 9849         -
                .uri("/MalformedBoolean/true")
        2759  +
                .uri("/MalformedTimestampBodyDateTime")
 9850   2760   
                .method("POST")
 9851   2761   
                .header("content-type", "application/json")
 9852   2762   
                .body(::aws_smithy_http_server::body::Body::from(
 9853         -
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : True }".as_bytes()),
        2763  +
                    ::bytes::Bytes::from_static(
        2764  +
                        "{ \"timestamp\": \"19961219T163957Z\" }".as_bytes(),
        2765  +
                    ),
 9854   2766   
                ))
 9855   2767   
                .unwrap();
 9856   2768   
            #[allow(unused_mut)]
 9857   2769   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 9858   2770   
            let config = crate::service::RestJsonConfig::builder().build();
 9859   2771   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 9860         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        2772  +
                            .malformed_timestamp_body_date_time(move |input: crate::input::MalformedTimestampBodyDateTimeInput| {
 9861   2773   
                                let sender = sender.clone();
 9862   2774   
                                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> };
        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> };
 9864   2776   
                                    sender.send(()).await.expect("receiver dropped early");
 9865   2777   
                                    result
 9866   2778   
                                }
 9867   2779   
                            })
 9868   2780   
                            .build_unchecked();
 9869   2781   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 9870   2782   
                .await
 9871   2783   
                .expect("unable to make an HTTP request");
 9872   2784   
            ::pretty_assertions::assert_eq!(
 9873   2785   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 9874   2786   
                http_response.status()
 9875   2787   
            );
 9876   2788   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 9877   2789   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 9878   2790   
                http_response.headers(),
 9879   2791   
                expected_headers,
 9880   2792   
            ));
 9881   2793   
        }
 9882   2794   
    }
 9883         -
    /// YAML-style alternate boolean literals should result in SerializationException
 9884         -
    /// Test ID: RestJsonBodyBooleanBadLiteral_case1
        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
 9885   2798   
    #[::tokio::test]
 9886         -
    async fn rest_json_body_boolean_bad_literal_case1_malformed_request() {
        2799  +
    #[::tracing_test::traced_test]
        2800  +
    async fn rest_json_body_timestamp_date_time_rejects_different8601_formats_case5_malformed_request(
        2801  +
    ) {
 9887   2802   
        {
 9888   2803   
            #[allow(unused_mut)]
 9889   2804   
            let mut http_request = http::Request::builder()
 9890         -
                .uri("/MalformedBoolean/true")
        2805  +
                .uri("/MalformedTimestampBodyDateTime")
 9891   2806   
                .method("POST")
 9892   2807   
                .header("content-type", "application/json")
 9893   2808   
                .body(::aws_smithy_http_server::body::Body::from(
 9894         -
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : TRUE }".as_bytes()),
        2809  +
                    ::bytes::Bytes::from_static(
        2810  +
                        "{ \"timestamp\": \"19961219T163957\" }".as_bytes(),
        2811  +
                    ),
 9895   2812   
                ))
 9896   2813   
                .unwrap();
 9897   2814   
            #[allow(unused_mut)]
 9898   2815   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 9899   2816   
            let config = crate::service::RestJsonConfig::builder().build();
 9900   2817   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 9901         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        2818  +
                            .malformed_timestamp_body_date_time(move |input: crate::input::MalformedTimestampBodyDateTimeInput| {
 9902   2819   
                                let sender = sender.clone();
 9903   2820   
                                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> };
        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> };
 9905   2822   
                                    sender.send(()).await.expect("receiver dropped early");
 9906   2823   
                                    result
 9907   2824   
                                }
 9908   2825   
                            })
 9909   2826   
                            .build_unchecked();
 9910   2827   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 9911   2828   
                .await
 9912   2829   
                .expect("unable to make an HTTP request");
 9913   2830   
            ::pretty_assertions::assert_eq!(
 9914   2831   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 9915   2832   
                http_response.status()
 9916   2833   
            );
 9917   2834   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 9918   2835   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 9919   2836   
                http_response.headers(),
 9920   2837   
                expected_headers,
 9921   2838   
            ));
 9922   2839   
        }
 9923   2840   
    }
 9924         -
    /// YAML-style alternate boolean literals should result in SerializationException
 9925         -
    /// Test ID: RestJsonBodyBooleanBadLiteral_case2
        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
 9926   2844   
    #[::tokio::test]
 9927         -
    async fn rest_json_body_boolean_bad_literal_case2_malformed_request() {
        2845  +
    #[::tracing_test::traced_test]
        2846  +
    async fn rest_json_body_timestamp_date_time_rejects_different8601_formats_case6_malformed_request(
        2847  +
    ) {
 9928   2848   
        {
 9929   2849   
            #[allow(unused_mut)]
 9930   2850   
            let mut http_request = http::Request::builder()
 9931         -
                .uri("/MalformedBoolean/true")
        2851  +
                .uri("/MalformedTimestampBodyDateTime")
 9932   2852   
                .method("POST")
 9933   2853   
                .header("content-type", "application/json")
 9934   2854   
                .body(::aws_smithy_http_server::body::Body::from(
 9935         -
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : y }".as_bytes()),
        2855  +
                    ::bytes::Bytes::from_static(
        2856  +
                        "{ \"timestamp\": \"19961219T16:39:57Z\" }".as_bytes(),
        2857  +
                    ),
 9936   2858   
                ))
 9937   2859   
                .unwrap();
 9938   2860   
            #[allow(unused_mut)]
 9939   2861   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 9940   2862   
            let config = crate::service::RestJsonConfig::builder().build();
 9941   2863   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 9942         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        2864  +
                            .malformed_timestamp_body_date_time(move |input: crate::input::MalformedTimestampBodyDateTimeInput| {
 9943   2865   
                                let sender = sender.clone();
 9944   2866   
                                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> };
        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> };
 9946   2868   
                                    sender.send(()).await.expect("receiver dropped early");
 9947   2869   
                                    result
 9948   2870   
                                }
 9949   2871   
                            })
 9950   2872   
                            .build_unchecked();
 9951   2873   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 9952   2874   
                .await
 9953   2875   
                .expect("unable to make an HTTP request");
 9954   2876   
            ::pretty_assertions::assert_eq!(
 9955   2877   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 9956   2878   
                http_response.status()
 9957   2879   
            );
 9958   2880   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 9959   2881   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 9960   2882   
                http_response.headers(),
 9961   2883   
                expected_headers,
 9962   2884   
            ));
 9963   2885   
        }
 9964   2886   
    }
 9965         -
    /// YAML-style alternate boolean literals should result in SerializationException
 9966         -
    /// Test ID: RestJsonBodyBooleanBadLiteral_case3
        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
 9967   2890   
    #[::tokio::test]
 9968         -
    async fn rest_json_body_boolean_bad_literal_case3_malformed_request() {
        2891  +
    #[::tracing_test::traced_test]
        2892  +
    async fn rest_json_body_timestamp_date_time_rejects_different8601_formats_case7_malformed_request(
        2893  +
    ) {
 9969   2894   
        {
 9970   2895   
            #[allow(unused_mut)]
 9971   2896   
            let mut http_request = http::Request::builder()
 9972         -
                .uri("/MalformedBoolean/true")
        2897  +
                .uri("/MalformedTimestampBodyDateTime")
 9973   2898   
                .method("POST")
 9974   2899   
                .header("content-type", "application/json")
 9975   2900   
                .body(::aws_smithy_http_server::body::Body::from(
 9976         -
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : Y }".as_bytes()),
        2901  +
                    ::bytes::Bytes::from_static(
        2902  +
                        "{ \"timestamp\": \"19961219T16:39:57\" }".as_bytes(),
        2903  +
                    ),
 9977   2904   
                ))
 9978   2905   
                .unwrap();
 9979   2906   
            #[allow(unused_mut)]
 9980   2907   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 9981   2908   
            let config = crate::service::RestJsonConfig::builder().build();
 9982   2909   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 9983         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        2910  +
                            .malformed_timestamp_body_date_time(move |input: crate::input::MalformedTimestampBodyDateTimeInput| {
 9984   2911   
                                let sender = sender.clone();
 9985   2912   
                                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> };
        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> };
 9987   2914   
                                    sender.send(()).await.expect("receiver dropped early");
 9988   2915   
                                    result
 9989   2916   
                                }
 9990   2917   
                            })
 9991   2918   
                            .build_unchecked();
 9992   2919   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 9993   2920   
                .await
 9994   2921   
                .expect("unable to make an HTTP request");
 9995   2922   
            ::pretty_assertions::assert_eq!(
 9996   2923   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 9997   2924   
                http_response.status()
 9998   2925   
            );
 9999   2926   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
10000   2927   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
10001   2928   
                http_response.headers(),
10002   2929   
                expected_headers,
10003   2930   
            ));
10004   2931   
        }
10005   2932   
    }
10006         -
    /// YAML-style alternate boolean literals should result in SerializationException
10007         -
    /// Test ID: RestJsonBodyBooleanBadLiteral_case4
        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
10008   2936   
    #[::tokio::test]
10009         -
    async fn rest_json_body_boolean_bad_literal_case4_malformed_request() {
        2937  +
    #[::tracing_test::traced_test]
        2938  +
    async fn rest_json_body_timestamp_date_time_rejects_different8601_formats_case8_malformed_request(
        2939  +
    ) {
10010   2940   
        {
10011   2941   
            #[allow(unused_mut)]
10012   2942   
            let mut http_request = http::Request::builder()
10013         -
                .uri("/MalformedBoolean/true")
        2943  +
                .uri("/MalformedTimestampBodyDateTime")
10014   2944   
                .method("POST")
10015   2945   
                .header("content-type", "application/json")
10016   2946   
                .body(::aws_smithy_http_server::body::Body::from(
10017         -
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : yes }".as_bytes()),
        2947  +
                    ::bytes::Bytes::from_static(
        2948  +
                        "{ \"timestamp\": \"1996-12-19T16:39Z\" }".as_bytes(),
        2949  +
                    ),
10018   2950   
                ))
10019   2951   
                .unwrap();
10020   2952   
            #[allow(unused_mut)]
10021   2953   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
10022   2954   
            let config = crate::service::RestJsonConfig::builder().build();
10023   2955   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
10024         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        2956  +
                            .malformed_timestamp_body_date_time(move |input: crate::input::MalformedTimestampBodyDateTimeInput| {
10025   2957   
                                let sender = sender.clone();
10026   2958   
                                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> };
        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> };
10028   2960   
                                    sender.send(()).await.expect("receiver dropped early");
10029   2961   
                                    result
10030   2962   
                                }
10031   2963   
                            })
10032   2964   
                            .build_unchecked();
10033   2965   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
10034   2966   
                .await
10035   2967   
                .expect("unable to make an HTTP request");
10036   2968   
            ::pretty_assertions::assert_eq!(
10037   2969   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
10038   2970   
                http_response.status()
10039   2971   
            );
10040   2972   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
10041   2973   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
10042   2974   
                http_response.headers(),
10043   2975   
                expected_headers,
10044   2976   
            ));
10045   2977   
        }
10046   2978   
    }
10047         -
    /// YAML-style alternate boolean literals should result in SerializationException
10048         -
    /// Test ID: RestJsonBodyBooleanBadLiteral_case5
        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
10049   2982   
    #[::tokio::test]
10050         -
    async fn rest_json_body_boolean_bad_literal_case5_malformed_request() {
        2983  +
    #[::tracing_test::traced_test]
        2984  +
    async fn rest_json_body_timestamp_date_time_rejects_different8601_formats_case9_malformed_request(
        2985  +
    ) {
10051   2986   
        {
10052   2987   
            #[allow(unused_mut)]
10053   2988   
            let mut http_request = http::Request::builder()
10054         -
                .uri("/MalformedBoolean/true")
        2989  +
                .uri("/MalformedTimestampBodyDateTime")
10055   2990   
                .method("POST")
10056   2991   
                .header("content-type", "application/json")
10057   2992   
                .body(::aws_smithy_http_server::body::Body::from(
10058         -
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : Yes }".as_bytes()),
        2993  +
                    ::bytes::Bytes::from_static(
        2994  +
                        "{ \"timestamp\": \"1996-12-19T16:39\" }".as_bytes(),
        2995  +
                    ),
10059   2996   
                ))
10060   2997   
                .unwrap();
10061   2998   
            #[allow(unused_mut)]
10062   2999   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
10063   3000   
            let config = crate::service::RestJsonConfig::builder().build();
10064   3001   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
10065         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        3002  +
                            .malformed_timestamp_body_date_time(move |input: crate::input::MalformedTimestampBodyDateTimeInput| {
10066   3003   
                                let sender = sender.clone();
10067   3004   
                                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> };
        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> };
10069   3006   
                                    sender.send(()).await.expect("receiver dropped early");
10070   3007   
                                    result
10071   3008   
                                }
10072   3009   
                            })
10073   3010   
                            .build_unchecked();
10074   3011   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
10075   3012   
                .await
10076   3013   
                .expect("unable to make an HTTP request");
10077   3014   
            ::pretty_assertions::assert_eq!(
10078   3015   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
10079   3016   
                http_response.status()
10080   3017   
            );
10081   3018   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
10082   3019   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
10083   3020   
                http_response.headers(),
10084   3021   
                expected_headers,
10085   3022   
            ));
10086   3023   
        }
10087   3024   
    }
10088         -
    /// YAML-style alternate boolean literals should result in SerializationException
10089         -
    /// Test ID: RestJsonBodyBooleanBadLiteral_case6
        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
10090   3028   
    #[::tokio::test]
10091         -
    async fn rest_json_body_boolean_bad_literal_case6_malformed_request() {
        3029  +
    #[::tracing_test::traced_test]
        3030  +
    async fn rest_json_body_timestamp_date_time_rejects_different8601_formats_case10_malformed_request(
        3031  +
    ) {
10092   3032   
        {
10093   3033   
            #[allow(unused_mut)]
10094   3034   
            let mut http_request = http::Request::builder()
10095         -
                .uri("/MalformedBoolean/true")
        3035  +
                .uri("/MalformedTimestampBodyDateTime")
10096   3036   
                .method("POST")
10097   3037   
                .header("content-type", "application/json")
10098   3038   
                .body(::aws_smithy_http_server::body::Body::from(
10099         -
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : YES }".as_bytes()),
        3039  +
                    ::bytes::Bytes::from_static(
        3040  +
                        "{ \"timestamp\": \"1996-12-19T1639\" }".as_bytes(),
        3041  +
                    ),
10100   3042   
                ))
10101   3043   
                .unwrap();
10102   3044   
            #[allow(unused_mut)]
10103   3045   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
10104   3046   
            let config = crate::service::RestJsonConfig::builder().build();
10105   3047   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
10106         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        3048  +
                            .malformed_timestamp_body_date_time(move |input: crate::input::MalformedTimestampBodyDateTimeInput| {
10107   3049   
                                let sender = sender.clone();
10108   3050   
                                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> };
        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> };
10110   3052   
                                    sender.send(()).await.expect("receiver dropped early");
10111   3053   
                                    result
10112   3054   
                                }
10113   3055   
                            })
10114   3056   
                            .build_unchecked();
10115   3057   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
10116   3058   
                .await
10117   3059   
                .expect("unable to make an HTTP request");
10118   3060   
            ::pretty_assertions::assert_eq!(
10119   3061   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
10120   3062   
                http_response.status()
10121   3063   
            );
10122   3064   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
10123   3065   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
10124   3066   
                http_response.headers(),
10125   3067   
                expected_headers,
10126   3068   
            ));
10127   3069   
        }
10128   3070   
    }
10129         -
    /// YAML-style alternate boolean literals should result in SerializationException
10130         -
    /// Test ID: RestJsonBodyBooleanBadLiteral_case7
        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
10131   3074   
    #[::tokio::test]
10132         -
    async fn rest_json_body_boolean_bad_literal_case7_malformed_request() {
        3075  +
    #[::tracing_test::traced_test]
        3076  +
    async fn rest_json_body_timestamp_date_time_rejects_different8601_formats_case11_malformed_request(
        3077  +
    ) {
10133   3078   
        {
10134   3079   
            #[allow(unused_mut)]
10135   3080   
            let mut http_request = http::Request::builder()
10136         -
                .uri("/MalformedBoolean/true")
        3081  +
                .uri("/MalformedTimestampBodyDateTime")
10137   3082   
                .method("POST")
10138   3083   
                .header("content-type", "application/json")
10139   3084   
                .body(::aws_smithy_http_server::body::Body::from(
10140         -
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : 1 }".as_bytes()),
        3085  +
                    ::bytes::Bytes::from_static("{ \"timestamp\": \"1996-12-19T16Z\" }".as_bytes()),
10141   3086   
                ))
10142   3087   
                .unwrap();
10143   3088   
            #[allow(unused_mut)]
10144   3089   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
10145   3090   
            let config = crate::service::RestJsonConfig::builder().build();
10146   3091   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
10147         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        3092  +
                            .malformed_timestamp_body_date_time(move |input: crate::input::MalformedTimestampBodyDateTimeInput| {
10148   3093   
                                let sender = sender.clone();
10149   3094   
                                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> };
        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> };
10151   3096   
                                    sender.send(()).await.expect("receiver dropped early");
10152   3097   
                                    result
10153   3098   
                                }
10154   3099   
                            })
10155   3100   
                            .build_unchecked();
10156   3101   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
10157   3102   
                .await
10158   3103   
                .expect("unable to make an HTTP request");
10159   3104   
            ::pretty_assertions::assert_eq!(
10160   3105   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
10161   3106   
                http_response.status()
10162   3107   
            );
10163   3108   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
10164   3109   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
10165   3110   
                http_response.headers(),
10166   3111   
                expected_headers,
10167   3112   
            ));
10168   3113   
        }
10169   3114   
    }
10170         -
    /// YAML-style alternate boolean literals should result in SerializationException
10171         -
    /// Test ID: RestJsonBodyBooleanBadLiteral_case8
        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
10172   3118   
    #[::tokio::test]
10173         -
    async fn rest_json_body_boolean_bad_literal_case8_malformed_request() {
        3119  +
    #[::tracing_test::traced_test]
        3120  +
    async fn rest_json_body_timestamp_date_time_rejects_different8601_formats_case12_malformed_request(
        3121  +
    ) {
10174   3122   
        {
10175   3123   
            #[allow(unused_mut)]
10176   3124   
            let mut http_request = http::Request::builder()
10177         -
                .uri("/MalformedBoolean/true")
        3125  +
                .uri("/MalformedTimestampBodyDateTime")
10178   3126   
                .method("POST")
10179   3127   
                .header("content-type", "application/json")
10180   3128   
                .body(::aws_smithy_http_server::body::Body::from(
10181         -
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : on }".as_bytes()),
        3129  +
                    ::bytes::Bytes::from_static("{ \"timestamp\": \"1996-12-19T16\" }".as_bytes()),
10182   3130   
                ))
10183   3131   
                .unwrap();
10184   3132   
            #[allow(unused_mut)]
10185   3133   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
10186   3134   
            let config = crate::service::RestJsonConfig::builder().build();
10187   3135   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
10188         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        3136  +
                            .malformed_timestamp_body_date_time(move |input: crate::input::MalformedTimestampBodyDateTimeInput| {
10189   3137   
                                let sender = sender.clone();
10190   3138   
                                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> };
        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> };
10192   3140   
                                    sender.send(()).await.expect("receiver dropped early");
10193   3141   
                                    result
10194   3142   
                                }
10195   3143   
                            })
10196   3144   
                            .build_unchecked();
10197   3145   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
10198   3146   
                .await
10199   3147   
                .expect("unable to make an HTTP request");
10200   3148   
            ::pretty_assertions::assert_eq!(
10201   3149   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
10202   3150   
                http_response.status()
10203   3151   
            );
10204   3152   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
10205   3153   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
10206   3154   
                http_response.headers(),
10207   3155   
                expected_headers,
10208   3156   
            ));
10209   3157   
        }
10210   3158   
    }
10211         -
    /// YAML-style alternate boolean literals should result in SerializationException
10212         -
    /// Test ID: RestJsonBodyBooleanBadLiteral_case9
        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
10213   3162   
    #[::tokio::test]
10214         -
    async fn rest_json_body_boolean_bad_literal_case9_malformed_request() {
        3163  +
    #[::tracing_test::traced_test]
        3164  +
    async fn rest_json_body_timestamp_date_time_rejects_different8601_formats_case13_malformed_request(
        3165  +
    ) {
10215   3166   
        {
10216   3167   
            #[allow(unused_mut)]
10217   3168   
            let mut http_request = http::Request::builder()
10218         -
                .uri("/MalformedBoolean/true")
        3169  +
                .uri("/MalformedTimestampBodyDateTime")
10219   3170   
                .method("POST")
10220   3171   
                .header("content-type", "application/json")
10221   3172   
                .body(::aws_smithy_http_server::body::Body::from(
10222         -
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : On }".as_bytes()),
        3173  +
                    ::bytes::Bytes::from_static(
        3174  +
                        "{ \"timestamp\": \"1996-12-19 16:39:57Z\" }".as_bytes(),
        3175  +
                    ),
10223   3176   
                ))
10224   3177   
                .unwrap();
10225   3178   
            #[allow(unused_mut)]
10226   3179   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
10227   3180   
            let config = crate::service::RestJsonConfig::builder().build();
10228   3181   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
10229         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        3182  +
                            .malformed_timestamp_body_date_time(move |input: crate::input::MalformedTimestampBodyDateTimeInput| {
10230   3183   
                                let sender = sender.clone();
10231   3184   
                                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> };
        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> };
10233   3186   
                                    sender.send(()).await.expect("receiver dropped early");
10234   3187   
                                    result
10235   3188   
                                }
10236   3189   
                            })
10237   3190   
                            .build_unchecked();
10238   3191   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
10239   3192   
                .await
10240   3193   
                .expect("unable to make an HTTP request");
10241   3194   
            ::pretty_assertions::assert_eq!(
10242   3195   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
10243   3196   
                http_response.status()
10244   3197   
            );
10245   3198   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
10246   3199   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
10247   3200   
                http_response.headers(),
10248   3201   
                expected_headers,
10249   3202   
            ));
10250   3203   
        }
10251   3204   
    }
10252         -
    /// YAML-style alternate boolean literals should result in SerializationException
10253         -
    /// Test ID: RestJsonBodyBooleanBadLiteral_case10
        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
10254   3208   
    #[::tokio::test]
10255         -
    async fn rest_json_body_boolean_bad_literal_case10_malformed_request() {
        3209  +
    #[::tracing_test::traced_test]
        3210  +
    async fn rest_json_body_timestamp_date_time_rejects_different8601_formats_case14_malformed_request(
        3211  +
    ) {
10256   3212   
        {
10257   3213   
            #[allow(unused_mut)]
10258   3214   
            let mut http_request = http::Request::builder()
10259         -
                .uri("/MalformedBoolean/true")
        3215  +
                .uri("/MalformedTimestampBodyDateTime")
10260   3216   
                .method("POST")
10261   3217   
                .header("content-type", "application/json")
10262   3218   
                .body(::aws_smithy_http_server::body::Body::from(
10263         -
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : ON }".as_bytes()),
        3219  +
                    ::bytes::Bytes::from_static(
        3220  +
                        "{ \"timestamp\": \"2011-12-03T10:15:30+01:00[Europe/Paris]\" }".as_bytes(),
        3221  +
                    ),
10264   3222   
                ))
10265   3223   
                .unwrap();
10266   3224   
            #[allow(unused_mut)]
10267   3225   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
10268   3226   
            let config = crate::service::RestJsonConfig::builder().build();
10269   3227   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
10270         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        3228  +
                            .malformed_timestamp_body_date_time(move |input: crate::input::MalformedTimestampBodyDateTimeInput| {
10271   3229   
                                let sender = sender.clone();
10272   3230   
                                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> };
        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> };
10274   3232   
                                    sender.send(()).await.expect("receiver dropped early");
10275   3233   
                                    result
10276   3234   
                                }
10277   3235   
                            })
10278   3236   
                            .build_unchecked();
10279   3237   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
10280   3238   
                .await
10281   3239   
                .expect("unable to make an HTTP request");
10282   3240   
            ::pretty_assertions::assert_eq!(
10283   3241   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
10284   3242   
                http_response.status()
10285   3243   
            );
10286   3244   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
10287   3245   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
10288   3246   
                http_response.headers(),
10289   3247   
                expected_headers,
10290   3248   
            ));
10291   3249   
        }
10292   3250   
    }
10293         -
    /// YAML-style alternate boolean literals should result in SerializationException
10294         -
    /// Test ID: RestJsonBodyBooleanBadLiteral_case11
        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)
        3302  +
                            .await
        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  +
        }
        3317  +
    }
        3318  +
}
        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  +
        3353  +
#[allow(unreachable_code, unused_variables)]
        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
10295   3360   
    #[::tokio::test]
10296         -
    async fn rest_json_body_boolean_bad_literal_case11_malformed_request() {
        3361  +
    #[::tracing_test::traced_test]
        3362  +
    async fn rest_json_body_timestamp_default_rejects_date_time_case0_malformed_request() {
10297   3363   
        {
10298   3364   
            #[allow(unused_mut)]
10299   3365   
            let mut http_request = http::Request::builder()
10300         -
                .uri("/MalformedBoolean/true")
        3366  +
                .uri("/MalformedTimestampBodyDefault")
10301   3367   
                .method("POST")
10302   3368   
                .header("content-type", "application/json")
10303   3369   
                .body(::aws_smithy_http_server::body::Body::from(
10304         -
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : False }".as_bytes()),
        3370  +
                    ::bytes::Bytes::from_static(
        3371  +
                        "{ \"timestamp\": \"1985-04-12T23:20:50.52Z\" }".as_bytes(),
        3372  +
                    ),
10305   3373   
                ))
10306   3374   
                .unwrap();
10307   3375   
            #[allow(unused_mut)]
10308   3376   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
10309   3377   
            let config = crate::service::RestJsonConfig::builder().build();
10310   3378   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
10311         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        3379  +
                            .malformed_timestamp_body_default(move |input: crate::input::MalformedTimestampBodyDefaultInput| {
10312   3380   
                                let sender = sender.clone();
10313   3381   
                                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> };
        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> };
10315   3383   
                                    sender.send(()).await.expect("receiver dropped early");
10316   3384   
                                    result
10317   3385   
                                }
10318   3386   
                            })
10319   3387   
                            .build_unchecked();
10320   3388   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
10321   3389   
                .await
10322   3390   
                .expect("unable to make an HTTP request");
10323   3391   
            ::pretty_assertions::assert_eq!(
10324   3392   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
10325   3393   
                http_response.status()
10326   3394   
            );
10327   3395   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
10328   3396   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
10329   3397   
                http_response.headers(),
10330   3398   
                expected_headers,
10331   3399   
            ));
10332   3400   
        }
10333   3401   
    }
10334         -
    /// YAML-style alternate boolean literals should result in SerializationException
10335         -
    /// Test ID: RestJsonBodyBooleanBadLiteral_case12
        3402  +
    /// By default, RFC3339 timestamps are rejected with a
        3403  +
    /// 400 SerializationException
        3404  +
    /// Test ID: RestJsonBodyTimestampDefaultRejectsDateTime_case1
10336   3405   
    #[::tokio::test]
10337         -
    async fn rest_json_body_boolean_bad_literal_case12_malformed_request() {
        3406  +
    #[::tracing_test::traced_test]
        3407  +
    async fn rest_json_body_timestamp_default_rejects_date_time_case1_malformed_request() {
10338   3408   
        {
10339   3409   
            #[allow(unused_mut)]
10340   3410   
            let mut http_request = http::Request::builder()
10341         -
                .uri("/MalformedBoolean/true")
        3411  +
                .uri("/MalformedTimestampBodyDefault")
10342   3412   
                .method("POST")
10343   3413   
                .header("content-type", "application/json")
10344   3414   
                .body(::aws_smithy_http_server::body::Body::from(
10345         -
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : FALSE }".as_bytes()),
        3415  +
                    ::bytes::Bytes::from_static(
        3416  +
                        "{ \"timestamp\": \"1985-04-12T23:20:50Z\" }".as_bytes(),
        3417  +
                    ),
10346   3418   
                ))
10347   3419   
                .unwrap();
10348   3420   
            #[allow(unused_mut)]
10349   3421   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
10350   3422   
            let config = crate::service::RestJsonConfig::builder().build();
10351   3423   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
10352         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        3424  +
                            .malformed_timestamp_body_default(move |input: crate::input::MalformedTimestampBodyDefaultInput| {
10353   3425   
                                let sender = sender.clone();
10354   3426   
                                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> };
        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> };
10356   3428   
                                    sender.send(()).await.expect("receiver dropped early");
10357   3429   
                                    result
10358   3430   
                                }
10359   3431   
                            })
10360   3432   
                            .build_unchecked();
10361   3433   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
10362   3434   
                .await
10363   3435   
                .expect("unable to make an HTTP request");
10364   3436   
            ::pretty_assertions::assert_eq!(
10365   3437   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
10366   3438   
                http_response.status()
10367   3439   
            );
10368   3440   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
10369   3441   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
10370   3442   
                http_response.headers(),
10371   3443   
                expected_headers,
10372   3444   
            ));
10373   3445   
        }
10374   3446   
    }
10375         -
    /// YAML-style alternate boolean literals should result in SerializationException
10376         -
    /// Test ID: RestJsonBodyBooleanBadLiteral_case13
        3447  +
    /// By default, RFC3339 timestamps are rejected with a
        3448  +
    /// 400 SerializationException
        3449  +
    /// Test ID: RestJsonBodyTimestampDefaultRejectsDateTime_case2
10377   3450   
    #[::tokio::test]
10378         -
    async fn rest_json_body_boolean_bad_literal_case13_malformed_request() {
        3451  +
    #[::tracing_test::traced_test]
        3452  +
    async fn rest_json_body_timestamp_default_rejects_date_time_case2_malformed_request() {
10379   3453   
        {
10380   3454   
            #[allow(unused_mut)]
10381   3455   
            let mut http_request = http::Request::builder()
10382         -
                .uri("/MalformedBoolean/true")
        3456  +
                .uri("/MalformedTimestampBodyDefault")
10383   3457   
                .method("POST")
10384   3458   
                .header("content-type", "application/json")
10385   3459   
                .body(::aws_smithy_http_server::body::Body::from(
10386         -
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : n }".as_bytes()),
        3460  +
                    ::bytes::Bytes::from_static(
        3461  +
                        "{ \"timestamp\": \"1996-12-19T16:39:57-08:00\" }".as_bytes(),
        3462  +
                    ),
10387   3463   
                ))
10388   3464   
                .unwrap();
10389   3465   
            #[allow(unused_mut)]
10390   3466   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
10391   3467   
            let config = crate::service::RestJsonConfig::builder().build();
10392   3468   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
10393         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        3469  +
                            .malformed_timestamp_body_default(move |input: crate::input::MalformedTimestampBodyDefaultInput| {
10394   3470   
                                let sender = sender.clone();
10395   3471   
                                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> };
        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> };
10397   3473   
                                    sender.send(()).await.expect("receiver dropped early");
10398   3474   
                                    result
10399   3475   
                                }
10400   3476   
                            })
10401   3477   
                            .build_unchecked();
10402   3478   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
10403   3479   
                .await
10404   3480   
                .expect("unable to make an HTTP request");
10405   3481   
            ::pretty_assertions::assert_eq!(
10406   3482   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
10407   3483   
                http_response.status()
10408   3484   
            );
10409   3485   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
10410   3486   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
10411   3487   
                http_response.headers(),
10412   3488   
                expected_headers,
10413   3489   
            ));
10414   3490   
        }
10415   3491   
    }
10416         -
    /// YAML-style alternate boolean literals should result in SerializationException
10417         -
    /// Test ID: RestJsonBodyBooleanBadLiteral_case14
        3492  +
    /// By default, epoch second timestamps as strings are rejected with a
        3493  +
    /// 400 SerializationException
        3494  +
    /// Test ID: RestJsonBodyTimestampDefaultRejectsStringifiedEpochSeconds_case0
10418   3495   
    #[::tokio::test]
10419         -
    async fn rest_json_body_boolean_bad_literal_case14_malformed_request() {
        3496  +
    #[::tracing_test::traced_test]
        3497  +
    async fn rest_json_body_timestamp_default_rejects_stringified_epoch_seconds_case0_malformed_request(
        3498  +
    ) {
10420   3499   
        {
10421   3500   
            #[allow(unused_mut)]
10422   3501   
            let mut http_request = http::Request::builder()
10423         -
                .uri("/MalformedBoolean/true")
        3502  +
                .uri("/MalformedTimestampBodyDefault")
10424   3503   
                .method("POST")
10425   3504   
                .header("content-type", "application/json")
10426   3505   
                .body(::aws_smithy_http_server::body::Body::from(
10427         -
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : N }".as_bytes()),
        3506  +
                    ::bytes::Bytes::from_static(
        3507  +
                        "{ \"timestamp\": \"1515531081.1234\" }".as_bytes(),
        3508  +
                    ),
10428   3509   
                ))
10429   3510   
                .unwrap();
10430   3511   
            #[allow(unused_mut)]
10431   3512   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
10432   3513   
            let config = crate::service::RestJsonConfig::builder().build();
10433   3514   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
10434         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        3515  +
                            .malformed_timestamp_body_default(move |input: crate::input::MalformedTimestampBodyDefaultInput| {
10435   3516   
                                let sender = sender.clone();
10436   3517   
                                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> };
        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> };
10438   3519   
                                    sender.send(()).await.expect("receiver dropped early");
10439   3520   
                                    result
10440   3521   
                                }
10441   3522   
                            })
10442   3523   
                            .build_unchecked();
10443   3524   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
10444   3525   
                .await
10445   3526   
                .expect("unable to make an HTTP request");
10446   3527   
            ::pretty_assertions::assert_eq!(
10447   3528   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
10448   3529   
                http_response.status()
10449   3530   
            );
10450   3531   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
10451   3532   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
10452   3533   
                http_response.headers(),
10453   3534   
                expected_headers,
10454   3535   
            ));
10455   3536   
        }
10456   3537   
    }
10457         -
    /// YAML-style alternate boolean literals should result in SerializationException
10458         -
    /// Test ID: RestJsonBodyBooleanBadLiteral_case15
        3538  +
    /// By default, epoch second timestamps as strings are rejected with a
        3539  +
    /// 400 SerializationException
        3540  +
    /// Test ID: RestJsonBodyTimestampDefaultRejectsStringifiedEpochSeconds_case1
10459   3541   
    #[::tokio::test]
10460         -
    async fn rest_json_body_boolean_bad_literal_case15_malformed_request() {
        3542  +
    #[::tracing_test::traced_test]
        3543  +
    async fn rest_json_body_timestamp_default_rejects_stringified_epoch_seconds_case1_malformed_request(
        3544  +
    ) {
10461   3545   
        {
10462   3546   
            #[allow(unused_mut)]
10463   3547   
            let mut http_request = http::Request::builder()
10464         -
                .uri("/MalformedBoolean/true")
        3548  +
                .uri("/MalformedTimestampBodyDefault")
10465   3549   
                .method("POST")
10466   3550   
                .header("content-type", "application/json")
10467   3551   
                .body(::aws_smithy_http_server::body::Body::from(
10468         -
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : no }".as_bytes()),
        3552  +
                    ::bytes::Bytes::from_static("{ \"timestamp\": \"1515531081\" }".as_bytes()),
10469   3553   
                ))
10470   3554   
                .unwrap();
10471   3555   
            #[allow(unused_mut)]
10472   3556   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
10473   3557   
            let config = crate::service::RestJsonConfig::builder().build();
10474   3558   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
10475         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        3559  +
                            .malformed_timestamp_body_default(move |input: crate::input::MalformedTimestampBodyDefaultInput| {
10476   3560   
                                let sender = sender.clone();
10477   3561   
                                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> };
        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> };
10479   3563   
                                    sender.send(()).await.expect("receiver dropped early");
10480   3564   
                                    result
10481   3565   
                                }
10482   3566   
                            })
10483   3567   
                            .build_unchecked();
10484   3568   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
10485   3569   
                .await
10486   3570   
                .expect("unable to make an HTTP request");
10487   3571   
            ::pretty_assertions::assert_eq!(
10488   3572   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
10489   3573   
                http_response.status()
10490   3574   
            );
10491   3575   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
10492   3576   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
10493   3577   
                http_response.headers(),
10494   3578   
                expected_headers,
10495   3579   
            ));
10496   3580   
        }
10497   3581   
    }
10498         -
    /// YAML-style alternate boolean literals should result in SerializationException
10499         -
    /// Test ID: RestJsonBodyBooleanBadLiteral_case16
        3582  +
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
        3583  +
    /// Test ID: RestJsonBodyTimestampDefaultRejectsMalformedEpochSeconds_case0
10500   3584   
    #[::tokio::test]
10501         -
    async fn rest_json_body_boolean_bad_literal_case16_malformed_request() {
        3585  +
    #[::tracing_test::traced_test]
        3586  +
    async fn rest_json_body_timestamp_default_rejects_malformed_epoch_seconds_case0_malformed_request(
        3587  +
    ) {
10502   3588   
        {
10503   3589   
            #[allow(unused_mut)]
10504   3590   
            let mut http_request = http::Request::builder()
10505         -
                .uri("/MalformedBoolean/true")
        3591  +
                .uri("/MalformedTimestampBodyDefault")
10506   3592   
                .method("POST")
10507   3593   
                .header("content-type", "application/json")
10508   3594   
                .body(::aws_smithy_http_server::body::Body::from(
10509         -
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : No }".as_bytes()),
        3595  +
                    ::bytes::Bytes::from_static("{ \"timestamp\": true }".as_bytes()),
10510   3596   
                ))
10511   3597   
                .unwrap();
10512   3598   
            #[allow(unused_mut)]
10513   3599   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
10514   3600   
            let config = crate::service::RestJsonConfig::builder().build();
10515   3601   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
10516         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        3602  +
                            .malformed_timestamp_body_default(move |input: crate::input::MalformedTimestampBodyDefaultInput| {
10517   3603   
                                let sender = sender.clone();
10518   3604   
                                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> };
        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> };
10520   3606   
                                    sender.send(()).await.expect("receiver dropped early");
10521   3607   
                                    result
10522   3608   
                                }
10523   3609   
                            })
10524   3610   
                            .build_unchecked();
10525   3611   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
10526   3612   
                .await
10527   3613   
                .expect("unable to make an HTTP request");
10528   3614   
            ::pretty_assertions::assert_eq!(
10529   3615   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
10530   3616   
                http_response.status()
10531   3617   
            );
10532   3618   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
10533   3619   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
10534   3620   
                http_response.headers(),
10535   3621   
                expected_headers,
10536   3622   
            ));
10537   3623   
        }
10538   3624   
    }
10539         -
    /// YAML-style alternate boolean literals should result in SerializationException
10540         -
    /// Test ID: RestJsonBodyBooleanBadLiteral_case17
        3625  +
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
        3626  +
    /// Test ID: RestJsonBodyTimestampDefaultRejectsMalformedEpochSeconds_case1
10541   3627   
    #[::tokio::test]
10542         -
    async fn rest_json_body_boolean_bad_literal_case17_malformed_request() {
        3628  +
    #[::tracing_test::traced_test]
        3629  +
    async fn rest_json_body_timestamp_default_rejects_malformed_epoch_seconds_case1_malformed_request(
        3630  +
    ) {
10543   3631   
        {
10544   3632   
            #[allow(unused_mut)]
10545   3633   
            let mut http_request = http::Request::builder()
10546         -
                .uri("/MalformedBoolean/true")
        3634  +
                .uri("/MalformedTimestampBodyDefault")
10547   3635   
                .method("POST")
10548   3636   
                .header("content-type", "application/json")
10549   3637   
                .body(::aws_smithy_http_server::body::Body::from(
10550         -
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : NO }".as_bytes()),
        3638  +
                    ::bytes::Bytes::from_static("{ \"timestamp\": 1515531081ABC }".as_bytes()),
10551   3639   
                ))
10552   3640   
                .unwrap();
10553   3641   
            #[allow(unused_mut)]
10554   3642   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
10555   3643   
            let config = crate::service::RestJsonConfig::builder().build();
10556   3644   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
10557         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        3645  +
                            .malformed_timestamp_body_default(move |input: crate::input::MalformedTimestampBodyDefaultInput| {
10558   3646   
                                let sender = sender.clone();
10559   3647   
                                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> };
        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> };
10561   3649   
                                    sender.send(()).await.expect("receiver dropped early");
10562   3650   
                                    result
10563   3651   
                                }
10564   3652   
                            })
10565   3653   
                            .build_unchecked();
10566   3654   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
10567   3655   
                .await
10568   3656   
                .expect("unable to make an HTTP request");
10569   3657   
            ::pretty_assertions::assert_eq!(
10570   3658   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
10571   3659   
                http_response.status()
10572   3660   
            );
10573   3661   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
10574   3662   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
10575   3663   
                http_response.headers(),
10576   3664   
                expected_headers,
10577   3665   
            ));
10578   3666   
        }
10579   3667   
    }
10580         -
    /// YAML-style alternate boolean literals should result in SerializationException
10581         -
    /// Test ID: RestJsonBodyBooleanBadLiteral_case18
        3668  +
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
        3669  +
    /// Test ID: RestJsonBodyTimestampDefaultRejectsMalformedEpochSeconds_case2
10582   3670   
    #[::tokio::test]
10583         -
    async fn rest_json_body_boolean_bad_literal_case18_malformed_request() {
        3671  +
    #[::tracing_test::traced_test]
        3672  +
    async fn rest_json_body_timestamp_default_rejects_malformed_epoch_seconds_case2_malformed_request(
        3673  +
    ) {
10584   3674   
        {
10585   3675   
            #[allow(unused_mut)]
10586   3676   
            let mut http_request = http::Request::builder()
10587         -
                .uri("/MalformedBoolean/true")
        3677  +
                .uri("/MalformedTimestampBodyDefault")
10588   3678   
                .method("POST")
10589   3679   
                .header("content-type", "application/json")
10590   3680   
                .body(::aws_smithy_http_server::body::Body::from(
10591         -
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : 0 }".as_bytes()),
        3681  +
                    ::bytes::Bytes::from_static("{ \"timestamp\": 0x42 }".as_bytes()),
10592   3682   
                ))
10593   3683   
                .unwrap();
10594   3684   
            #[allow(unused_mut)]
10595   3685   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
10596   3686   
            let config = crate::service::RestJsonConfig::builder().build();
10597   3687   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
10598         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        3688  +
                            .malformed_timestamp_body_default(move |input: crate::input::MalformedTimestampBodyDefaultInput| {
10599   3689   
                                let sender = sender.clone();
10600   3690   
                                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> };
        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> };
10602   3692   
                                    sender.send(()).await.expect("receiver dropped early");
10603   3693   
                                    result
10604   3694   
                                }
10605   3695   
                            })
10606   3696   
                            .build_unchecked();
10607   3697   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
10608   3698   
                .await
10609   3699   
                .expect("unable to make an HTTP request");
10610   3700   
            ::pretty_assertions::assert_eq!(
10611   3701   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
10612   3702   
                http_response.status()
10613   3703   
            );
10614   3704   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
10615   3705   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
10616   3706   
                http_response.headers(),
10617   3707   
                expected_headers,
10618   3708   
            ));
10619   3709   
        }
10620   3710   
    }
10621         -
    /// YAML-style alternate boolean literals should result in SerializationException
10622         -
    /// Test ID: RestJsonBodyBooleanBadLiteral_case19
        3711  +
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
        3712  +
    /// Test ID: RestJsonBodyTimestampDefaultRejectsMalformedEpochSeconds_case3
10623   3713   
    #[::tokio::test]
10624         -
    async fn rest_json_body_boolean_bad_literal_case19_malformed_request() {
        3714  +
    #[::tracing_test::traced_test]
        3715  +
    async fn rest_json_body_timestamp_default_rejects_malformed_epoch_seconds_case3_malformed_request(
        3716  +
    ) {
10625   3717   
        {
10626   3718   
            #[allow(unused_mut)]
10627   3719   
            let mut http_request = http::Request::builder()
10628         -
                .uri("/MalformedBoolean/true")
        3720  +
                .uri("/MalformedTimestampBodyDefault")
10629   3721   
                .method("POST")
10630   3722   
                .header("content-type", "application/json")
10631   3723   
                .body(::aws_smithy_http_server::body::Body::from(
10632         -
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : off }".as_bytes()),
        3724  +
                    ::bytes::Bytes::from_static("{ \"timestamp\": 1515531081.123.456 }".as_bytes()),
10633   3725   
                ))
10634   3726   
                .unwrap();
10635   3727   
            #[allow(unused_mut)]
10636   3728   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
10637   3729   
            let config = crate::service::RestJsonConfig::builder().build();
10638   3730   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
10639         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        3731  +
                            .malformed_timestamp_body_default(move |input: crate::input::MalformedTimestampBodyDefaultInput| {
10640   3732   
                                let sender = sender.clone();
10641   3733   
                                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> };
        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> };
10643   3735   
                                    sender.send(()).await.expect("receiver dropped early");
10644   3736   
                                    result
10645   3737   
                                }
10646   3738   
                            })
10647   3739   
                            .build_unchecked();
10648   3740   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
10649   3741   
                .await
10650   3742   
                .expect("unable to make an HTTP request");
10651   3743   
            ::pretty_assertions::assert_eq!(
10652   3744   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
10653   3745   
                http_response.status()
10654   3746   
            );
10655   3747   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
10656   3748   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
10657   3749   
                http_response.headers(),
10658   3750   
                expected_headers,
10659   3751   
            ));
10660   3752   
        }
10661   3753   
    }
10662         -
    /// YAML-style alternate boolean literals should result in SerializationException
10663         -
    /// Test ID: RestJsonBodyBooleanBadLiteral_case20
        3754  +
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
        3755  +
    /// Test ID: RestJsonBodyTimestampDefaultRejectsMalformedEpochSeconds_case4
10664   3756   
    #[::tokio::test]
10665         -
    async fn rest_json_body_boolean_bad_literal_case20_malformed_request() {
        3757  +
    #[::tracing_test::traced_test]
        3758  +
    async fn rest_json_body_timestamp_default_rejects_malformed_epoch_seconds_case4_malformed_request(
        3759  +
    ) {
10666   3760   
        {
10667   3761   
            #[allow(unused_mut)]
10668   3762   
            let mut http_request = http::Request::builder()
10669         -
                .uri("/MalformedBoolean/true")
        3763  +
                .uri("/MalformedTimestampBodyDefault")
10670   3764   
                .method("POST")
10671   3765   
                .header("content-type", "application/json")
10672   3766   
                .body(::aws_smithy_http_server::body::Body::from(
10673         -
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : Off }".as_bytes()),
        3767  +
                    ::bytes::Bytes::from_static("{ \"timestamp\": Infinity }".as_bytes()),
10674   3768   
                ))
10675   3769   
                .unwrap();
10676   3770   
            #[allow(unused_mut)]
10677   3771   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
10678   3772   
            let config = crate::service::RestJsonConfig::builder().build();
10679   3773   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
10680         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        3774  +
                            .malformed_timestamp_body_default(move |input: crate::input::MalformedTimestampBodyDefaultInput| {
10681   3775   
                                let sender = sender.clone();
10682   3776   
                                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> };
        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> };
10684   3778   
                                    sender.send(()).await.expect("receiver dropped early");
10685   3779   
                                    result
10686   3780   
                                }
10687   3781   
                            })
10688   3782   
                            .build_unchecked();
10689   3783   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
10690   3784   
                .await
10691   3785   
                .expect("unable to make an HTTP request");
10692   3786   
            ::pretty_assertions::assert_eq!(
10693   3787   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
10694   3788   
                http_response.status()
10695   3789   
            );
10696   3790   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
10697   3791   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
10698   3792   
                http_response.headers(),
10699   3793   
                expected_headers,
10700   3794   
            ));
10701   3795   
        }
10702   3796   
    }
10703         -
    /// YAML-style alternate boolean literals should result in SerializationException
10704         -
    /// Test ID: RestJsonBodyBooleanBadLiteral_case21
        3797  +
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
        3798  +
    /// Test ID: RestJsonBodyTimestampDefaultRejectsMalformedEpochSeconds_case5
10705   3799   
    #[::tokio::test]
10706         -
    async fn rest_json_body_boolean_bad_literal_case21_malformed_request() {
        3800  +
    #[::tracing_test::traced_test]
        3801  +
    async fn rest_json_body_timestamp_default_rejects_malformed_epoch_seconds_case5_malformed_request(
        3802  +
    ) {
10707   3803   
        {
10708   3804   
            #[allow(unused_mut)]
10709   3805   
            let mut http_request = http::Request::builder()
10710         -
                .uri("/MalformedBoolean/true")
        3806  +
                .uri("/MalformedTimestampBodyDefault")
10711   3807   
                .method("POST")
10712   3808   
                .header("content-type", "application/json")
10713   3809   
                .body(::aws_smithy_http_server::body::Body::from(
10714         -
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : OFF }".as_bytes()),
        3810  +
                    ::bytes::Bytes::from_static("{ \"timestamp\": \"Infinity\" }".as_bytes()),
10715   3811   
                ))
10716   3812   
                .unwrap();
10717   3813   
            #[allow(unused_mut)]
10718   3814   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
10719   3815   
            let config = crate::service::RestJsonConfig::builder().build();
10720   3816   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
10721         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        3817  +
                            .malformed_timestamp_body_default(move |input: crate::input::MalformedTimestampBodyDefaultInput| {
10722   3818   
                                let sender = sender.clone();
10723   3819   
                                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> };
        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> };
10725   3821   
                                    sender.send(()).await.expect("receiver dropped early");
10726   3822   
                                    result
10727   3823   
                                }
10728   3824   
                            })
10729   3825   
                            .build_unchecked();
10730   3826   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
10731   3827   
                .await
10732   3828   
                .expect("unable to make an HTTP request");
10733   3829   
            ::pretty_assertions::assert_eq!(
10734   3830   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
10735   3831   
                http_response.status()
10736   3832   
            );
10737   3833   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
10738   3834   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
10739   3835   
                http_response.headers(),
10740   3836   
                expected_headers,
10741   3837   
            ));
10742   3838   
        }
10743   3839   
    }
10744         -
    /// Attempted string coercion should result in SerializationException
10745         -
    /// Test ID: RestJsonPathBooleanStringCoercion_case0
        3840  +
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
        3841  +
    /// Test ID: RestJsonBodyTimestampDefaultRejectsMalformedEpochSeconds_case6
10746   3842   
    #[::tokio::test]
10747         -
    async fn rest_json_path_boolean_string_coercion_case0_malformed_request() {
        3843  +
    #[::tracing_test::traced_test]
        3844  +
    async fn rest_json_body_timestamp_default_rejects_malformed_epoch_seconds_case6_malformed_request(
        3845  +
    ) {
10748   3846   
        {
10749   3847   
            #[allow(unused_mut)]
10750   3848   
            let mut http_request = http::Request::builder()
10751         -
                .uri("/MalformedBoolean/True")
        3849  +
                .uri("/MalformedTimestampBodyDefault")
10752   3850   
                .method("POST")
10753         -
                .body(::aws_smithy_http_server::body::Body::empty())
        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  +
                ))
10754   3855   
                .unwrap();
10755   3856   
            #[allow(unused_mut)]
10756   3857   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
10757   3858   
            let config = crate::service::RestJsonConfig::builder().build();
10758   3859   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
10759         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        3860  +
                            .malformed_timestamp_body_default(move |input: crate::input::MalformedTimestampBodyDefaultInput| {
10760   3861   
                                let sender = sender.clone();
10761   3862   
                                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> };
        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> };
10763   3864   
                                    sender.send(()).await.expect("receiver dropped early");
10764   3865   
                                    result
10765   3866   
                                }
10766   3867   
                            })
10767   3868   
                            .build_unchecked();
10768   3869   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
10769   3870   
                .await
10770   3871   
                .expect("unable to make an HTTP request");
10771   3872   
            ::pretty_assertions::assert_eq!(
10772   3873   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
10773   3874   
                http_response.status()
10774   3875   
            );
10775   3876   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
10776   3877   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
10777   3878   
                http_response.headers(),
10778   3879   
                expected_headers,
10779   3880   
            ));
10780   3881   
        }
10781   3882   
    }
10782         -
    /// Attempted string coercion should result in SerializationException
10783         -
    /// Test ID: RestJsonPathBooleanStringCoercion_case1
        3883  +
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
        3884  +
    /// Test ID: RestJsonBodyTimestampDefaultRejectsMalformedEpochSeconds_case7
10784   3885   
    #[::tokio::test]
10785         -
    async fn rest_json_path_boolean_string_coercion_case1_malformed_request() {
        3886  +
    #[::tracing_test::traced_test]
        3887  +
    async fn rest_json_body_timestamp_default_rejects_malformed_epoch_seconds_case7_malformed_request(
        3888  +
    ) {
10786   3889   
        {
10787   3890   
            #[allow(unused_mut)]
10788   3891   
            let mut http_request = http::Request::builder()
10789         -
                .uri("/MalformedBoolean/TRUE")
        3892  +
                .uri("/MalformedTimestampBodyDefault")
10790   3893   
                .method("POST")
10791         -
                .body(::aws_smithy_http_server::body::Body::empty())
        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  +
                ))
10792   3898   
                .unwrap();
10793   3899   
            #[allow(unused_mut)]
10794   3900   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
10795   3901   
            let config = crate::service::RestJsonConfig::builder().build();
10796   3902   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
10797         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        3903  +
                            .malformed_timestamp_body_default(move |input: crate::input::MalformedTimestampBodyDefaultInput| {
10798   3904   
                                let sender = sender.clone();
10799   3905   
                                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> };
        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> };
10801   3907   
                                    sender.send(()).await.expect("receiver dropped early");
10802   3908   
                                    result
10803   3909   
                                }
10804   3910   
                            })
10805   3911   
                            .build_unchecked();
10806   3912   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
10807   3913   
                .await
10808   3914   
                .expect("unable to make an HTTP request");
10809   3915   
            ::pretty_assertions::assert_eq!(
10810   3916   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
10811   3917   
                http_response.status()
10812   3918   
            );
10813   3919   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
10814   3920   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
10815   3921   
                http_response.headers(),
10816   3922   
                expected_headers,
10817   3923   
            ));
10818   3924   
        }
10819   3925   
    }
10820         -
    /// Attempted string coercion should result in SerializationException
10821         -
    /// Test ID: RestJsonPathBooleanStringCoercion_case2
        3926  +
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
        3927  +
    /// Test ID: RestJsonBodyTimestampDefaultRejectsMalformedEpochSeconds_case8
10822   3928   
    #[::tokio::test]
10823         -
    async fn rest_json_path_boolean_string_coercion_case2_malformed_request() {
        3929  +
    #[::tracing_test::traced_test]
        3930  +
    async fn rest_json_body_timestamp_default_rejects_malformed_epoch_seconds_case8_malformed_request(
        3931  +
    ) {
10824   3932   
        {
10825   3933   
            #[allow(unused_mut)]
10826   3934   
            let mut http_request = http::Request::builder()
10827         -
                .uri("/MalformedBoolean/y")
        3935  +
                .uri("/MalformedTimestampBodyDefault")
10828   3936   
                .method("POST")
10829         -
                .body(::aws_smithy_http_server::body::Body::empty())
        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  +
                ))
10830   3941   
                .unwrap();
10831   3942   
            #[allow(unused_mut)]
10832   3943   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
10833   3944   
            let config = crate::service::RestJsonConfig::builder().build();
10834   3945   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
10835         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        3946  +
                            .malformed_timestamp_body_default(move |input: crate::input::MalformedTimestampBodyDefaultInput| {
10836   3947   
                                let sender = sender.clone();
10837   3948   
                                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> };
        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> };
10839   3950   
                                    sender.send(()).await.expect("receiver dropped early");
10840   3951   
                                    result
10841   3952   
                                }
10842   3953   
                            })
10843   3954   
                            .build_unchecked();
10844   3955   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
10845   3956   
                .await
10846   3957   
                .expect("unable to make an HTTP request");
10847   3958   
            ::pretty_assertions::assert_eq!(
10848   3959   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
10849   3960   
                http_response.status()
10850   3961   
            );
10851   3962   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
10852   3963   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
10853   3964   
                http_response.headers(),
10854   3965   
                expected_headers,
10855   3966   
            ));
10856   3967   
        }
10857   3968   
    }
10858         -
    /// Attempted string coercion should result in SerializationException
10859         -
    /// Test ID: RestJsonPathBooleanStringCoercion_case3
        3969  +
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
        3970  +
    /// Test ID: RestJsonBodyTimestampDefaultRejectsMalformedEpochSeconds_case9
10860   3971   
    #[::tokio::test]
10861         -
    async fn rest_json_path_boolean_string_coercion_case3_malformed_request() {
        3972  +
    #[::tracing_test::traced_test]
        3973  +
    async fn rest_json_body_timestamp_default_rejects_malformed_epoch_seconds_case9_malformed_request(
        3974  +
    ) {
10862   3975   
        {
10863   3976   
            #[allow(unused_mut)]
10864   3977   
            let mut http_request = http::Request::builder()
10865         -
                .uri("/MalformedBoolean/Y")
        3978  +
                .uri("/MalformedTimestampBodyDefault")
10866   3979   
                .method("POST")
10867         -
                .body(::aws_smithy_http_server::body::Body::empty())
        3980  +
                .header("content-type", "application/json")
        3981  +
                .body(::aws_smithy_http_server::body::Body::from(
        3982  +
                    ::bytes::Bytes::from_static("{ \"timestamp\": \"NaN\" }".as_bytes()),
        3983  +
                ))
10868   3984   
                .unwrap();
10869   3985   
            #[allow(unused_mut)]
10870   3986   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
10871   3987   
            let config = crate::service::RestJsonConfig::builder().build();
10872   3988   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
10873         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        3989  +
                            .malformed_timestamp_body_default(move |input: crate::input::MalformedTimestampBodyDefaultInput| {
10874   3990   
                                let sender = sender.clone();
10875   3991   
                                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> };
        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> };
10877   3993   
                                    sender.send(()).await.expect("receiver dropped early");
10878   3994   
                                    result
10879   3995   
                                }
10880   3996   
                            })
10881   3997   
                            .build_unchecked();
10882   3998   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
10883   3999   
                .await
10884   4000   
                .expect("unable to make an HTTP request");
10885   4001   
            ::pretty_assertions::assert_eq!(
10886   4002   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
10887   4003   
                http_response.status()
10888   4004   
            );
10889   4005   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
10890   4006   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
10891   4007   
                http_response.headers(),
10892   4008   
                expected_headers,
10893   4009   
            ));
10894   4010   
        }
10895   4011   
    }
10896         -
    /// Attempted string coercion should result in SerializationException
10897         -
    /// Test ID: RestJsonPathBooleanStringCoercion_case4
        4012  +
    /// By default, IMF-fixdate timestamps are rejected with a
        4013  +
    /// 400 SerializationException
        4014  +
    /// Test ID: RestJsonBodyTimestampDefaultRejectsHttpDate_case0
10898   4015   
    #[::tokio::test]
10899         -
    async fn rest_json_path_boolean_string_coercion_case4_malformed_request() {
        4016  +
    #[::tracing_test::traced_test]
        4017  +
    async fn rest_json_body_timestamp_default_rejects_http_date_case0_malformed_request() {
10900   4018   
        {
10901   4019   
            #[allow(unused_mut)]
10902   4020   
            let mut http_request = http::Request::builder()
10903         -
                .uri("/MalformedBoolean/yes")
        4021  +
                .uri("/MalformedTimestampBodyDefault")
10904   4022   
                .method("POST")
10905         -
                .body(::aws_smithy_http_server::body::Body::empty())
        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  +
                ))
10906   4029   
                .unwrap();
10907   4030   
            #[allow(unused_mut)]
10908   4031   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
10909   4032   
            let config = crate::service::RestJsonConfig::builder().build();
10910   4033   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
10911         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        4034  +
                            .malformed_timestamp_body_default(move |input: crate::input::MalformedTimestampBodyDefaultInput| {
10912   4035   
                                let sender = sender.clone();
10913   4036   
                                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> };
        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> };
10915   4038   
                                    sender.send(()).await.expect("receiver dropped early");
10916   4039   
                                    result
10917   4040   
                                }
10918   4041   
                            })
10919   4042   
                            .build_unchecked();
10920   4043   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
10921   4044   
                .await
10922   4045   
                .expect("unable to make an HTTP request");
10923   4046   
            ::pretty_assertions::assert_eq!(
10924   4047   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
10925   4048   
                http_response.status()
10926   4049   
            );
10927   4050   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
10928   4051   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
10929   4052   
                http_response.headers(),
10930   4053   
                expected_headers,
10931   4054   
            ));
10932   4055   
        }
10933   4056   
    }
10934         -
    /// Attempted string coercion should result in SerializationException
10935         -
    /// Test ID: RestJsonPathBooleanStringCoercion_case5
        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)
        4108  +
                            .await
        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  +
            },
        4119  +
        );
        4120  +
        MalformedTimestampHeaderEpochInputFuture {
        4121  +
            inner: Box::pin(fut),
        4122  +
        }
        4123  +
    }
        4124  +
}
        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  +
        4159  +
#[allow(unreachable_code, unused_variables)]
        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
10936   4166   
    #[::tokio::test]
10937         -
    async fn rest_json_path_boolean_string_coercion_case5_malformed_request() {
        4167  +
    #[::tracing_test::traced_test]
        4168  +
    async fn rest_json_header_timestamp_epoch_rejects_date_time_case0_malformed_request() {
10938   4169   
        {
10939   4170   
            #[allow(unused_mut)]
10940   4171   
            let mut http_request = http::Request::builder()
10941         -
                .uri("/MalformedBoolean/Yes")
        4172  +
                .uri("/MalformedTimestampHeaderEpoch")
10942   4173   
                .method("POST")
        4174  +
                .header("timestamp", "1985-04-12T23:20:50.52Z")
10943   4175   
                .body(::aws_smithy_http_server::body::Body::empty())
10944   4176   
                .unwrap();
10945   4177   
            #[allow(unused_mut)]
10946   4178   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
10947   4179   
            let config = crate::service::RestJsonConfig::builder().build();
10948   4180   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
10949         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        4181  +
                            .malformed_timestamp_header_epoch(move |input: crate::input::MalformedTimestampHeaderEpochInput| {
10950   4182   
                                let sender = sender.clone();
10951   4183   
                                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> };
        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> };
10953   4185   
                                    sender.send(()).await.expect("receiver dropped early");
10954   4186   
                                    result
10955   4187   
                                }
10956   4188   
                            })
10957   4189   
                            .build_unchecked();
10958   4190   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
10959   4191   
                .await
10960   4192   
                .expect("unable to make an HTTP request");
10961   4193   
            ::pretty_assertions::assert_eq!(
10962   4194   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
10963   4195   
                http_response.status()
10964   4196   
            );
10965   4197   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
10966   4198   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
10967   4199   
                http_response.headers(),
10968   4200   
                expected_headers,
10969   4201   
            ));
10970   4202   
        }
10971   4203   
    }
10972         -
    /// Attempted string coercion should result in SerializationException
10973         -
    /// Test ID: RestJsonPathBooleanStringCoercion_case6
        4204  +
    /// When the format is epoch-seconds, RFC3339 timestamps are rejected with a
        4205  +
    /// 400 SerializationException
        4206  +
    /// Test ID: RestJsonHeaderTimestampEpochRejectsDateTime_case1
10974   4207   
    #[::tokio::test]
10975         -
    async fn rest_json_path_boolean_string_coercion_case6_malformed_request() {
        4208  +
    #[::tracing_test::traced_test]
        4209  +
    async fn rest_json_header_timestamp_epoch_rejects_date_time_case1_malformed_request() {
10976   4210   
        {
10977   4211   
            #[allow(unused_mut)]
10978   4212   
            let mut http_request = http::Request::builder()
10979         -
                .uri("/MalformedBoolean/YES")
        4213  +
                .uri("/MalformedTimestampHeaderEpoch")
10980   4214   
                .method("POST")
        4215  +
                .header("timestamp", "1985-04-12T23:20:50Z")
10981   4216   
                .body(::aws_smithy_http_server::body::Body::empty())
10982   4217   
                .unwrap();
10983   4218   
            #[allow(unused_mut)]
10984   4219   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
10985   4220   
            let config = crate::service::RestJsonConfig::builder().build();
10986   4221   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
10987         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        4222  +
                            .malformed_timestamp_header_epoch(move |input: crate::input::MalformedTimestampHeaderEpochInput| {
10988   4223   
                                let sender = sender.clone();
10989   4224   
                                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> };
        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> };
10991   4226   
                                    sender.send(()).await.expect("receiver dropped early");
10992   4227   
                                    result
10993   4228   
                                }
10994   4229   
                            })
10995   4230   
                            .build_unchecked();
10996   4231   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
10997   4232   
                .await
10998   4233   
                .expect("unable to make an HTTP request");
10999   4234   
            ::pretty_assertions::assert_eq!(
11000   4235   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
11001   4236   
                http_response.status()
11002   4237   
            );
11003   4238   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
11004   4239   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
11005   4240   
                http_response.headers(),
11006   4241   
                expected_headers,
11007   4242   
            ));
11008   4243   
        }
11009   4244   
    }
11010         -
    /// Attempted string coercion should result in SerializationException
11011         -
    /// Test ID: RestJsonPathBooleanStringCoercion_case7
        4245  +
    /// When the format is epoch-seconds, RFC3339 timestamps are rejected with a
        4246  +
    /// 400 SerializationException
        4247  +
    /// Test ID: RestJsonHeaderTimestampEpochRejectsDateTime_case2
11012   4248   
    #[::tokio::test]
11013         -
    async fn rest_json_path_boolean_string_coercion_case7_malformed_request() {
        4249  +
    #[::tracing_test::traced_test]
        4250  +
    async fn rest_json_header_timestamp_epoch_rejects_date_time_case2_malformed_request() {
11014   4251   
        {
11015   4252   
            #[allow(unused_mut)]
11016   4253   
            let mut http_request = http::Request::builder()
11017         -
                .uri("/MalformedBoolean/1")
        4254  +
                .uri("/MalformedTimestampHeaderEpoch")
11018   4255   
                .method("POST")
        4256  +
                .header("timestamp", "1996-12-19T16:39:57-08:00")
11019   4257   
                .body(::aws_smithy_http_server::body::Body::empty())
11020   4258   
                .unwrap();
11021   4259   
            #[allow(unused_mut)]
11022   4260   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
11023   4261   
            let config = crate::service::RestJsonConfig::builder().build();
11024   4262   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
11025         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        4263  +
                            .malformed_timestamp_header_epoch(move |input: crate::input::MalformedTimestampHeaderEpochInput| {
11026   4264   
                                let sender = sender.clone();
11027   4265   
                                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> };
        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> };
11029   4267   
                                    sender.send(()).await.expect("receiver dropped early");
11030   4268   
                                    result
11031   4269   
                                }
11032   4270   
                            })
11033   4271   
                            .build_unchecked();
11034   4272   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
11035   4273   
                .await
11036   4274   
                .expect("unable to make an HTTP request");
11037   4275   
            ::pretty_assertions::assert_eq!(
11038   4276   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
11039   4277   
                http_response.status()
11040   4278   
            );
11041   4279   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
11042   4280   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
11043   4281   
                http_response.headers(),
11044   4282   
                expected_headers,
11045   4283   
            ));
11046   4284   
        }
11047   4285   
    }
11048         -
    /// Attempted string coercion should result in SerializationException
11049         -
    /// Test ID: RestJsonPathBooleanStringCoercion_case8
        4286  +
    /// When the format is epoch-seconds, IMF-fixdate timestamps are rejected with a
        4287  +
    /// 400 SerializationException
        4288  +
    /// Test ID: RestJsonHeaderTimestampEpochRejectsHttpDate_case0
11050   4289   
    #[::tokio::test]
11051         -
    async fn rest_json_path_boolean_string_coercion_case8_malformed_request() {
        4290  +
    #[::tracing_test::traced_test]
        4291  +
    async fn rest_json_header_timestamp_epoch_rejects_http_date_case0_malformed_request() {
11052   4292   
        {
11053   4293   
            #[allow(unused_mut)]
11054   4294   
            let mut http_request = http::Request::builder()
11055         -
                .uri("/MalformedBoolean/on")
        4295  +
                .uri("/MalformedTimestampHeaderEpoch")
11056   4296   
                .method("POST")
        4297  +
                .header("timestamp", "Tue, 29 Apr 2014 18:30:38 GMT")
11057   4298   
                .body(::aws_smithy_http_server::body::Body::empty())
11058   4299   
                .unwrap();
11059   4300   
            #[allow(unused_mut)]
11060   4301   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
11061   4302   
            let config = crate::service::RestJsonConfig::builder().build();
11062   4303   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
11063         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        4304  +
                            .malformed_timestamp_header_epoch(move |input: crate::input::MalformedTimestampHeaderEpochInput| {
11064   4305   
                                let sender = sender.clone();
11065   4306   
                                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> };
        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> };
11067   4308   
                                    sender.send(()).await.expect("receiver dropped early");
11068   4309   
                                    result
11069   4310   
                                }
11070   4311   
                            })
11071   4312   
                            .build_unchecked();
11072   4313   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
11073   4314   
                .await
11074   4315   
                .expect("unable to make an HTTP request");
11075   4316   
            ::pretty_assertions::assert_eq!(
11076   4317   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
11077   4318   
                http_response.status()
11078   4319   
            );
11079   4320   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
11080   4321   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
11081   4322   
                http_response.headers(),
11082   4323   
                expected_headers,
11083   4324   
            ));
11084   4325   
        }
11085   4326   
    }
11086         -
    /// Attempted string coercion should result in SerializationException
11087         -
    /// Test ID: RestJsonPathBooleanStringCoercion_case9
        4327  +
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
        4328  +
    /// Test ID: RestJsonHeaderTimestampEpochRejectsMalformedValues_case0
11088   4329   
    #[::tokio::test]
11089         -
    async fn rest_json_path_boolean_string_coercion_case9_malformed_request() {
        4330  +
    #[::tracing_test::traced_test]
        4331  +
    async fn rest_json_header_timestamp_epoch_rejects_malformed_values_case0_malformed_request() {
11090   4332   
        {
11091   4333   
            #[allow(unused_mut)]
11092   4334   
            let mut http_request = http::Request::builder()
11093         -
                .uri("/MalformedBoolean/On")
        4335  +
                .uri("/MalformedTimestampHeaderEpoch")
11094   4336   
                .method("POST")
        4337  +
                .header("timestamp", "true")
11095   4338   
                .body(::aws_smithy_http_server::body::Body::empty())
11096   4339   
                .unwrap();
11097   4340   
            #[allow(unused_mut)]
11098   4341   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
11099   4342   
            let config = crate::service::RestJsonConfig::builder().build();
11100   4343   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
11101         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        4344  +
                            .malformed_timestamp_header_epoch(move |input: crate::input::MalformedTimestampHeaderEpochInput| {
11102   4345   
                                let sender = sender.clone();
11103   4346   
                                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> };
        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> };
11105   4348   
                                    sender.send(()).await.expect("receiver dropped early");
11106   4349   
                                    result
11107   4350   
                                }
11108   4351   
                            })
11109   4352   
                            .build_unchecked();
11110   4353   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
11111   4354   
                .await
11112   4355   
                .expect("unable to make an HTTP request");
11113   4356   
            ::pretty_assertions::assert_eq!(
11114   4357   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
11115   4358   
                http_response.status()
11116   4359   
            );
11117   4360   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
11118   4361   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
11119   4362   
                http_response.headers(),
11120   4363   
                expected_headers,
11121   4364   
            ));
11122   4365   
        }
11123   4366   
    }
11124         -
    /// Attempted string coercion should result in SerializationException
11125         -
    /// Test ID: RestJsonPathBooleanStringCoercion_case10
        4367  +
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
        4368  +
    /// Test ID: RestJsonHeaderTimestampEpochRejectsMalformedValues_case1
11126   4369   
    #[::tokio::test]
11127         -
    async fn rest_json_path_boolean_string_coercion_case10_malformed_request() {
        4370  +
    #[::tracing_test::traced_test]
        4371  +
    async fn rest_json_header_timestamp_epoch_rejects_malformed_values_case1_malformed_request() {
11128   4372   
        {
11129   4373   
            #[allow(unused_mut)]
11130   4374   
            let mut http_request = http::Request::builder()
11131         -
                .uri("/MalformedBoolean/ON")
        4375  +
                .uri("/MalformedTimestampHeaderEpoch")
11132   4376   
                .method("POST")
        4377  +
                .header("timestamp", "1515531081ABC")
11133   4378   
                .body(::aws_smithy_http_server::body::Body::empty())
11134   4379   
                .unwrap();
11135   4380   
            #[allow(unused_mut)]
11136   4381   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
11137   4382   
            let config = crate::service::RestJsonConfig::builder().build();
11138   4383   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
11139         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        4384  +
                            .malformed_timestamp_header_epoch(move |input: crate::input::MalformedTimestampHeaderEpochInput| {
11140   4385   
                                let sender = sender.clone();
11141   4386   
                                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> };
        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> };
11143   4388   
                                    sender.send(()).await.expect("receiver dropped early");
11144   4389   
                                    result
11145   4390   
                                }
11146   4391   
                            })
11147   4392   
                            .build_unchecked();
11148   4393   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
11149   4394   
                .await
11150   4395   
                .expect("unable to make an HTTP request");
11151   4396   
            ::pretty_assertions::assert_eq!(
11152   4397   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
11153   4398   
                http_response.status()
11154   4399   
            );
11155   4400   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
11156   4401   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
11157   4402   
                http_response.headers(),
11158   4403   
                expected_headers,
11159   4404   
            ));
11160   4405   
        }
11161   4406   
    }
11162         -
    /// Attempted string coercion should result in SerializationException
11163         -
    /// Test ID: RestJsonPathBooleanStringCoercion_case11
        4407  +
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
        4408  +
    /// Test ID: RestJsonHeaderTimestampEpochRejectsMalformedValues_case2
11164   4409   
    #[::tokio::test]
11165         -
    async fn rest_json_path_boolean_string_coercion_case11_malformed_request() {
        4410  +
    #[::tracing_test::traced_test]
        4411  +
    async fn rest_json_header_timestamp_epoch_rejects_malformed_values_case2_malformed_request() {
11166   4412   
        {
11167   4413   
            #[allow(unused_mut)]
11168   4414   
            let mut http_request = http::Request::builder()
11169         -
                .uri("/MalformedBoolean/False")
        4415  +
                .uri("/MalformedTimestampHeaderEpoch")
11170   4416   
                .method("POST")
        4417  +
                .header("timestamp", "0x42")
11171   4418   
                .body(::aws_smithy_http_server::body::Body::empty())
11172   4419   
                .unwrap();
11173   4420   
            #[allow(unused_mut)]
11174   4421   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
11175   4422   
            let config = crate::service::RestJsonConfig::builder().build();
11176   4423   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
11177         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        4424  +
                            .malformed_timestamp_header_epoch(move |input: crate::input::MalformedTimestampHeaderEpochInput| {
11178   4425   
                                let sender = sender.clone();
11179   4426   
                                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> };
        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> };
11181   4428   
                                    sender.send(()).await.expect("receiver dropped early");
11182   4429   
                                    result
11183   4430   
                                }
11184   4431   
                            })
11185   4432   
                            .build_unchecked();
11186   4433   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
11187   4434   
                .await
11188   4435   
                .expect("unable to make an HTTP request");
11189   4436   
            ::pretty_assertions::assert_eq!(
11190   4437   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
11191   4438   
                http_response.status()
11192   4439   
            );
11193   4440   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
11194   4441   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
11195   4442   
                http_response.headers(),
11196   4443   
                expected_headers,
11197   4444   
            ));
11198   4445   
        }
11199   4446   
    }
11200         -
    /// Attempted string coercion should result in SerializationException
11201         -
    /// Test ID: RestJsonPathBooleanStringCoercion_case12
        4447  +
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
        4448  +
    /// Test ID: RestJsonHeaderTimestampEpochRejectsMalformedValues_case3
11202   4449   
    #[::tokio::test]
11203         -
    async fn rest_json_path_boolean_string_coercion_case12_malformed_request() {
        4450  +
    #[::tracing_test::traced_test]
        4451  +
    async fn rest_json_header_timestamp_epoch_rejects_malformed_values_case3_malformed_request() {
11204   4452   
        {
11205   4453   
            #[allow(unused_mut)]
11206   4454   
            let mut http_request = http::Request::builder()
11207         -
                .uri("/MalformedBoolean/FALSE")
        4455  +
                .uri("/MalformedTimestampHeaderEpoch")
11208   4456   
                .method("POST")
        4457  +
                .header("timestamp", "1515531081.123.456")
11209   4458   
                .body(::aws_smithy_http_server::body::Body::empty())
11210   4459   
                .unwrap();
11211   4460   
            #[allow(unused_mut)]
11212   4461   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
11213   4462   
            let config = crate::service::RestJsonConfig::builder().build();
11214   4463   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
11215         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        4464  +
                            .malformed_timestamp_header_epoch(move |input: crate::input::MalformedTimestampHeaderEpochInput| {
11216   4465   
                                let sender = sender.clone();
11217   4466   
                                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> };
        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> };
11219   4468   
                                    sender.send(()).await.expect("receiver dropped early");
11220   4469   
                                    result
11221   4470   
                                }
11222   4471   
                            })
11223   4472   
                            .build_unchecked();
11224   4473   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
11225   4474   
                .await
11226   4475   
                .expect("unable to make an HTTP request");
11227   4476   
            ::pretty_assertions::assert_eq!(
11228   4477   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
11229   4478   
                http_response.status()
11230   4479   
            );
11231   4480   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
11232   4481   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
11233   4482   
                http_response.headers(),
11234   4483   
                expected_headers,
11235   4484   
            ));
11236   4485   
        }
11237   4486   
    }
11238         -
    /// Attempted string coercion should result in SerializationException
11239         -
    /// Test ID: RestJsonPathBooleanStringCoercion_case13
        4487  +
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
        4488  +
    /// Test ID: RestJsonHeaderTimestampEpochRejectsMalformedValues_case4
11240   4489   
    #[::tokio::test]
11241         -
    async fn rest_json_path_boolean_string_coercion_case13_malformed_request() {
        4490  +
    #[::tracing_test::traced_test]
        4491  +
    async fn rest_json_header_timestamp_epoch_rejects_malformed_values_case4_malformed_request() {
11242   4492   
        {
11243   4493   
            #[allow(unused_mut)]
11244   4494   
            let mut http_request = http::Request::builder()
11245         -
                .uri("/MalformedBoolean/n")
        4495  +
                .uri("/MalformedTimestampHeaderEpoch")
11246   4496   
                .method("POST")
        4497  +
                .header("timestamp", "Infinity")
11247   4498   
                .body(::aws_smithy_http_server::body::Body::empty())
11248   4499   
                .unwrap();
11249   4500   
            #[allow(unused_mut)]
11250   4501   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
11251   4502   
            let config = crate::service::RestJsonConfig::builder().build();
11252   4503   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
11253         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        4504  +
                            .malformed_timestamp_header_epoch(move |input: crate::input::MalformedTimestampHeaderEpochInput| {
11254   4505   
                                let sender = sender.clone();
11255   4506   
                                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> };
        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> };
11257   4508   
                                    sender.send(()).await.expect("receiver dropped early");
11258   4509   
                                    result
11259   4510   
                                }
11260   4511   
                            })
11261   4512   
                            .build_unchecked();
11262   4513   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
11263   4514   
                .await
11264   4515   
                .expect("unable to make an HTTP request");
11265   4516   
            ::pretty_assertions::assert_eq!(
11266   4517   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
11267   4518   
                http_response.status()
11268   4519   
            );
11269   4520   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
11270   4521   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
11271   4522   
                http_response.headers(),
11272   4523   
                expected_headers,
11273   4524   
            ));
11274   4525   
        }
11275   4526   
    }
11276         -
    /// Attempted string coercion should result in SerializationException
11277         -
    /// Test ID: RestJsonPathBooleanStringCoercion_case14
        4527  +
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
        4528  +
    /// Test ID: RestJsonHeaderTimestampEpochRejectsMalformedValues_case5
11278   4529   
    #[::tokio::test]
11279         -
    async fn rest_json_path_boolean_string_coercion_case14_malformed_request() {
        4530  +
    #[::tracing_test::traced_test]
        4531  +
    async fn rest_json_header_timestamp_epoch_rejects_malformed_values_case5_malformed_request() {
11280   4532   
        {
11281   4533   
            #[allow(unused_mut)]
11282   4534   
            let mut http_request = http::Request::builder()
11283         -
                .uri("/MalformedBoolean/N")
        4535  +
                .uri("/MalformedTimestampHeaderEpoch")
11284   4536   
                .method("POST")
        4537  +
                .header("timestamp", "-Infinity")
11285   4538   
                .body(::aws_smithy_http_server::body::Body::empty())
11286   4539   
                .unwrap();
11287   4540   
            #[allow(unused_mut)]
11288   4541   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
11289   4542   
            let config = crate::service::RestJsonConfig::builder().build();
11290   4543   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
11291         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        4544  +
                            .malformed_timestamp_header_epoch(move |input: crate::input::MalformedTimestampHeaderEpochInput| {
11292   4545   
                                let sender = sender.clone();
11293   4546   
                                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> };
        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> };
11295   4548   
                                    sender.send(()).await.expect("receiver dropped early");
11296   4549   
                                    result
11297   4550   
                                }
11298   4551   
                            })
11299   4552   
                            .build_unchecked();
11300   4553   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
11301   4554   
                .await
11302   4555   
                .expect("unable to make an HTTP request");
11303   4556   
            ::pretty_assertions::assert_eq!(
11304   4557   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
11305   4558   
                http_response.status()
11306   4559   
            );
11307   4560   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
11308   4561   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
11309   4562   
                http_response.headers(),
11310   4563   
                expected_headers,
11311   4564   
            ));
11312   4565   
        }
11313   4566   
    }
11314         -
    /// Attempted string coercion should result in SerializationException
11315         -
    /// Test ID: RestJsonPathBooleanStringCoercion_case15
        4567  +
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
        4568  +
    /// Test ID: RestJsonHeaderTimestampEpochRejectsMalformedValues_case6
11316   4569   
    #[::tokio::test]
11317         -
    async fn rest_json_path_boolean_string_coercion_case15_malformed_request() {
        4570  +
    #[::tracing_test::traced_test]
        4571  +
    async fn rest_json_header_timestamp_epoch_rejects_malformed_values_case6_malformed_request() {
11318   4572   
        {
11319   4573   
            #[allow(unused_mut)]
11320   4574   
            let mut http_request = http::Request::builder()
11321         -
                .uri("/MalformedBoolean/no")
        4575  +
                .uri("/MalformedTimestampHeaderEpoch")
11322   4576   
                .method("POST")
        4577  +
                .header("timestamp", "NaN")
11323   4578   
                .body(::aws_smithy_http_server::body::Body::empty())
11324   4579   
                .unwrap();
11325   4580   
            #[allow(unused_mut)]
11326   4581   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
11327   4582   
            let config = crate::service::RestJsonConfig::builder().build();
11328   4583   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
11329         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        4584  +
                            .malformed_timestamp_header_epoch(move |input: crate::input::MalformedTimestampHeaderEpochInput| {
11330   4585   
                                let sender = sender.clone();
11331   4586   
                                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> };
        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> };
11333   4588   
                                    sender.send(()).await.expect("receiver dropped early");
11334   4589   
                                    result
11335   4590   
                                }
11336   4591   
                            })
11337   4592   
                            .build_unchecked();
11338   4593   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
11339   4594   
                .await
11340   4595   
                .expect("unable to make an HTTP request");
11341   4596   
            ::pretty_assertions::assert_eq!(
11342   4597   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
11343   4598   
                http_response.status()
11344   4599   
            );
11345   4600   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
11346   4601   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
11347   4602   
                http_response.headers(),
11348   4603   
                expected_headers,
11349   4604   
            ));
11350   4605   
        }
11351   4606   
    }
11352         -
    /// Attempted string coercion should result in SerializationException
11353         -
    /// Test ID: RestJsonPathBooleanStringCoercion_case16
11354         -
    #[::tokio::test]
11355         -
    async fn rest_json_path_boolean_string_coercion_case16_malformed_request() {
11356         -
        {
11357         -
            #[allow(unused_mut)]
11358         -
            let mut http_request = http::Request::builder()
11359         -
                .uri("/MalformedBoolean/No")
11360         -
                .method("POST")
11361         -
                .body(::aws_smithy_http_server::body::Body::empty())
11362         -
                .unwrap();
11363         -
            #[allow(unused_mut)]
11364         -
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
11365         -
            let config = crate::service::RestJsonConfig::builder().build();
11366         -
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
11367         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
11368         -
                                let sender = sender.clone();
11369         -
                                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> };
11371         -
                                    sender.send(()).await.expect("receiver dropped early");
11372         -
                                    result
11373         -
                                }
11374         -
                            })
11375         -
                            .build_unchecked();
11376         -
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
11377         -
                .await
11378         -
                .expect("unable to make an HTTP request");
11379         -
            ::pretty_assertions::assert_eq!(
11380         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
11381         -
                http_response.status()
11382         -
            );
11383         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
11384         -
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
11385         -
                http_response.headers(),
11386         -
                expected_headers,
11387         -
            ));
        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)
        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),
11388   4672   
        }
11389   4673   
    }
11390         -
    /// Attempted string coercion should result in SerializationException
11391         -
    /// Test ID: RestJsonPathBooleanStringCoercion_case17
11392         -
    #[::tokio::test]
11393         -
    async fn rest_json_path_boolean_string_coercion_case17_malformed_request() {
11394         -
        {
11395         -
            #[allow(unused_mut)]
11396         -
            let mut http_request = http::Request::builder()
11397         -
                .uri("/MalformedBoolean/NO")
11398         -
                .method("POST")
11399         -
                .body(::aws_smithy_http_server::body::Body::empty())
11400         -
                .unwrap();
11401         -
            #[allow(unused_mut)]
11402         -
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
11403         -
            let config = crate::service::RestJsonConfig::builder().build();
11404         -
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
11405         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
11406         -
                                let sender = sender.clone();
11407         -
                                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> };
11409         -
                                    sender.send(()).await.expect("receiver dropped early");
11410         -
                                    result
11411         -
                                }
11412         -
                            })
11413         -
                            .build_unchecked();
11414         -
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
11415         -
                .await
11416         -
                .expect("unable to make an HTTP request");
11417         -
            ::pretty_assertions::assert_eq!(
11418         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
11419         -
                http_response.status()
11420         -
            );
11421         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
11422         -
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
11423         -
                http_response.headers(),
11424         -
                expected_headers,
11425         -
            ));
        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()));
        4699  +
                response
        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))
        4704  +
            }
11426   4705   
        }
11427   4706   
    }
11428         -
    /// Attempted string coercion should result in SerializationException
11429         -
    /// Test ID: RestJsonPathBooleanStringCoercion_case18
        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
11430   4716   
    #[::tokio::test]
11431         -
    async fn rest_json_path_boolean_string_coercion_case18_malformed_request() {
        4717  +
    #[::tracing_test::traced_test]
        4718  +
    async fn rest_json_header_timestamp_date_time_rejects_http_date_case0_malformed_request() {
11432   4719   
        {
11433   4720   
            #[allow(unused_mut)]
11434   4721   
            let mut http_request = http::Request::builder()
11435         -
                .uri("/MalformedBoolean/0")
        4722  +
                .uri("/MalformedTimestampHeaderDateTime")
11436   4723   
                .method("POST")
        4724  +
                .header("timestamp", "Tue, 29 Apr 2014 18:30:38 GMT")
11437   4725   
                .body(::aws_smithy_http_server::body::Body::empty())
11438   4726   
                .unwrap();
11439   4727   
            #[allow(unused_mut)]
11440   4728   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
11441   4729   
            let config = crate::service::RestJsonConfig::builder().build();
11442   4730   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
11443         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        4731  +
                            .malformed_timestamp_header_date_time(move |input: crate::input::MalformedTimestampHeaderDateTimeInput| {
11444   4732   
                                let sender = sender.clone();
11445   4733   
                                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> };
        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> };
11447   4735   
                                    sender.send(()).await.expect("receiver dropped early");
11448   4736   
                                    result
11449   4737   
                                }
11450   4738   
                            })
11451   4739   
                            .build_unchecked();
11452   4740   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
11453   4741   
                .await
11454   4742   
                .expect("unable to make an HTTP request");
11455   4743   
            ::pretty_assertions::assert_eq!(
11456   4744   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
11457   4745   
                http_response.status()
11458   4746   
            );
11459   4747   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
11460   4748   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
11461   4749   
                http_response.headers(),
11462   4750   
                expected_headers,
11463   4751   
            ));
11464   4752   
        }
11465   4753   
    }
11466         -
    /// Attempted string coercion should result in SerializationException
11467         -
    /// Test ID: RestJsonPathBooleanStringCoercion_case19
        4754  +
    /// When the format is date-time, epoch-seconds timestamps are rejected with a
        4755  +
    /// 400 SerializationException
        4756  +
    /// Test ID: RestJsonHeaderTimestampDateTimeRejectsEpochSeconds_case0
11468   4757   
    #[::tokio::test]
11469         -
    async fn rest_json_path_boolean_string_coercion_case19_malformed_request() {
        4758  +
    #[::tracing_test::traced_test]
        4759  +
    async fn rest_json_header_timestamp_date_time_rejects_epoch_seconds_case0_malformed_request() {
11470   4760   
        {
11471   4761   
            #[allow(unused_mut)]
11472   4762   
            let mut http_request = http::Request::builder()
11473         -
                .uri("/MalformedBoolean/off")
        4763  +
                .uri("/MalformedTimestampHeaderDateTime")
11474   4764   
                .method("POST")
        4765  +
                .header("timestamp", "1515531081.1234")
11475   4766   
                .body(::aws_smithy_http_server::body::Body::empty())
11476   4767   
                .unwrap();
11477   4768   
            #[allow(unused_mut)]
11478   4769   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
11479   4770   
            let config = crate::service::RestJsonConfig::builder().build();
11480   4771   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
11481         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        4772  +
                            .malformed_timestamp_header_date_time(move |input: crate::input::MalformedTimestampHeaderDateTimeInput| {
11482   4773   
                                let sender = sender.clone();
11483   4774   
                                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> };
        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> };
11485   4776   
                                    sender.send(()).await.expect("receiver dropped early");
11486   4777   
                                    result
11487   4778   
                                }
11488   4779   
                            })
11489   4780   
                            .build_unchecked();
11490   4781   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
11491   4782   
                .await
11492   4783   
                .expect("unable to make an HTTP request");
11493   4784   
            ::pretty_assertions::assert_eq!(
11494   4785   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
11495   4786   
                http_response.status()
11496   4787   
            );
11497   4788   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
11498   4789   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
11499   4790   
                http_response.headers(),
11500   4791   
                expected_headers,
11501   4792   
            ));
11502   4793   
        }
11503   4794   
    }
11504         -
    /// Attempted string coercion should result in SerializationException
11505         -
    /// Test ID: RestJsonPathBooleanStringCoercion_case20
        4795  +
    /// When the format is date-time, epoch-seconds timestamps are rejected with a
        4796  +
    /// 400 SerializationException
        4797  +
    /// Test ID: RestJsonHeaderTimestampDateTimeRejectsEpochSeconds_case1
11506   4798   
    #[::tokio::test]
11507         -
    async fn rest_json_path_boolean_string_coercion_case20_malformed_request() {
        4799  +
    #[::tracing_test::traced_test]
        4800  +
    async fn rest_json_header_timestamp_date_time_rejects_epoch_seconds_case1_malformed_request() {
11508   4801   
        {
11509   4802   
            #[allow(unused_mut)]
11510   4803   
            let mut http_request = http::Request::builder()
11511         -
                .uri("/MalformedBoolean/Off")
        4804  +
                .uri("/MalformedTimestampHeaderDateTime")
11512   4805   
                .method("POST")
        4806  +
                .header("timestamp", "1515531081")
11513   4807   
                .body(::aws_smithy_http_server::body::Body::empty())
11514   4808   
                .unwrap();
11515   4809   
            #[allow(unused_mut)]
11516   4810   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
11517   4811   
            let config = crate::service::RestJsonConfig::builder().build();
11518   4812   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
11519         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        4813  +
                            .malformed_timestamp_header_date_time(move |input: crate::input::MalformedTimestampHeaderDateTimeInput| {
11520   4814   
                                let sender = sender.clone();
11521   4815   
                                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> };
        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> };
11523   4817   
                                    sender.send(()).await.expect("receiver dropped early");
11524   4818   
                                    result
11525   4819   
                                }
11526   4820   
                            })
11527   4821   
                            .build_unchecked();
11528   4822   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
11529   4823   
                .await
11530   4824   
                .expect("unable to make an HTTP request");
11531   4825   
            ::pretty_assertions::assert_eq!(
11532   4826   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
11533   4827   
                http_response.status()
11534   4828   
            );
11535   4829   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
11536   4830   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
11537   4831   
                http_response.headers(),
11538   4832   
                expected_headers,
11539   4833   
            ));
11540   4834   
        }
11541   4835   
    }
11542         -
    /// Attempted string coercion should result in SerializationException
11543         -
    /// Test ID: RestJsonPathBooleanStringCoercion_case21
        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
11544   4839   
    #[::tokio::test]
11545         -
    async fn rest_json_path_boolean_string_coercion_case21_malformed_request() {
        4840  +
    #[::tracing_test::traced_test]
        4841  +
    async fn rest_json_header_timestamp_date_time_rejects_different8601_formats_case0_malformed_request(
        4842  +
    ) {
11546   4843   
        {
11547   4844   
            #[allow(unused_mut)]
11548   4845   
            let mut http_request = http::Request::builder()
11549         -
                .uri("/MalformedBoolean/OFF")
        4846  +
                .uri("/MalformedTimestampHeaderDateTime")
11550   4847   
                .method("POST")
        4848  +
                .header("timestamp", "1996-12-19T16:39:57+00")
11551   4849   
                .body(::aws_smithy_http_server::body::Body::empty())
11552   4850   
                .unwrap();
11553   4851   
            #[allow(unused_mut)]
11554   4852   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
11555   4853   
            let config = crate::service::RestJsonConfig::builder().build();
11556   4854   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
11557         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        4855  +
                            .malformed_timestamp_header_date_time(move |input: crate::input::MalformedTimestampHeaderDateTimeInput| {
11558   4856   
                                let sender = sender.clone();
11559   4857   
                                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> };
        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> };
11561   4859   
                                    sender.send(()).await.expect("receiver dropped early");
11562   4860   
                                    result
11563   4861   
                                }
11564   4862   
                            })
11565   4863   
                            .build_unchecked();
11566   4864   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
11567   4865   
                .await
11568   4866   
                .expect("unable to make an HTTP request");
11569   4867   
            ::pretty_assertions::assert_eq!(
11570   4868   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
11571   4869   
                http_response.status()
11572   4870   
            );
11573   4871   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
11574   4872   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
11575   4873   
                http_response.headers(),
11576   4874   
                expected_headers,
11577   4875   
            ));
11578   4876   
        }
11579   4877   
    }
11580         -
    /// Attempted string coercion should result in SerializationException
11581         -
    /// Test ID: RestJsonQueryBooleanStringCoercion_case0
        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
11582   4881   
    #[::tokio::test]
11583         -
    async fn rest_json_query_boolean_string_coercion_case0_malformed_request() {
        4882  +
    #[::tracing_test::traced_test]
        4883  +
    async fn rest_json_header_timestamp_date_time_rejects_different8601_formats_case1_malformed_request(
        4884  +
    ) {
11584   4885   
        {
11585   4886   
            #[allow(unused_mut)]
11586   4887   
            let mut http_request = http::Request::builder()
11587         -
                .uri("/MalformedBoolean/true")
        4888  +
                .uri("/MalformedTimestampHeaderDateTime")
11588   4889   
                .method("POST")
        4890  +
                .header("timestamp", "1996-12-19T16:39:57+00Z")
11589   4891   
                .body(::aws_smithy_http_server::body::Body::empty())
11590   4892   
                .unwrap();
11591         -
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=True"
11592         -
                .parse()
11593         -
                .unwrap();
11594   4893   
            #[allow(unused_mut)]
11595   4894   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
11596   4895   
            let config = crate::service::RestJsonConfig::builder().build();
11597   4896   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
11598         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        4897  +
                            .malformed_timestamp_header_date_time(move |input: crate::input::MalformedTimestampHeaderDateTimeInput| {
11599   4898   
                                let sender = sender.clone();
11600   4899   
                                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> };
        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> };
11602   4901   
                                    sender.send(()).await.expect("receiver dropped early");
11603   4902   
                                    result
11604   4903   
                                }
11605   4904   
                            })
11606   4905   
                            .build_unchecked();
11607   4906   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
11608   4907   
                .await
11609   4908   
                .expect("unable to make an HTTP request");
11610   4909   
            ::pretty_assertions::assert_eq!(
11611   4910   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
11612   4911   
                http_response.status()
11613   4912   
            );
11614   4913   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
11615   4914   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
11616   4915   
                http_response.headers(),
11617   4916   
                expected_headers,
11618   4917   
            ));
11619   4918   
        }
11620   4919   
    }
11621         -
    /// Attempted string coercion should result in SerializationException
11622         -
    /// Test ID: RestJsonQueryBooleanStringCoercion_case1
        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
11623   4923   
    #[::tokio::test]
11624         -
    async fn rest_json_query_boolean_string_coercion_case1_malformed_request() {
        4924  +
    #[::tracing_test::traced_test]
        4925  +
    async fn rest_json_header_timestamp_date_time_rejects_different8601_formats_case2_malformed_request(
        4926  +
    ) {
11625   4927   
        {
11626   4928   
            #[allow(unused_mut)]
11627   4929   
            let mut http_request = http::Request::builder()
11628         -
                .uri("/MalformedBoolean/true")
        4930  +
                .uri("/MalformedTimestampHeaderDateTime")
11629   4931   
                .method("POST")
        4932  +
                .header("timestamp", "1996-12-19T16:39:57")
11630   4933   
                .body(::aws_smithy_http_server::body::Body::empty())
11631   4934   
                .unwrap();
11632         -
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=TRUE"
11633         -
                .parse()
11634         -
                .unwrap();
11635   4935   
            #[allow(unused_mut)]
11636   4936   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
11637   4937   
            let config = crate::service::RestJsonConfig::builder().build();
11638   4938   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
11639         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        4939  +
                            .malformed_timestamp_header_date_time(move |input: crate::input::MalformedTimestampHeaderDateTimeInput| {
11640   4940   
                                let sender = sender.clone();
11641   4941   
                                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> };
        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> };
11643   4943   
                                    sender.send(()).await.expect("receiver dropped early");
11644   4944   
                                    result
11645   4945   
                                }
11646   4946   
                            })
11647   4947   
                            .build_unchecked();
11648   4948   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
11649   4949   
                .await
11650   4950   
                .expect("unable to make an HTTP request");
11651   4951   
            ::pretty_assertions::assert_eq!(
11652   4952   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
11653   4953   
                http_response.status()
11654   4954   
            );
11655   4955   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
11656   4956   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
11657   4957   
                http_response.headers(),
11658   4958   
                expected_headers,
11659   4959   
            ));
11660   4960   
        }
11661   4961   
    }
11662         -
    /// Attempted string coercion should result in SerializationException
11663         -
    /// Test ID: RestJsonQueryBooleanStringCoercion_case2
        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
11664   4965   
    #[::tokio::test]
11665         -
    async fn rest_json_query_boolean_string_coercion_case2_malformed_request() {
        4966  +
    #[::tracing_test::traced_test]
        4967  +
    async fn rest_json_header_timestamp_date_time_rejects_different8601_formats_case3_malformed_request(
        4968  +
    ) {
11666   4969   
        {
11667   4970   
            #[allow(unused_mut)]
11668   4971   
            let mut http_request = http::Request::builder()
11669         -
                .uri("/MalformedBoolean/true")
        4972  +
                .uri("/MalformedTimestampHeaderDateTime")
11670   4973   
                .method("POST")
        4974  +
                .header("timestamp", "1996-12-19T163957")
11671   4975   
                .body(::aws_smithy_http_server::body::Body::empty())
11672   4976   
                .unwrap();
11673         -
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=y".parse().unwrap();
11674   4977   
            #[allow(unused_mut)]
11675   4978   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
11676   4979   
            let config = crate::service::RestJsonConfig::builder().build();
11677   4980   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
11678         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        4981  +
                            .malformed_timestamp_header_date_time(move |input: crate::input::MalformedTimestampHeaderDateTimeInput| {
11679   4982   
                                let sender = sender.clone();
11680   4983   
                                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> };
        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> };
11682   4985   
                                    sender.send(()).await.expect("receiver dropped early");
11683   4986   
                                    result
11684   4987   
                                }
11685   4988   
                            })
11686   4989   
                            .build_unchecked();
11687   4990   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
11688   4991   
                .await
11689   4992   
                .expect("unable to make an HTTP request");
11690   4993   
            ::pretty_assertions::assert_eq!(
11691   4994   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
11692   4995   
                http_response.status()
11693   4996   
            );
11694   4997   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
11695   4998   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
11696   4999   
                http_response.headers(),
11697   5000   
                expected_headers,
11698   5001   
            ));
11699   5002   
        }
11700   5003   
    }
11701         -
    /// Attempted string coercion should result in SerializationException
11702         -
    /// Test ID: RestJsonQueryBooleanStringCoercion_case3
        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
11703   5007   
    #[::tokio::test]
11704         -
    async fn rest_json_query_boolean_string_coercion_case3_malformed_request() {
        5008  +
    #[::tracing_test::traced_test]
        5009  +
    async fn rest_json_header_timestamp_date_time_rejects_different8601_formats_case4_malformed_request(
        5010  +
    ) {
11705   5011   
        {
11706   5012   
            #[allow(unused_mut)]
11707   5013   
            let mut http_request = http::Request::builder()
11708         -
                .uri("/MalformedBoolean/true")
        5014  +
                .uri("/MalformedTimestampHeaderDateTime")
11709   5015   
                .method("POST")
        5016  +
                .header("timestamp", "19961219T163957Z")
11710   5017   
                .body(::aws_smithy_http_server::body::Body::empty())
11711   5018   
                .unwrap();
11712         -
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=Y".parse().unwrap();
11713   5019   
            #[allow(unused_mut)]
11714   5020   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
11715   5021   
            let config = crate::service::RestJsonConfig::builder().build();
11716   5022   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
11717         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        5023  +
                            .malformed_timestamp_header_date_time(move |input: crate::input::MalformedTimestampHeaderDateTimeInput| {
11718   5024   
                                let sender = sender.clone();
11719   5025   
                                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> };
        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> };
11721   5027   
                                    sender.send(()).await.expect("receiver dropped early");
11722   5028   
                                    result
11723   5029   
                                }
11724   5030   
                            })
11725   5031   
                            .build_unchecked();
11726   5032   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
11727   5033   
                .await
11728   5034   
                .expect("unable to make an HTTP request");
11729   5035   
            ::pretty_assertions::assert_eq!(
11730   5036   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
11731   5037   
                http_response.status()
11732   5038   
            );
11733   5039   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
11734   5040   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
11735   5041   
                http_response.headers(),
11736   5042   
                expected_headers,
11737   5043   
            ));
11738   5044   
        }
11739   5045   
    }
11740         -
    /// Attempted string coercion should result in SerializationException
11741         -
    /// Test ID: RestJsonQueryBooleanStringCoercion_case4
        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
11742   5049   
    #[::tokio::test]
11743         -
    async fn rest_json_query_boolean_string_coercion_case4_malformed_request() {
        5050  +
    #[::tracing_test::traced_test]
        5051  +
    async fn rest_json_header_timestamp_date_time_rejects_different8601_formats_case5_malformed_request(
        5052  +
    ) {
11744   5053   
        {
11745   5054   
            #[allow(unused_mut)]
11746   5055   
            let mut http_request = http::Request::builder()
11747         -
                .uri("/MalformedBoolean/true")
        5056  +
                .uri("/MalformedTimestampHeaderDateTime")
11748   5057   
                .method("POST")
        5058  +
                .header("timestamp", "19961219T163957")
11749   5059   
                .body(::aws_smithy_http_server::body::Body::empty())
11750   5060   
                .unwrap();
11751         -
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=yes".parse().unwrap();
11752   5061   
            #[allow(unused_mut)]
11753   5062   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
11754   5063   
            let config = crate::service::RestJsonConfig::builder().build();
11755   5064   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
11756         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        5065  +
                            .malformed_timestamp_header_date_time(move |input: crate::input::MalformedTimestampHeaderDateTimeInput| {
11757   5066   
                                let sender = sender.clone();
11758   5067   
                                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> };
        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> };
11760   5069   
                                    sender.send(()).await.expect("receiver dropped early");
11761   5070   
                                    result
11762   5071   
                                }
11763   5072   
                            })
11764   5073   
                            .build_unchecked();
11765   5074   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
11766   5075   
                .await
11767   5076   
                .expect("unable to make an HTTP request");
11768   5077   
            ::pretty_assertions::assert_eq!(
11769   5078   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
11770   5079   
                http_response.status()
11771   5080   
            );
11772   5081   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
11773   5082   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
11774   5083   
                http_response.headers(),
11775   5084   
                expected_headers,
11776   5085   
            ));
11777   5086   
        }
11778   5087   
    }
11779         -
    /// Attempted string coercion should result in SerializationException
11780         -
    /// Test ID: RestJsonQueryBooleanStringCoercion_case5
        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
11781   5091   
    #[::tokio::test]
11782         -
    async fn rest_json_query_boolean_string_coercion_case5_malformed_request() {
        5092  +
    #[::tracing_test::traced_test]
        5093  +
    async fn rest_json_header_timestamp_date_time_rejects_different8601_formats_case6_malformed_request(
        5094  +
    ) {
11783   5095   
        {
11784   5096   
            #[allow(unused_mut)]
11785   5097   
            let mut http_request = http::Request::builder()
11786         -
                .uri("/MalformedBoolean/true")
        5098  +
                .uri("/MalformedTimestampHeaderDateTime")
11787   5099   
                .method("POST")
        5100  +
                .header("timestamp", "19961219T16:39:57Z")
11788   5101   
                .body(::aws_smithy_http_server::body::Body::empty())
11789   5102   
                .unwrap();
11790         -
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=Yes".parse().unwrap();
11791   5103   
            #[allow(unused_mut)]
11792   5104   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
11793   5105   
            let config = crate::service::RestJsonConfig::builder().build();
11794   5106   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
11795         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        5107  +
                            .malformed_timestamp_header_date_time(move |input: crate::input::MalformedTimestampHeaderDateTimeInput| {
11796   5108   
                                let sender = sender.clone();
11797   5109   
                                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> };
        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> };
11799   5111   
                                    sender.send(()).await.expect("receiver dropped early");
11800   5112   
                                    result
11801   5113   
                                }
11802   5114   
                            })
11803   5115   
                            .build_unchecked();
11804   5116   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
11805   5117   
                .await
11806   5118   
                .expect("unable to make an HTTP request");
11807   5119   
            ::pretty_assertions::assert_eq!(
11808   5120   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
11809   5121   
                http_response.status()
11810   5122   
            );
11811   5123   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
11812   5124   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
11813   5125   
                http_response.headers(),
11814   5126   
                expected_headers,
11815   5127   
            ));
11816   5128   
        }
11817   5129   
    }
11818         -
    /// Attempted string coercion should result in SerializationException
11819         -
    /// Test ID: RestJsonQueryBooleanStringCoercion_case6
        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
11820   5133   
    #[::tokio::test]
11821         -
    async fn rest_json_query_boolean_string_coercion_case6_malformed_request() {
        5134  +
    #[::tracing_test::traced_test]
        5135  +
    async fn rest_json_header_timestamp_date_time_rejects_different8601_formats_case7_malformed_request(
        5136  +
    ) {
11822   5137   
        {
11823   5138   
            #[allow(unused_mut)]
11824   5139   
            let mut http_request = http::Request::builder()
11825         -
                .uri("/MalformedBoolean/true")
        5140  +
                .uri("/MalformedTimestampHeaderDateTime")
11826   5141   
                .method("POST")
        5142  +
                .header("timestamp", "19961219T16:39:57")
11827   5143   
                .body(::aws_smithy_http_server::body::Body::empty())
11828   5144   
                .unwrap();
11829         -
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=YES".parse().unwrap();
11830   5145   
            #[allow(unused_mut)]
11831   5146   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
11832   5147   
            let config = crate::service::RestJsonConfig::builder().build();
11833   5148   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
11834         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        5149  +
                            .malformed_timestamp_header_date_time(move |input: crate::input::MalformedTimestampHeaderDateTimeInput| {
11835   5150   
                                let sender = sender.clone();
11836   5151   
                                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> };
        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> };
11838   5153   
                                    sender.send(()).await.expect("receiver dropped early");
11839   5154   
                                    result
11840   5155   
                                }
11841   5156   
                            })
11842   5157   
                            .build_unchecked();
11843   5158   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
11844   5159   
                .await
11845   5160   
                .expect("unable to make an HTTP request");
11846   5161   
            ::pretty_assertions::assert_eq!(
11847   5162   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
11848   5163   
                http_response.status()
11849   5164   
            );
11850   5165   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
11851   5166   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
11852   5167   
                http_response.headers(),
11853   5168   
                expected_headers,
11854   5169   
            ));
11855   5170   
        }
11856   5171   
    }
11857         -
    /// Attempted string coercion should result in SerializationException
11858         -
    /// Test ID: RestJsonQueryBooleanStringCoercion_case7
        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
11859   5175   
    #[::tokio::test]
11860         -
    async fn rest_json_query_boolean_string_coercion_case7_malformed_request() {
        5176  +
    #[::tracing_test::traced_test]
        5177  +
    async fn rest_json_header_timestamp_date_time_rejects_different8601_formats_case8_malformed_request(
        5178  +
    ) {
11861   5179   
        {
11862   5180   
            #[allow(unused_mut)]
11863   5181   
            let mut http_request = http::Request::builder()
11864         -
                .uri("/MalformedBoolean/true")
        5182  +
                .uri("/MalformedTimestampHeaderDateTime")
11865   5183   
                .method("POST")
        5184  +
                .header("timestamp", "1996-12-19T16:39Z")
11866   5185   
                .body(::aws_smithy_http_server::body::Body::empty())
11867   5186   
                .unwrap();
11868         -
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=1".parse().unwrap();
11869   5187   
            #[allow(unused_mut)]
11870   5188   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
11871   5189   
            let config = crate::service::RestJsonConfig::builder().build();
11872   5190   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
11873         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        5191  +
                            .malformed_timestamp_header_date_time(move |input: crate::input::MalformedTimestampHeaderDateTimeInput| {
11874   5192   
                                let sender = sender.clone();
11875   5193   
                                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> };
        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> };
11877   5195   
                                    sender.send(()).await.expect("receiver dropped early");
11878   5196   
                                    result
11879   5197   
                                }
11880   5198   
                            })
11881   5199   
                            .build_unchecked();
11882   5200   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
11883   5201   
                .await
11884   5202   
                .expect("unable to make an HTTP request");
11885   5203   
            ::pretty_assertions::assert_eq!(
11886   5204   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
11887   5205   
                http_response.status()
11888   5206   
            );
11889   5207   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
11890   5208   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
11891   5209   
                http_response.headers(),
11892   5210   
                expected_headers,
11893   5211   
            ));
11894   5212   
        }
11895   5213   
    }
11896         -
    /// Attempted string coercion should result in SerializationException
11897         -
    /// Test ID: RestJsonQueryBooleanStringCoercion_case8
        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
11898   5217   
    #[::tokio::test]
11899         -
    async fn rest_json_query_boolean_string_coercion_case8_malformed_request() {
        5218  +
    #[::tracing_test::traced_test]
        5219  +
    async fn rest_json_header_timestamp_date_time_rejects_different8601_formats_case9_malformed_request(
        5220  +
    ) {
11900   5221   
        {
11901   5222   
            #[allow(unused_mut)]
11902   5223   
            let mut http_request = http::Request::builder()
11903         -
                .uri("/MalformedBoolean/true")
        5224  +
                .uri("/MalformedTimestampHeaderDateTime")
11904   5225   
                .method("POST")
        5226  +
                .header("timestamp", "1996-12-19T16:39")
11905   5227   
                .body(::aws_smithy_http_server::body::Body::empty())
11906   5228   
                .unwrap();
11907         -
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=on".parse().unwrap();
11908   5229   
            #[allow(unused_mut)]
11909   5230   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
11910   5231   
            let config = crate::service::RestJsonConfig::builder().build();
11911   5232   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
11912         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        5233  +
                            .malformed_timestamp_header_date_time(move |input: crate::input::MalformedTimestampHeaderDateTimeInput| {
11913   5234   
                                let sender = sender.clone();
11914   5235   
                                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> };
        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> };
11916   5237   
                                    sender.send(()).await.expect("receiver dropped early");
11917   5238   
                                    result
11918   5239   
                                }
11919   5240   
                            })
11920   5241   
                            .build_unchecked();
11921   5242   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
11922   5243   
                .await
11923   5244   
                .expect("unable to make an HTTP request");
11924   5245   
            ::pretty_assertions::assert_eq!(
11925   5246   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
11926   5247   
                http_response.status()
11927   5248   
            );
11928   5249   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
11929   5250   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
11930   5251   
                http_response.headers(),
11931   5252   
                expected_headers,
11932   5253   
            ));
11933   5254   
        }
11934   5255   
    }
11935         -
    /// Attempted string coercion should result in SerializationException
11936         -
    /// Test ID: RestJsonQueryBooleanStringCoercion_case9
        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
11937   5259   
    #[::tokio::test]
11938         -
    async fn rest_json_query_boolean_string_coercion_case9_malformed_request() {
        5260  +
    #[::tracing_test::traced_test]
        5261  +
    async fn rest_json_header_timestamp_date_time_rejects_different8601_formats_case10_malformed_request(
        5262  +
    ) {
11939   5263   
        {
11940   5264   
            #[allow(unused_mut)]
11941   5265   
            let mut http_request = http::Request::builder()
11942         -
                .uri("/MalformedBoolean/true")
        5266  +
                .uri("/MalformedTimestampHeaderDateTime")
11943   5267   
                .method("POST")
        5268  +
                .header("timestamp", "1996-12-19T1639")
11944   5269   
                .body(::aws_smithy_http_server::body::Body::empty())
11945   5270   
                .unwrap();
11946         -
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=On".parse().unwrap();
11947   5271   
            #[allow(unused_mut)]
11948   5272   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
11949   5273   
            let config = crate::service::RestJsonConfig::builder().build();
11950   5274   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
11951         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        5275  +
                            .malformed_timestamp_header_date_time(move |input: crate::input::MalformedTimestampHeaderDateTimeInput| {
11952   5276   
                                let sender = sender.clone();
11953   5277   
                                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> };
        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> };
11955   5279   
                                    sender.send(()).await.expect("receiver dropped early");
11956   5280   
                                    result
11957   5281   
                                }
11958   5282   
                            })
11959   5283   
                            .build_unchecked();
11960   5284   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
11961   5285   
                .await
11962   5286   
                .expect("unable to make an HTTP request");
11963   5287   
            ::pretty_assertions::assert_eq!(
11964   5288   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
11965   5289   
                http_response.status()
11966   5290   
            );
11967   5291   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
11968   5292   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
11969   5293   
                http_response.headers(),
11970   5294   
                expected_headers,
11971   5295   
            ));
11972   5296   
        }
11973   5297   
    }
11974         -
    /// Attempted string coercion should result in SerializationException
11975         -
    /// Test ID: RestJsonQueryBooleanStringCoercion_case10
        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
11976   5301   
    #[::tokio::test]
11977         -
    async fn rest_json_query_boolean_string_coercion_case10_malformed_request() {
        5302  +
    #[::tracing_test::traced_test]
        5303  +
    async fn rest_json_header_timestamp_date_time_rejects_different8601_formats_case11_malformed_request(
        5304  +
    ) {
11978   5305   
        {
11979   5306   
            #[allow(unused_mut)]
11980   5307   
            let mut http_request = http::Request::builder()
11981         -
                .uri("/MalformedBoolean/true")
        5308  +
                .uri("/MalformedTimestampHeaderDateTime")
11982   5309   
                .method("POST")
        5310  +
                .header("timestamp", "1996-12-19T16Z")
11983   5311   
                .body(::aws_smithy_http_server::body::Body::empty())
11984   5312   
                .unwrap();
11985         -
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=ON".parse().unwrap();
11986   5313   
            #[allow(unused_mut)]
11987   5314   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
11988   5315   
            let config = crate::service::RestJsonConfig::builder().build();
11989   5316   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
11990         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        5317  +
                            .malformed_timestamp_header_date_time(move |input: crate::input::MalformedTimestampHeaderDateTimeInput| {
11991   5318   
                                let sender = sender.clone();
11992   5319   
                                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> };
        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> };
11994   5321   
                                    sender.send(()).await.expect("receiver dropped early");
11995   5322   
                                    result
11996   5323   
                                }
11997   5324   
                            })
11998   5325   
                            .build_unchecked();
11999   5326   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
12000   5327   
                .await
12001   5328   
                .expect("unable to make an HTTP request");
12002   5329   
            ::pretty_assertions::assert_eq!(
12003   5330   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
12004   5331   
                http_response.status()
12005   5332   
            );
12006   5333   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
12007   5334   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
12008   5335   
                http_response.headers(),
12009   5336   
                expected_headers,
12010   5337   
            ));
12011   5338   
        }
12012   5339   
    }
12013         -
    /// Attempted string coercion should result in SerializationException
12014         -
    /// Test ID: RestJsonQueryBooleanStringCoercion_case11
        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
12015   5343   
    #[::tokio::test]
12016         -
    async fn rest_json_query_boolean_string_coercion_case11_malformed_request() {
        5344  +
    #[::tracing_test::traced_test]
        5345  +
    async fn rest_json_header_timestamp_date_time_rejects_different8601_formats_case12_malformed_request(
        5346  +
    ) {
12017   5347   
        {
12018   5348   
            #[allow(unused_mut)]
12019   5349   
            let mut http_request = http::Request::builder()
12020         -
                .uri("/MalformedBoolean/true")
        5350  +
                .uri("/MalformedTimestampHeaderDateTime")
12021   5351   
                .method("POST")
        5352  +
                .header("timestamp", "1996-12-19T16")
12022   5353   
                .body(::aws_smithy_http_server::body::Body::empty())
12023   5354   
                .unwrap();
12024         -
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=False"
12025         -
                .parse()
12026         -
                .unwrap();
12027   5355   
            #[allow(unused_mut)]
12028   5356   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
12029   5357   
            let config = crate::service::RestJsonConfig::builder().build();
12030   5358   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
12031         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        5359  +
                            .malformed_timestamp_header_date_time(move |input: crate::input::MalformedTimestampHeaderDateTimeInput| {
12032   5360   
                                let sender = sender.clone();
12033   5361   
                                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> };
        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> };
12035   5363   
                                    sender.send(()).await.expect("receiver dropped early");
12036   5364   
                                    result
12037   5365   
                                }
12038   5366   
                            })
12039   5367   
                            .build_unchecked();
12040   5368   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
12041   5369   
                .await
12042   5370   
                .expect("unable to make an HTTP request");
12043   5371   
            ::pretty_assertions::assert_eq!(
12044   5372   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
12045   5373   
                http_response.status()
12046   5374   
            );
12047   5375   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
12048   5376   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
12049   5377   
                http_response.headers(),
12050   5378   
                expected_headers,
12051   5379   
            ));
12052   5380   
        }
12053   5381   
    }
12054         -
    /// Attempted string coercion should result in SerializationException
12055         -
    /// Test ID: RestJsonQueryBooleanStringCoercion_case12
        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
12056   5385   
    #[::tokio::test]
12057         -
    async fn rest_json_query_boolean_string_coercion_case12_malformed_request() {
        5386  +
    #[::tracing_test::traced_test]
        5387  +
    async fn rest_json_header_timestamp_date_time_rejects_different8601_formats_case13_malformed_request(
        5388  +
    ) {
12058   5389   
        {
12059   5390   
            #[allow(unused_mut)]
12060   5391   
            let mut http_request = http::Request::builder()
12061         -
                .uri("/MalformedBoolean/true")
        5392  +
                .uri("/MalformedTimestampHeaderDateTime")
12062   5393   
                .method("POST")
        5394  +
                .header("timestamp", "1996-12-19 16:39:57Z")
12063   5395   
                .body(::aws_smithy_http_server::body::Body::empty())
12064   5396   
                .unwrap();
12065         -
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=FALSE"
12066         -
                .parse()
12067         -
                .unwrap();
12068   5397   
            #[allow(unused_mut)]
12069   5398   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
12070   5399   
            let config = crate::service::RestJsonConfig::builder().build();
12071   5400   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
12072         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        5401  +
                            .malformed_timestamp_header_date_time(move |input: crate::input::MalformedTimestampHeaderDateTimeInput| {
12073   5402   
                                let sender = sender.clone();
12074   5403   
                                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> };
        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> };
12076   5405   
                                    sender.send(()).await.expect("receiver dropped early");
12077   5406   
                                    result
12078   5407   
                                }
12079   5408   
                            })
12080   5409   
                            .build_unchecked();
12081   5410   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
12082   5411   
                .await
12083   5412   
                .expect("unable to make an HTTP request");
12084   5413   
            ::pretty_assertions::assert_eq!(
12085   5414   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
12086   5415   
                http_response.status()
12087   5416   
            );
12088   5417   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
12089   5418   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
12090   5419   
                http_response.headers(),
12091   5420   
                expected_headers,
12092   5421   
            ));
12093   5422   
        }
12094   5423   
    }
12095         -
    /// Attempted string coercion should result in SerializationException
12096         -
    /// Test ID: RestJsonQueryBooleanStringCoercion_case13
        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
12097   5427   
    #[::tokio::test]
12098         -
    async fn rest_json_query_boolean_string_coercion_case13_malformed_request() {
        5428  +
    #[::tracing_test::traced_test]
        5429  +
    async fn rest_json_header_timestamp_date_time_rejects_different8601_formats_case14_malformed_request(
        5430  +
    ) {
12099   5431   
        {
12100   5432   
            #[allow(unused_mut)]
12101   5433   
            let mut http_request = http::Request::builder()
12102         -
                .uri("/MalformedBoolean/true")
        5434  +
                .uri("/MalformedTimestampHeaderDateTime")
12103   5435   
                .method("POST")
        5436  +
                .header("timestamp", "2011-12-03T10:15:30+01:00[Europe/Paris]")
12104   5437   
                .body(::aws_smithy_http_server::body::Body::empty())
12105   5438   
                .unwrap();
12106         -
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=n".parse().unwrap();
12107   5439   
            #[allow(unused_mut)]
12108   5440   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
12109   5441   
            let config = crate::service::RestJsonConfig::builder().build();
12110   5442   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
12111         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        5443  +
                            .malformed_timestamp_header_date_time(move |input: crate::input::MalformedTimestampHeaderDateTimeInput| {
12112   5444   
                                let sender = sender.clone();
12113   5445   
                                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> };
        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> };
12115   5447   
                                    sender.send(()).await.expect("receiver dropped early");
12116   5448   
                                    result
12117   5449   
                                }
12118   5450   
                            })
12119   5451   
                            .build_unchecked();
12120   5452   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
12121   5453   
                .await
12122   5454   
                .expect("unable to make an HTTP request");
12123   5455   
            ::pretty_assertions::assert_eq!(
12124   5456   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
12125   5457   
                http_response.status()
12126   5458   
            );
12127   5459   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
12128   5460   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
12129   5461   
                http_response.headers(),
12130   5462   
                expected_headers,
12131   5463   
            ));
12132   5464   
        }
12133   5465   
    }
12134         -
    /// Attempted string coercion should result in SerializationException
12135         -
    /// Test ID: RestJsonQueryBooleanStringCoercion_case14
        5466  +
}
        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  +
        5568  +
#[allow(unreachable_code, unused_variables)]
        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
12136   5575   
    #[::tokio::test]
12137         -
    async fn rest_json_query_boolean_string_coercion_case14_malformed_request() {
        5576  +
    #[::tracing_test::traced_test]
        5577  +
    async fn rest_json_header_timestamp_default_rejects_date_time_case0_malformed_request() {
12138   5578   
        {
12139   5579   
            #[allow(unused_mut)]
12140   5580   
            let mut http_request = http::Request::builder()
12141         -
                .uri("/MalformedBoolean/true")
        5581  +
                .uri("/MalformedTimestampHeaderDefault")
12142   5582   
                .method("POST")
        5583  +
                .header("timestamp", "1985-04-12T23:20:50.52Z")
12143   5584   
                .body(::aws_smithy_http_server::body::Body::empty())
12144   5585   
                .unwrap();
12145         -
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=N".parse().unwrap();
12146   5586   
            #[allow(unused_mut)]
12147   5587   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
12148   5588   
            let config = crate::service::RestJsonConfig::builder().build();
12149   5589   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
12150         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        5590  +
                            .malformed_timestamp_header_default(move |input: crate::input::MalformedTimestampHeaderDefaultInput| {
12151   5591   
                                let sender = sender.clone();
12152   5592   
                                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> };
        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> };
12154   5594   
                                    sender.send(()).await.expect("receiver dropped early");
12155   5595   
                                    result
12156   5596   
                                }
12157   5597   
                            })
12158   5598   
                            .build_unchecked();
12159   5599   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
12160   5600   
                .await
12161   5601   
                .expect("unable to make an HTTP request");
12162   5602   
            ::pretty_assertions::assert_eq!(
12163   5603   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
12164   5604   
                http_response.status()
12165   5605   
            );
12166   5606   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
12167   5607   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
12168   5608   
                http_response.headers(),
12169   5609   
                expected_headers,
12170   5610   
            ));
12171   5611   
        }
12172   5612   
    }
12173         -
    /// Attempted string coercion should result in SerializationException
12174         -
    /// Test ID: RestJsonQueryBooleanStringCoercion_case15
        5613  +
    /// By default, RFC3339 timestamps are rejected with a
        5614  +
    /// 400 SerializationException
        5615  +
    /// Test ID: RestJsonHeaderTimestampDefaultRejectsDateTime_case1
12175   5616   
    #[::tokio::test]
12176         -
    async fn rest_json_query_boolean_string_coercion_case15_malformed_request() {
        5617  +
    #[::tracing_test::traced_test]
        5618  +
    async fn rest_json_header_timestamp_default_rejects_date_time_case1_malformed_request() {
12177   5619   
        {
12178   5620   
            #[allow(unused_mut)]
12179   5621   
            let mut http_request = http::Request::builder()
12180         -
                .uri("/MalformedBoolean/true")
        5622  +
                .uri("/MalformedTimestampHeaderDefault")
12181   5623   
                .method("POST")
        5624  +
                .header("timestamp", "1985-04-12T23:20:50Z")
12182   5625   
                .body(::aws_smithy_http_server::body::Body::empty())
12183   5626   
                .unwrap();
12184         -
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=no".parse().unwrap();
12185   5627   
            #[allow(unused_mut)]
12186   5628   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
12187   5629   
            let config = crate::service::RestJsonConfig::builder().build();
12188   5630   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
12189         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        5631  +
                            .malformed_timestamp_header_default(move |input: crate::input::MalformedTimestampHeaderDefaultInput| {
12190   5632   
                                let sender = sender.clone();
12191   5633   
                                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> };
        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> };
12193   5635   
                                    sender.send(()).await.expect("receiver dropped early");
12194   5636   
                                    result
12195   5637   
                                }
12196   5638   
                            })
12197   5639   
                            .build_unchecked();
12198   5640   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
12199   5641   
                .await
12200   5642   
                .expect("unable to make an HTTP request");
12201   5643   
            ::pretty_assertions::assert_eq!(
12202   5644   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
12203   5645   
                http_response.status()
12204   5646   
            );
12205   5647   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
12206   5648   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
12207   5649   
                http_response.headers(),
12208   5650   
                expected_headers,
12209   5651   
            ));
12210   5652   
        }
12211   5653   
    }
12212         -
    /// Attempted string coercion should result in SerializationException
12213         -
    /// Test ID: RestJsonQueryBooleanStringCoercion_case16
        5654  +
    /// By default, RFC3339 timestamps are rejected with a
        5655  +
    /// 400 SerializationException
        5656  +
    /// Test ID: RestJsonHeaderTimestampDefaultRejectsDateTime_case2
12214   5657   
    #[::tokio::test]
12215         -
    async fn rest_json_query_boolean_string_coercion_case16_malformed_request() {
        5658  +
    #[::tracing_test::traced_test]
        5659  +
    async fn rest_json_header_timestamp_default_rejects_date_time_case2_malformed_request() {
12216   5660   
        {
12217   5661   
            #[allow(unused_mut)]
12218   5662   
            let mut http_request = http::Request::builder()
12219         -
                .uri("/MalformedBoolean/true")
        5663  +
                .uri("/MalformedTimestampHeaderDefault")
12220   5664   
                .method("POST")
        5665  +
                .header("timestamp", "1996-12-19T16:39:57-08:00")
12221   5666   
                .body(::aws_smithy_http_server::body::Body::empty())
12222   5667   
                .unwrap();
12223         -
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=No".parse().unwrap();
12224   5668   
            #[allow(unused_mut)]
12225   5669   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
12226   5670   
            let config = crate::service::RestJsonConfig::builder().build();
12227   5671   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
12228         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        5672  +
                            .malformed_timestamp_header_default(move |input: crate::input::MalformedTimestampHeaderDefaultInput| {
12229   5673   
                                let sender = sender.clone();
12230   5674   
                                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> };
        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> };
12232   5676   
                                    sender.send(()).await.expect("receiver dropped early");
12233   5677   
                                    result
12234   5678   
                                }
12235   5679   
                            })
12236   5680   
                            .build_unchecked();
12237   5681   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
12238   5682   
                .await
12239   5683   
                .expect("unable to make an HTTP request");
12240   5684   
            ::pretty_assertions::assert_eq!(
12241   5685   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
12242   5686   
                http_response.status()
12243   5687   
            );
12244   5688   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
12245   5689   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
12246   5690   
                http_response.headers(),
12247   5691   
                expected_headers,
12248   5692   
            ));
12249   5693   
        }
12250   5694   
    }
12251         -
    /// Attempted string coercion should result in SerializationException
12252         -
    /// Test ID: RestJsonQueryBooleanStringCoercion_case17
        5695  +
    /// By default, epoch second timestamps are rejected with a
        5696  +
    /// 400 SerializationException
        5697  +
    /// Test ID: RestJsonHeaderTimestampDefaultRejectsEpochSeconds_case0
12253   5698   
    #[::tokio::test]
12254         -
    async fn rest_json_query_boolean_string_coercion_case17_malformed_request() {
        5699  +
    #[::tracing_test::traced_test]
        5700  +
    async fn rest_json_header_timestamp_default_rejects_epoch_seconds_case0_malformed_request() {
12255   5701   
        {
12256   5702   
            #[allow(unused_mut)]
12257   5703   
            let mut http_request = http::Request::builder()
12258         -
                .uri("/MalformedBoolean/true")
        5704  +
                .uri("/MalformedTimestampHeaderDefault")
12259   5705   
                .method("POST")
        5706  +
                .header("timestamp", "1515531081.1234")
12260   5707   
                .body(::aws_smithy_http_server::body::Body::empty())
12261   5708   
                .unwrap();
12262         -
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=NO".parse().unwrap();
12263   5709   
            #[allow(unused_mut)]
12264   5710   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
12265   5711   
            let config = crate::service::RestJsonConfig::builder().build();
12266   5712   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
12267         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        5713  +
                            .malformed_timestamp_header_default(move |input: crate::input::MalformedTimestampHeaderDefaultInput| {
12268   5714   
                                let sender = sender.clone();
12269   5715   
                                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> };
        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> };
12271   5717   
                                    sender.send(()).await.expect("receiver dropped early");
12272   5718   
                                    result
12273   5719   
                                }
12274   5720   
                            })
12275   5721   
                            .build_unchecked();
12276   5722   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
12277   5723   
                .await
12278   5724   
                .expect("unable to make an HTTP request");
12279   5725   
            ::pretty_assertions::assert_eq!(
12280   5726   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
12281   5727   
                http_response.status()
12282   5728   
            );
12283   5729   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
12284   5730   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
12285   5731   
                http_response.headers(),
12286   5732   
                expected_headers,
12287   5733   
            ));
12288   5734   
        }
12289   5735   
    }
12290         -
    /// Attempted string coercion should result in SerializationException
12291         -
    /// Test ID: RestJsonQueryBooleanStringCoercion_case18
        5736  +
    /// By default, epoch second timestamps are rejected with a
        5737  +
    /// 400 SerializationException
        5738  +
    /// Test ID: RestJsonHeaderTimestampDefaultRejectsEpochSeconds_case1
12292   5739   
    #[::tokio::test]
12293         -
    async fn rest_json_query_boolean_string_coercion_case18_malformed_request() {
        5740  +
    #[::tracing_test::traced_test]
        5741  +
    async fn rest_json_header_timestamp_default_rejects_epoch_seconds_case1_malformed_request() {
12294   5742   
        {
12295   5743   
            #[allow(unused_mut)]
12296   5744   
            let mut http_request = http::Request::builder()
12297         -
                .uri("/MalformedBoolean/true")
        5745  +
                .uri("/MalformedTimestampHeaderDefault")
12298   5746   
                .method("POST")
        5747  +
                .header("timestamp", "1515531081")
12299   5748   
                .body(::aws_smithy_http_server::body::Body::empty())
12300   5749   
                .unwrap();
12301         -
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=0".parse().unwrap();
12302   5750   
            #[allow(unused_mut)]
12303   5751   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
12304   5752   
            let config = crate::service::RestJsonConfig::builder().build();
12305   5753   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
12306         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        5754  +
                            .malformed_timestamp_header_default(move |input: crate::input::MalformedTimestampHeaderDefaultInput| {
12307   5755   
                                let sender = sender.clone();
12308   5756   
                                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> };
        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> };
12310   5758   
                                    sender.send(()).await.expect("receiver dropped early");
12311   5759   
                                    result
12312   5760   
                                }
12313   5761   
                            })
12314   5762   
                            .build_unchecked();
12315   5763   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
12316   5764   
                .await
12317   5765   
                .expect("unable to make an HTTP request");
12318   5766   
            ::pretty_assertions::assert_eq!(
12319   5767   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
12320   5768   
                http_response.status()
12321   5769   
            );
12322   5770   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
12323   5771   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
12324   5772   
                http_response.headers(),
12325   5773   
                expected_headers,
12326   5774   
            ));
12327   5775   
        }
12328   5776   
    }
12329         -
    /// Attempted string coercion should result in SerializationException
12330         -
    /// Test ID: RestJsonQueryBooleanStringCoercion_case19
        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
12331   5886   
    #[::tokio::test]
12332         -
    async fn rest_json_query_boolean_string_coercion_case19_malformed_request() {
        5887  +
    #[::tracing_test::traced_test]
        5888  +
    async fn rest_json_query_timestamp_epoch_rejects_date_time_case0_malformed_request() {
12333   5889   
        {
12334   5890   
            #[allow(unused_mut)]
12335   5891   
            let mut http_request = http::Request::builder()
12336         -
                .uri("/MalformedBoolean/true")
        5892  +
                .uri("/MalformedTimestampQueryEpoch")
12337   5893   
                .method("POST")
12338   5894   
                .body(::aws_smithy_http_server::body::Body::empty())
12339   5895   
                .unwrap();
12340         -
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=off".parse().unwrap();
        5896  +
            *http_request.uri_mut() =
        5897  +
                "/MalformedTimestampQueryEpoch?timestamp=1985-04-12T23%3A20%3A50.52Z"
        5898  +
                    .parse()
        5899  +
                    .unwrap();
12341   5900   
            #[allow(unused_mut)]
12342   5901   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
12343   5902   
            let config = crate::service::RestJsonConfig::builder().build();
12344   5903   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
12345         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        5904  +
                            .malformed_timestamp_query_epoch(move |input: crate::input::MalformedTimestampQueryEpochInput| {
12346   5905   
                                let sender = sender.clone();
12347   5906   
                                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> };
        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> };
12349   5908   
                                    sender.send(()).await.expect("receiver dropped early");
12350   5909   
                                    result
12351   5910   
                                }
12352   5911   
                            })
12353   5912   
                            .build_unchecked();
12354   5913   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
12355   5914   
                .await
12356   5915   
                .expect("unable to make an HTTP request");
12357   5916   
            ::pretty_assertions::assert_eq!(
12358   5917   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
12359   5918   
                http_response.status()
12360   5919   
            );
12361   5920   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
12362   5921   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
12363   5922   
                http_response.headers(),
12364   5923   
                expected_headers,
12365   5924   
            ));
12366   5925   
        }
12367   5926   
    }
12368         -
    /// Attempted string coercion should result in SerializationException
12369         -
    /// Test ID: RestJsonQueryBooleanStringCoercion_case20
        5927  +
    /// When the format is epoch-seconds, RFC3339 timestamps are rejected with a
        5928  +
    /// 400 SerializationException
        5929  +
    /// Test ID: RestJsonQueryTimestampEpochRejectsDateTime_case1
12370   5930   
    #[::tokio::test]
12371         -
    async fn rest_json_query_boolean_string_coercion_case20_malformed_request() {
        5931  +
    #[::tracing_test::traced_test]
        5932  +
    async fn rest_json_query_timestamp_epoch_rejects_date_time_case1_malformed_request() {
12372   5933   
        {
12373   5934   
            #[allow(unused_mut)]
12374   5935   
            let mut http_request = http::Request::builder()
12375         -
                .uri("/MalformedBoolean/true")
        5936  +
                .uri("/MalformedTimestampQueryEpoch")
12376   5937   
                .method("POST")
12377   5938   
                .body(::aws_smithy_http_server::body::Body::empty())
12378   5939   
                .unwrap();
12379         -
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=Off".parse().unwrap();
        5940  +
            *http_request.uri_mut() =
        5941  +
                "/MalformedTimestampQueryEpoch?timestamp=1985-04-12T23%3A20%3A50Z"
        5942  +
                    .parse()
        5943  +
                    .unwrap();
12380   5944   
            #[allow(unused_mut)]
12381   5945   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
12382   5946   
            let config = crate::service::RestJsonConfig::builder().build();
12383   5947   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
12384         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        5948  +
                            .malformed_timestamp_query_epoch(move |input: crate::input::MalformedTimestampQueryEpochInput| {
12385   5949   
                                let sender = sender.clone();
12386   5950   
                                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> };
        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> };
12388   5952   
                                    sender.send(()).await.expect("receiver dropped early");
12389   5953   
                                    result
12390   5954   
                                }
12391   5955   
                            })
12392   5956   
                            .build_unchecked();
12393   5957   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
12394   5958   
                .await
12395   5959   
                .expect("unable to make an HTTP request");
12396   5960   
            ::pretty_assertions::assert_eq!(
12397   5961   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
12398   5962   
                http_response.status()
12399   5963   
            );
12400   5964   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
12401   5965   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
12402   5966   
                http_response.headers(),
12403   5967   
                expected_headers,
12404   5968   
            ));
12405   5969   
        }
12406   5970   
    }
12407         -
    /// Attempted string coercion should result in SerializationException
12408         -
    /// Test ID: RestJsonQueryBooleanStringCoercion_case21
        5971  +
    /// When the format is epoch-seconds, RFC3339 timestamps are rejected with a
        5972  +
    /// 400 SerializationException
        5973  +
    /// Test ID: RestJsonQueryTimestampEpochRejectsDateTime_case2
12409   5974   
    #[::tokio::test]
12410         -
    async fn rest_json_query_boolean_string_coercion_case21_malformed_request() {
        5975  +
    #[::tracing_test::traced_test]
        5976  +
    async fn rest_json_query_timestamp_epoch_rejects_date_time_case2_malformed_request() {
12411   5977   
        {
12412   5978   
            #[allow(unused_mut)]
12413   5979   
            let mut http_request = http::Request::builder()
12414         -
                .uri("/MalformedBoolean/true")
        5980  +
                .uri("/MalformedTimestampQueryEpoch")
12415   5981   
                .method("POST")
12416   5982   
                .body(::aws_smithy_http_server::body::Body::empty())
12417   5983   
                .unwrap();
12418         -
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=OFF".parse().unwrap();
        5984  +
            *http_request.uri_mut() =
        5985  +
                "/MalformedTimestampQueryEpoch?timestamp=1996-12-19T16%3A39%3A57-08%3A00"
        5986  +
                    .parse()
        5987  +
                    .unwrap();
12419   5988   
            #[allow(unused_mut)]
12420   5989   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
12421   5990   
            let config = crate::service::RestJsonConfig::builder().build();
12422   5991   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
12423         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        5992  +
                            .malformed_timestamp_query_epoch(move |input: crate::input::MalformedTimestampQueryEpochInput| {
12424   5993   
                                let sender = sender.clone();
12425   5994   
                                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> };
        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> };
12427   5996   
                                    sender.send(()).await.expect("receiver dropped early");
12428   5997   
                                    result
12429   5998   
                                }
12430   5999   
                            })
12431   6000   
                            .build_unchecked();
12432   6001   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
12433   6002   
                .await
12434   6003   
                .expect("unable to make an HTTP request");
12435   6004   
            ::pretty_assertions::assert_eq!(
12436   6005   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
12437   6006   
                http_response.status()
12438   6007   
            );
12439   6008   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
12440   6009   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
12441   6010   
                http_response.headers(),
12442   6011   
                expected_headers,
12443   6012   
            ));
12444   6013   
        }
12445   6014   
    }
12446         -
    /// Attempted string coercion should result in SerializationException
12447         -
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case0
        6015  +
    /// When the format is epoch-seconds, IMF-fixdate timestamps are rejected with a
        6016  +
    /// 400 SerializationException
        6017  +
    /// Test ID: RestJsonQueryTimestampEpochRejectsHttpDate_case0
12448   6018   
    #[::tokio::test]
12449         -
    async fn rest_json_header_boolean_string_coercion_case0_malformed_request() {
        6019  +
    #[::tracing_test::traced_test]
        6020  +
    async fn rest_json_query_timestamp_epoch_rejects_http_date_case0_malformed_request() {
12450   6021   
        {
12451   6022   
            #[allow(unused_mut)]
12452   6023   
            let mut http_request = http::Request::builder()
12453         -
                .uri("/MalformedBoolean/true")
        6024  +
                .uri("/MalformedTimestampQueryEpoch")
12454   6025   
                .method("POST")
12455         -
                .header("booleanInHeader", "True")
12456   6026   
                .body(::aws_smithy_http_server::body::Body::empty())
12457   6027   
                .unwrap();
        6028  +
            *http_request.uri_mut() = "/MalformedTimestampQueryEpoch?timestamp=Tue%2C%2029%20Apr%202014%2018%3A30%3A38%20GMT".parse().unwrap();
12458   6029   
            #[allow(unused_mut)]
12459   6030   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
12460   6031   
            let config = crate::service::RestJsonConfig::builder().build();
12461   6032   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
12462         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        6033  +
                            .malformed_timestamp_query_epoch(move |input: crate::input::MalformedTimestampQueryEpochInput| {
12463   6034   
                                let sender = sender.clone();
12464   6035   
                                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> };
        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> };
12466   6037   
                                    sender.send(()).await.expect("receiver dropped early");
12467   6038   
                                    result
12468   6039   
                                }
12469   6040   
                            })
12470   6041   
                            .build_unchecked();
12471   6042   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
12472   6043   
                .await
12473   6044   
                .expect("unable to make an HTTP request");
12474   6045   
            ::pretty_assertions::assert_eq!(
12475   6046   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
12476   6047   
                http_response.status()
12477   6048   
            );
12478   6049   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
12479   6050   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
12480   6051   
                http_response.headers(),
12481   6052   
                expected_headers,
12482   6053   
            ));
12483   6054   
        }
12484   6055   
    }
12485         -
    /// Attempted string coercion should result in SerializationException
12486         -
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case1
        6056  +
    /// When the format is epoch-seconds, IMF-fixdate timestamps are rejected with a
        6057  +
    /// 400 SerializationException
        6058  +
    /// Test ID: RestJsonQueryTimestampEpochRejectsHttpDate_case1
12487   6059   
    #[::tokio::test]
12488         -
    async fn rest_json_header_boolean_string_coercion_case1_malformed_request() {
        6060  +
    #[::tracing_test::traced_test]
        6061  +
    async fn rest_json_query_timestamp_epoch_rejects_http_date_case1_malformed_request() {
12489   6062   
        {
12490   6063   
            #[allow(unused_mut)]
12491   6064   
            let mut http_request = http::Request::builder()
12492         -
                .uri("/MalformedBoolean/true")
        6065  +
                .uri("/MalformedTimestampQueryEpoch")
12493   6066   
                .method("POST")
12494         -
                .header("booleanInHeader", "TRUE")
12495   6067   
                .body(::aws_smithy_http_server::body::Body::empty())
12496   6068   
                .unwrap();
        6069  +
            *http_request.uri_mut() = "/MalformedTimestampQueryEpoch?timestamp=Sun%2C%2002%20Jan%202000%2020%3A34%3A56.000%20GMT".parse().unwrap();
12497   6070   
            #[allow(unused_mut)]
12498   6071   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
12499   6072   
            let config = crate::service::RestJsonConfig::builder().build();
12500   6073   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
12501         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        6074  +
                            .malformed_timestamp_query_epoch(move |input: crate::input::MalformedTimestampQueryEpochInput| {
12502   6075   
                                let sender = sender.clone();
12503   6076   
                                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> };
        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> };
12505   6078   
                                    sender.send(()).await.expect("receiver dropped early");
12506   6079   
                                    result
12507   6080   
                                }
12508   6081   
                            })
12509   6082   
                            .build_unchecked();
12510   6083   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
12511   6084   
                .await
12512   6085   
                .expect("unable to make an HTTP request");
12513   6086   
            ::pretty_assertions::assert_eq!(
12514   6087   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
12515   6088   
                http_response.status()
12516   6089   
            );
12517   6090   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
12518   6091   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
12519   6092   
                http_response.headers(),
12520   6093   
                expected_headers,
12521   6094   
            ));
12522   6095   
        }
12523   6096   
    }
12524         -
    /// Attempted string coercion should result in SerializationException
12525         -
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case2
        6097  +
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
        6098  +
    /// Test ID: RestJsonQueryTimestampEpochRejectsMalformedValues_case0
12526   6099   
    #[::tokio::test]
12527         -
    async fn rest_json_header_boolean_string_coercion_case2_malformed_request() {
        6100  +
    #[::tracing_test::traced_test]
        6101  +
    async fn rest_json_query_timestamp_epoch_rejects_malformed_values_case0_malformed_request() {
12528   6102   
        {
12529   6103   
            #[allow(unused_mut)]
12530   6104   
            let mut http_request = http::Request::builder()
12531         -
                .uri("/MalformedBoolean/true")
        6105  +
                .uri("/MalformedTimestampQueryEpoch")
12532   6106   
                .method("POST")
12533         -
                .header("booleanInHeader", "y")
12534   6107   
                .body(::aws_smithy_http_server::body::Body::empty())
12535   6108   
                .unwrap();
        6109  +
            *http_request.uri_mut() = "/MalformedTimestampQueryEpoch?timestamp=true"
        6110  +
                .parse()
        6111  +
                .unwrap();
12536   6112   
            #[allow(unused_mut)]
12537   6113   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
12538   6114   
            let config = crate::service::RestJsonConfig::builder().build();
12539   6115   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
12540         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        6116  +
                            .malformed_timestamp_query_epoch(move |input: crate::input::MalformedTimestampQueryEpochInput| {
12541   6117   
                                let sender = sender.clone();
12542   6118   
                                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> };
        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> };
12544   6120   
                                    sender.send(()).await.expect("receiver dropped early");
12545   6121   
                                    result
12546   6122   
                                }
12547   6123   
                            })
12548   6124   
                            .build_unchecked();
12549   6125   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
12550   6126   
                .await
12551   6127   
                .expect("unable to make an HTTP request");
12552   6128   
            ::pretty_assertions::assert_eq!(
12553   6129   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
12554   6130   
                http_response.status()
12555   6131   
            );
12556   6132   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
12557   6133   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
12558   6134   
                http_response.headers(),
12559   6135   
                expected_headers,
12560   6136   
            ));
12561   6137   
        }
12562   6138   
    }
12563         -
    /// Attempted string coercion should result in SerializationException
12564         -
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case3
        6139  +
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
        6140  +
    /// Test ID: RestJsonQueryTimestampEpochRejectsMalformedValues_case1
12565   6141   
    #[::tokio::test]
12566         -
    async fn rest_json_header_boolean_string_coercion_case3_malformed_request() {
        6142  +
    #[::tracing_test::traced_test]
        6143  +
    async fn rest_json_query_timestamp_epoch_rejects_malformed_values_case1_malformed_request() {
12567   6144   
        {
12568   6145   
            #[allow(unused_mut)]
12569   6146   
            let mut http_request = http::Request::builder()
12570         -
                .uri("/MalformedBoolean/true")
        6147  +
                .uri("/MalformedTimestampQueryEpoch")
12571   6148   
                .method("POST")
12572         -
                .header("booleanInHeader", "Y")
12573   6149   
                .body(::aws_smithy_http_server::body::Body::empty())
12574   6150   
                .unwrap();
        6151  +
            *http_request.uri_mut() = "/MalformedTimestampQueryEpoch?timestamp=1515531081ABC"
        6152  +
                .parse()
        6153  +
                .unwrap();
12575   6154   
            #[allow(unused_mut)]
12576   6155   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
12577   6156   
            let config = crate::service::RestJsonConfig::builder().build();
12578   6157   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
12579         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        6158  +
                            .malformed_timestamp_query_epoch(move |input: crate::input::MalformedTimestampQueryEpochInput| {
12580   6159   
                                let sender = sender.clone();
12581   6160   
                                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> };
        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> };
12583   6162   
                                    sender.send(()).await.expect("receiver dropped early");
12584   6163   
                                    result
12585   6164   
                                }
12586   6165   
                            })
12587   6166   
                            .build_unchecked();
12588   6167   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
12589   6168   
                .await
12590   6169   
                .expect("unable to make an HTTP request");
12591   6170   
            ::pretty_assertions::assert_eq!(
12592   6171   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
12593   6172   
                http_response.status()
12594   6173   
            );
12595   6174   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
12596   6175   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
12597   6176   
                http_response.headers(),
12598   6177   
                expected_headers,
12599   6178   
            ));
12600   6179   
        }
12601   6180   
    }
12602         -
    /// Attempted string coercion should result in SerializationException
12603         -
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case4
        6181  +
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
        6182  +
    /// Test ID: RestJsonQueryTimestampEpochRejectsMalformedValues_case2
12604   6183   
    #[::tokio::test]
12605         -
    async fn rest_json_header_boolean_string_coercion_case4_malformed_request() {
        6184  +
    #[::tracing_test::traced_test]
        6185  +
    async fn rest_json_query_timestamp_epoch_rejects_malformed_values_case2_malformed_request() {
12606   6186   
        {
12607   6187   
            #[allow(unused_mut)]
12608   6188   
            let mut http_request = http::Request::builder()
12609         -
                .uri("/MalformedBoolean/true")
        6189  +
                .uri("/MalformedTimestampQueryEpoch")
12610   6190   
                .method("POST")
12611         -
                .header("booleanInHeader", "yes")
12612   6191   
                .body(::aws_smithy_http_server::body::Body::empty())
12613   6192   
                .unwrap();
        6193  +
            *http_request.uri_mut() = "/MalformedTimestampQueryEpoch?timestamp=0x42"
        6194  +
                .parse()
        6195  +
                .unwrap();
12614   6196   
            #[allow(unused_mut)]
12615   6197   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
12616   6198   
            let config = crate::service::RestJsonConfig::builder().build();
12617   6199   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
12618         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        6200  +
                            .malformed_timestamp_query_epoch(move |input: crate::input::MalformedTimestampQueryEpochInput| {
12619   6201   
                                let sender = sender.clone();
12620   6202   
                                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> };
        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> };
12622   6204   
                                    sender.send(()).await.expect("receiver dropped early");
12623   6205   
                                    result
12624   6206   
                                }
12625   6207   
                            })
12626   6208   
                            .build_unchecked();
12627   6209   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
12628   6210   
                .await
12629   6211   
                .expect("unable to make an HTTP request");
12630   6212   
            ::pretty_assertions::assert_eq!(
12631   6213   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
12632   6214   
                http_response.status()
12633   6215   
            );
12634   6216   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
12635   6217   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
12636   6218   
                http_response.headers(),
12637   6219   
                expected_headers,
12638   6220   
            ));
12639   6221   
        }
12640   6222   
    }
12641         -
    /// Attempted string coercion should result in SerializationException
12642         -
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case5
        6223  +
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
        6224  +
    /// Test ID: RestJsonQueryTimestampEpochRejectsMalformedValues_case3
12643   6225   
    #[::tokio::test]
12644         -
    async fn rest_json_header_boolean_string_coercion_case5_malformed_request() {
        6226  +
    #[::tracing_test::traced_test]
        6227  +
    async fn rest_json_query_timestamp_epoch_rejects_malformed_values_case3_malformed_request() {
12645   6228   
        {
12646   6229   
            #[allow(unused_mut)]
12647   6230   
            let mut http_request = http::Request::builder()
12648         -
                .uri("/MalformedBoolean/true")
        6231  +
                .uri("/MalformedTimestampQueryEpoch")
12649   6232   
                .method("POST")
12650         -
                .header("booleanInHeader", "Yes")
12651   6233   
                .body(::aws_smithy_http_server::body::Body::empty())
12652   6234   
                .unwrap();
        6235  +
            *http_request.uri_mut() = "/MalformedTimestampQueryEpoch?timestamp=1515531081.123.456"
        6236  +
                .parse()
        6237  +
                .unwrap();
12653   6238   
            #[allow(unused_mut)]
12654   6239   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
12655   6240   
            let config = crate::service::RestJsonConfig::builder().build();
12656   6241   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
12657         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        6242  +
                            .malformed_timestamp_query_epoch(move |input: crate::input::MalformedTimestampQueryEpochInput| {
12658   6243   
                                let sender = sender.clone();
12659   6244   
                                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> };
        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> };
12661   6246   
                                    sender.send(()).await.expect("receiver dropped early");
12662   6247   
                                    result
12663   6248   
                                }
12664   6249   
                            })
12665   6250   
                            .build_unchecked();
12666   6251   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
12667   6252   
                .await
12668   6253   
                .expect("unable to make an HTTP request");
12669   6254   
            ::pretty_assertions::assert_eq!(
12670   6255   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
12671   6256   
                http_response.status()
12672   6257   
            );
12673   6258   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
12674   6259   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
12675   6260   
                http_response.headers(),
12676   6261   
                expected_headers,
12677   6262   
            ));
12678   6263   
        }
12679   6264   
    }
12680         -
    /// Attempted string coercion should result in SerializationException
12681         -
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case6
        6265  +
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
        6266  +
    /// Test ID: RestJsonQueryTimestampEpochRejectsMalformedValues_case4
12682   6267   
    #[::tokio::test]
12683         -
    async fn rest_json_header_boolean_string_coercion_case6_malformed_request() {
        6268  +
    #[::tracing_test::traced_test]
        6269  +
    async fn rest_json_query_timestamp_epoch_rejects_malformed_values_case4_malformed_request() {
12684   6270   
        {
12685   6271   
            #[allow(unused_mut)]
12686   6272   
            let mut http_request = http::Request::builder()
12687         -
                .uri("/MalformedBoolean/true")
        6273  +
                .uri("/MalformedTimestampQueryEpoch")
12688   6274   
                .method("POST")
12689         -
                .header("booleanInHeader", "YES")
12690   6275   
                .body(::aws_smithy_http_server::body::Body::empty())
12691   6276   
                .unwrap();
        6277  +
            *http_request.uri_mut() = "/MalformedTimestampQueryEpoch?timestamp=Infinity"
        6278  +
                .parse()
        6279  +
                .unwrap();
12692   6280   
            #[allow(unused_mut)]
12693   6281   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
12694   6282   
            let config = crate::service::RestJsonConfig::builder().build();
12695   6283   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
12696         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        6284  +
                            .malformed_timestamp_query_epoch(move |input: crate::input::MalformedTimestampQueryEpochInput| {
12697   6285   
                                let sender = sender.clone();
12698   6286   
                                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> };
        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> };
12700   6288   
                                    sender.send(()).await.expect("receiver dropped early");
12701   6289   
                                    result
12702   6290   
                                }
12703   6291   
                            })
12704   6292   
                            .build_unchecked();
12705   6293   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
12706   6294   
                .await
12707   6295   
                .expect("unable to make an HTTP request");
12708   6296   
            ::pretty_assertions::assert_eq!(
12709   6297   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
12710   6298   
                http_response.status()
12711   6299   
            );
12712   6300   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
12713   6301   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
12714   6302   
                http_response.headers(),
12715   6303   
                expected_headers,
12716   6304   
            ));
12717   6305   
        }
12718   6306   
    }
12719         -
    /// Attempted string coercion should result in SerializationException
12720         -
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case7
        6307  +
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
        6308  +
    /// Test ID: RestJsonQueryTimestampEpochRejectsMalformedValues_case5
12721   6309   
    #[::tokio::test]
12722         -
    async fn rest_json_header_boolean_string_coercion_case7_malformed_request() {
        6310  +
    #[::tracing_test::traced_test]
        6311  +
    async fn rest_json_query_timestamp_epoch_rejects_malformed_values_case5_malformed_request() {
12723   6312   
        {
12724   6313   
            #[allow(unused_mut)]
12725   6314   
            let mut http_request = http::Request::builder()
12726         -
                .uri("/MalformedBoolean/true")
        6315  +
                .uri("/MalformedTimestampQueryEpoch")
12727   6316   
                .method("POST")
12728         -
                .header("booleanInHeader", "1")
12729   6317   
                .body(::aws_smithy_http_server::body::Body::empty())
12730   6318   
                .unwrap();
        6319  +
            *http_request.uri_mut() = "/MalformedTimestampQueryEpoch?timestamp=-Infinity"
        6320  +
                .parse()
        6321  +
                .unwrap();
12731   6322   
            #[allow(unused_mut)]
12732   6323   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
12733   6324   
            let config = crate::service::RestJsonConfig::builder().build();
12734   6325   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
12735         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        6326  +
                            .malformed_timestamp_query_epoch(move |input: crate::input::MalformedTimestampQueryEpochInput| {
12736   6327   
                                let sender = sender.clone();
12737   6328   
                                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> };
        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> };
12739   6330   
                                    sender.send(()).await.expect("receiver dropped early");
12740   6331   
                                    result
12741   6332   
                                }
12742   6333   
                            })
12743   6334   
                            .build_unchecked();
12744   6335   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
12745   6336   
                .await
12746   6337   
                .expect("unable to make an HTTP request");
12747   6338   
            ::pretty_assertions::assert_eq!(
12748   6339   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
12749   6340   
                http_response.status()
12750   6341   
            );
12751   6342   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
12752   6343   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
12753   6344   
                http_response.headers(),
12754   6345   
                expected_headers,
12755   6346   
            ));
12756   6347   
        }
12757   6348   
    }
12758         -
    /// Attempted string coercion should result in SerializationException
12759         -
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case8
        6349  +
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
        6350  +
    /// Test ID: RestJsonQueryTimestampEpochRejectsMalformedValues_case6
12760   6351   
    #[::tokio::test]
12761         -
    async fn rest_json_header_boolean_string_coercion_case8_malformed_request() {
        6352  +
    #[::tracing_test::traced_test]
        6353  +
    async fn rest_json_query_timestamp_epoch_rejects_malformed_values_case6_malformed_request() {
12762   6354   
        {
12763   6355   
            #[allow(unused_mut)]
12764   6356   
            let mut http_request = http::Request::builder()
12765         -
                .uri("/MalformedBoolean/true")
        6357  +
                .uri("/MalformedTimestampQueryEpoch")
12766   6358   
                .method("POST")
12767         -
                .header("booleanInHeader", "on")
12768   6359   
                .body(::aws_smithy_http_server::body::Body::empty())
12769   6360   
                .unwrap();
        6361  +
            *http_request.uri_mut() = "/MalformedTimestampQueryEpoch?timestamp=NaN"
        6362  +
                .parse()
        6363  +
                .unwrap();
12770   6364   
            #[allow(unused_mut)]
12771   6365   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
12772   6366   
            let config = crate::service::RestJsonConfig::builder().build();
12773   6367   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
12774         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        6368  +
                            .malformed_timestamp_query_epoch(move |input: crate::input::MalformedTimestampQueryEpochInput| {
12775   6369   
                                let sender = sender.clone();
12776   6370   
                                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> };
        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> };
12778   6372   
                                    sender.send(()).await.expect("receiver dropped early");
12779   6373   
                                    result
12780   6374   
                                }
12781   6375   
                            })
12782   6376   
                            .build_unchecked();
12783   6377   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
12784   6378   
                .await
12785   6379   
                .expect("unable to make an HTTP request");
12786   6380   
            ::pretty_assertions::assert_eq!(
12787   6381   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
12788   6382   
                http_response.status()
12789   6383   
            );
12790   6384   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
12791   6385   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
12792   6386   
                http_response.headers(),
12793   6387   
                expected_headers,
12794   6388   
            ));
12795   6389   
        }
12796   6390   
    }
12797         -
    /// Attempted string coercion should result in SerializationException
12798         -
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case9
        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
12799   6500   
    #[::tokio::test]
12800         -
    async fn rest_json_header_boolean_string_coercion_case9_malformed_request() {
        6501  +
    #[::tracing_test::traced_test]
        6502  +
    async fn rest_json_query_timestamp_http_date_rejects_date_time_case0_malformed_request() {
12801   6503   
        {
12802   6504   
            #[allow(unused_mut)]
12803   6505   
            let mut http_request = http::Request::builder()
12804         -
                .uri("/MalformedBoolean/true")
        6506  +
                .uri("/MalformedTimestampQueryHttpDate")
12805   6507   
                .method("POST")
12806         -
                .header("booleanInHeader", "On")
12807   6508   
                .body(::aws_smithy_http_server::body::Body::empty())
12808   6509   
                .unwrap();
        6510  +
            *http_request.uri_mut() =
        6511  +
                "/MalformedTimestampQueryHttpDate?timestamp=1985-04-12T23%3A20%3A50.52Z"
        6512  +
                    .parse()
        6513  +
                    .unwrap();
12809   6514   
            #[allow(unused_mut)]
12810   6515   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
12811   6516   
            let config = crate::service::RestJsonConfig::builder().build();
12812   6517   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
12813         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        6518  +
                            .malformed_timestamp_query_http_date(move |input: crate::input::MalformedTimestampQueryHttpDateInput| {
12814   6519   
                                let sender = sender.clone();
12815   6520   
                                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> };
        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> };
12817   6522   
                                    sender.send(()).await.expect("receiver dropped early");
12818   6523   
                                    result
12819   6524   
                                }
12820   6525   
                            })
12821   6526   
                            .build_unchecked();
12822   6527   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
12823   6528   
                .await
12824   6529   
                .expect("unable to make an HTTP request");
12825   6530   
            ::pretty_assertions::assert_eq!(
12826   6531   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
12827   6532   
                http_response.status()
12828   6533   
            );
12829   6534   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
12830   6535   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
12831   6536   
                http_response.headers(),
12832   6537   
                expected_headers,
12833   6538   
            ));
12834   6539   
        }
12835   6540   
    }
12836         -
    /// Attempted string coercion should result in SerializationException
12837         -
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case10
        6541  +
    /// When the format is http-date, RFC3339 timestamps are rejected with a
        6542  +
    /// 400 SerializationException
        6543  +
    /// Test ID: RestJsonQueryTimestampHttpDateRejectsDateTime_case1
12838   6544   
    #[::tokio::test]
12839         -
    async fn rest_json_header_boolean_string_coercion_case10_malformed_request() {
        6545  +
    #[::tracing_test::traced_test]
        6546  +
    async fn rest_json_query_timestamp_http_date_rejects_date_time_case1_malformed_request() {
12840   6547   
        {
12841   6548   
            #[allow(unused_mut)]
12842   6549   
            let mut http_request = http::Request::builder()
12843         -
                .uri("/MalformedBoolean/true")
        6550  +
                .uri("/MalformedTimestampQueryHttpDate")
12844   6551   
                .method("POST")
12845         -
                .header("booleanInHeader", "ON")
12846   6552   
                .body(::aws_smithy_http_server::body::Body::empty())
12847   6553   
                .unwrap();
        6554  +
            *http_request.uri_mut() =
        6555  +
                "/MalformedTimestampQueryHttpDate?timestamp=1985-04-12T23%3A20%3A50Z"
        6556  +
                    .parse()
        6557  +
                    .unwrap();
12848   6558   
            #[allow(unused_mut)]
12849   6559   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
12850   6560   
            let config = crate::service::RestJsonConfig::builder().build();
12851   6561   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
12852         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        6562  +
                            .malformed_timestamp_query_http_date(move |input: crate::input::MalformedTimestampQueryHttpDateInput| {
12853   6563   
                                let sender = sender.clone();
12854   6564   
                                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> };
        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> };
12856   6566   
                                    sender.send(()).await.expect("receiver dropped early");
12857   6567   
                                    result
12858   6568   
                                }
12859   6569   
                            })
12860   6570   
                            .build_unchecked();
12861   6571   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
12862   6572   
                .await
12863   6573   
                .expect("unable to make an HTTP request");
12864   6574   
            ::pretty_assertions::assert_eq!(
12865   6575   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
12866   6576   
                http_response.status()
12867   6577   
            );
12868   6578   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
12869   6579   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
12870   6580   
                http_response.headers(),
12871   6581   
                expected_headers,
12872   6582   
            ));
12873   6583   
        }
12874   6584   
    }
12875         -
    /// Attempted string coercion should result in SerializationException
12876         -
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case11
        6585  +
    /// When the format is http-date, RFC3339 timestamps are rejected with a
        6586  +
    /// 400 SerializationException
        6587  +
    /// Test ID: RestJsonQueryTimestampHttpDateRejectsDateTime_case2
12877   6588   
    #[::tokio::test]
12878         -
    async fn rest_json_header_boolean_string_coercion_case11_malformed_request() {
        6589  +
    #[::tracing_test::traced_test]
        6590  +
    async fn rest_json_query_timestamp_http_date_rejects_date_time_case2_malformed_request() {
12879   6591   
        {
12880   6592   
            #[allow(unused_mut)]
12881   6593   
            let mut http_request = http::Request::builder()
12882         -
                .uri("/MalformedBoolean/true")
        6594  +
                .uri("/MalformedTimestampQueryHttpDate")
12883   6595   
                .method("POST")
12884         -
                .header("booleanInHeader", "False")
12885   6596   
                .body(::aws_smithy_http_server::body::Body::empty())
12886   6597   
                .unwrap();
        6598  +
            *http_request.uri_mut() =
        6599  +
                "/MalformedTimestampQueryHttpDate?timestamp=1996-12-19T16%3A39%3A57-08%3A00"
        6600  +
                    .parse()
        6601  +
                    .unwrap();
12887   6602   
            #[allow(unused_mut)]
12888   6603   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
12889   6604   
            let config = crate::service::RestJsonConfig::builder().build();
12890   6605   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
12891         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        6606  +
                            .malformed_timestamp_query_http_date(move |input: crate::input::MalformedTimestampQueryHttpDateInput| {
12892   6607   
                                let sender = sender.clone();
12893   6608   
                                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> };
        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> };
12895   6610   
                                    sender.send(()).await.expect("receiver dropped early");
12896   6611   
                                    result
12897   6612   
                                }
12898   6613   
                            })
12899   6614   
                            .build_unchecked();
12900   6615   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
12901   6616   
                .await
12902   6617   
                .expect("unable to make an HTTP request");
12903   6618   
            ::pretty_assertions::assert_eq!(
12904   6619   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
12905   6620   
                http_response.status()
12906   6621   
            );
12907   6622   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
12908   6623   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
12909   6624   
                http_response.headers(),
12910   6625   
                expected_headers,
12911   6626   
            ));
12912   6627   
        }
12913   6628   
    }
12914         -
    /// Attempted string coercion should result in SerializationException
12915         -
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case12
        6629  +
    /// When the format is http-date, epoch second timestamps are rejected with a
        6630  +
    /// 400 SerializationException
        6631  +
    /// Test ID: RestJsonQueryTimestampHttpDateRejectsEpochSeconds_case0
12916   6632   
    #[::tokio::test]
12917         -
    async fn rest_json_header_boolean_string_coercion_case12_malformed_request() {
        6633  +
    #[::tracing_test::traced_test]
        6634  +
    async fn rest_json_query_timestamp_http_date_rejects_epoch_seconds_case0_malformed_request() {
12918   6635   
        {
12919   6636   
            #[allow(unused_mut)]
12920   6637   
            let mut http_request = http::Request::builder()
12921         -
                .uri("/MalformedBoolean/true")
        6638  +
                .uri("/MalformedTimestampQueryHttpDate")
12922   6639   
                .method("POST")
12923         -
                .header("booleanInHeader", "FALSE")
12924   6640   
                .body(::aws_smithy_http_server::body::Body::empty())
12925   6641   
                .unwrap();
        6642  +
            *http_request.uri_mut() = "/MalformedTimestampQueryHttpDate?timestamp=1515531081.1234"
        6643  +
                .parse()
        6644  +
                .unwrap();
12926   6645   
            #[allow(unused_mut)]
12927   6646   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
12928   6647   
            let config = crate::service::RestJsonConfig::builder().build();
12929   6648   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
12930         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        6649  +
                            .malformed_timestamp_query_http_date(move |input: crate::input::MalformedTimestampQueryHttpDateInput| {
12931   6650   
                                let sender = sender.clone();
12932   6651   
                                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> };
        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> };
12934   6653   
                                    sender.send(()).await.expect("receiver dropped early");
12935   6654   
                                    result
12936   6655   
                                }
12937   6656   
                            })
12938   6657   
                            .build_unchecked();
12939   6658   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
12940   6659   
                .await
12941   6660   
                .expect("unable to make an HTTP request");
12942   6661   
            ::pretty_assertions::assert_eq!(
12943   6662   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
12944   6663   
                http_response.status()
12945   6664   
            );
12946   6665   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
12947   6666   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
12948   6667   
                http_response.headers(),
12949   6668   
                expected_headers,
12950   6669   
            ));
12951   6670   
        }
12952   6671   
    }
12953         -
    /// Attempted string coercion should result in SerializationException
12954         -
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case13
        6672  +
    /// When the format is http-date, epoch second timestamps are rejected with a
        6673  +
    /// 400 SerializationException
        6674  +
    /// Test ID: RestJsonQueryTimestampHttpDateRejectsEpochSeconds_case1
12955   6675   
    #[::tokio::test]
12956         -
    async fn rest_json_header_boolean_string_coercion_case13_malformed_request() {
        6676  +
    #[::tracing_test::traced_test]
        6677  +
    async fn rest_json_query_timestamp_http_date_rejects_epoch_seconds_case1_malformed_request() {
12957   6678   
        {
12958   6679   
            #[allow(unused_mut)]
12959   6680   
            let mut http_request = http::Request::builder()
12960         -
                .uri("/MalformedBoolean/true")
        6681  +
                .uri("/MalformedTimestampQueryHttpDate")
12961   6682   
                .method("POST")
12962         -
                .header("booleanInHeader", "n")
12963   6683   
                .body(::aws_smithy_http_server::body::Body::empty())
12964   6684   
                .unwrap();
        6685  +
            *http_request.uri_mut() = "/MalformedTimestampQueryHttpDate?timestamp=1515531081"
        6686  +
                .parse()
        6687  +
                .unwrap();
12965   6688   
            #[allow(unused_mut)]
12966   6689   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
12967   6690   
            let config = crate::service::RestJsonConfig::builder().build();
12968   6691   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
12969         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        6692  +
                            .malformed_timestamp_query_http_date(move |input: crate::input::MalformedTimestampQueryHttpDateInput| {
12970   6693   
                                let sender = sender.clone();
12971   6694   
                                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> };
        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> };
12973   6696   
                                    sender.send(()).await.expect("receiver dropped early");
12974   6697   
                                    result
12975   6698   
                                }
12976   6699   
                            })
12977   6700   
                            .build_unchecked();
12978   6701   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
12979   6702   
                .await
12980   6703   
                .expect("unable to make an HTTP request");
12981   6704   
            ::pretty_assertions::assert_eq!(
12982   6705   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
12983   6706   
                http_response.status()
12984   6707   
            );
12985   6708   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
12986   6709   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
12987   6710   
                http_response.headers(),
12988   6711   
                expected_headers,
12989   6712   
            ));
12990   6713   
        }
12991   6714   
    }
12992         -
    /// Attempted string coercion should result in SerializationException
12993         -
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case14
        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
12994   6824   
    #[::tokio::test]
12995         -
    async fn rest_json_header_boolean_string_coercion_case14_malformed_request() {
        6825  +
    #[::tracing_test::traced_test]
        6826  +
    async fn rest_json_query_timestamp_default_rejects_http_date_case0_malformed_request() {
12996   6827   
        {
12997   6828   
            #[allow(unused_mut)]
12998   6829   
            let mut http_request = http::Request::builder()
12999         -
                .uri("/MalformedBoolean/true")
        6830  +
                .uri("/MalformedTimestampQueryDefault")
13000   6831   
                .method("POST")
13001         -
                .header("booleanInHeader", "N")
13002   6832   
                .body(::aws_smithy_http_server::body::Body::empty())
13003   6833   
                .unwrap();
        6834  +
            *http_request.uri_mut() = "/MalformedTimestampQueryDefault?timestamp=Tue%2C%2029%20Apr%202014%2018%3A30%3A38%20GMT".parse().unwrap();
13004   6835   
            #[allow(unused_mut)]
13005   6836   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
13006   6837   
            let config = crate::service::RestJsonConfig::builder().build();
13007   6838   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
13008         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        6839  +
                            .malformed_timestamp_query_default(move |input: crate::input::MalformedTimestampQueryDefaultInput| {
13009   6840   
                                let sender = sender.clone();
13010   6841   
                                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> };
        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> };
13012   6843   
                                    sender.send(()).await.expect("receiver dropped early");
13013   6844   
                                    result
13014   6845   
                                }
13015   6846   
                            })
13016   6847   
                            .build_unchecked();
13017   6848   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
13018   6849   
                .await
13019   6850   
                .expect("unable to make an HTTP request");
13020   6851   
            ::pretty_assertions::assert_eq!(
13021   6852   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
13022   6853   
                http_response.status()
13023   6854   
            );
13024   6855   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
13025   6856   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
13026   6857   
                http_response.headers(),
13027   6858   
                expected_headers,
13028   6859   
            ));
13029   6860   
        }
13030   6861   
    }
13031         -
    /// Attempted string coercion should result in SerializationException
13032         -
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case15
        6862  +
    /// By default, IMF-fixdate timestamps are rejected with a
        6863  +
    /// 400 SerializationException
        6864  +
    /// Test ID: RestJsonQueryTimestampDefaultRejectsHttpDate_case1
13033   6865   
    #[::tokio::test]
13034         -
    async fn rest_json_header_boolean_string_coercion_case15_malformed_request() {
        6866  +
    #[::tracing_test::traced_test]
        6867  +
    async fn rest_json_query_timestamp_default_rejects_http_date_case1_malformed_request() {
13035   6868   
        {
13036   6869   
            #[allow(unused_mut)]
13037   6870   
            let mut http_request = http::Request::builder()
13038         -
                .uri("/MalformedBoolean/true")
        6871  +
                .uri("/MalformedTimestampQueryDefault")
13039   6872   
                .method("POST")
13040         -
                .header("booleanInHeader", "no")
13041   6873   
                .body(::aws_smithy_http_server::body::Body::empty())
13042   6874   
                .unwrap();
        6875  +
            *http_request.uri_mut() = "/MalformedTimestampQueryDefault?timestamp=Sun%2C%2002%20Jan%202000%2020%3A34%3A56.000%20GMT".parse().unwrap();
13043   6876   
            #[allow(unused_mut)]
13044   6877   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
13045   6878   
            let config = crate::service::RestJsonConfig::builder().build();
13046   6879   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
13047         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        6880  +
                            .malformed_timestamp_query_default(move |input: crate::input::MalformedTimestampQueryDefaultInput| {
13048   6881   
                                let sender = sender.clone();
13049   6882   
                                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> };
        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> };
13051   6884   
                                    sender.send(()).await.expect("receiver dropped early");
13052   6885   
                                    result
13053   6886   
                                }
13054   6887   
                            })
13055   6888   
                            .build_unchecked();
13056   6889   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
13057   6890   
                .await
13058   6891   
                .expect("unable to make an HTTP request");
13059   6892   
            ::pretty_assertions::assert_eq!(
13060   6893   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
13061   6894   
                http_response.status()
13062   6895   
            );
13063   6896   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
13064   6897   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
13065   6898   
                http_response.headers(),
13066   6899   
                expected_headers,
13067   6900   
            ));
13068   6901   
        }
13069   6902   
    }
13070         -
    /// Attempted string coercion should result in SerializationException
13071         -
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case16
        6903  +
    /// By default, epoch second timestamps are rejected with a
        6904  +
    /// 400 SerializationException
        6905  +
    /// Test ID: RestJsonQueryTimestampDefaultRejectsEpochSeconds_case0
13072   6906   
    #[::tokio::test]
13073         -
    async fn rest_json_header_boolean_string_coercion_case16_malformed_request() {
        6907  +
    #[::tracing_test::traced_test]
        6908  +
    async fn rest_json_query_timestamp_default_rejects_epoch_seconds_case0_malformed_request() {
13074   6909   
        {
13075   6910   
            #[allow(unused_mut)]
13076   6911   
            let mut http_request = http::Request::builder()
13077         -
                .uri("/MalformedBoolean/true")
        6912  +
                .uri("/MalformedTimestampQueryDefault")
13078   6913   
                .method("POST")
13079         -
                .header("booleanInHeader", "No")
13080   6914   
                .body(::aws_smithy_http_server::body::Body::empty())
13081   6915   
                .unwrap();
        6916  +
            *http_request.uri_mut() = "/MalformedTimestampQueryDefault?timestamp=1515531081.1234"
        6917  +
                .parse()
        6918  +
                .unwrap();
13082   6919   
            #[allow(unused_mut)]
13083   6920   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
13084   6921   
            let config = crate::service::RestJsonConfig::builder().build();
13085   6922   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
13086         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        6923  +
                            .malformed_timestamp_query_default(move |input: crate::input::MalformedTimestampQueryDefaultInput| {
13087   6924   
                                let sender = sender.clone();
13088   6925   
                                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> };
        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> };
13090   6927   
                                    sender.send(()).await.expect("receiver dropped early");
13091   6928   
                                    result
13092   6929   
                                }
13093   6930   
                            })
13094   6931   
                            .build_unchecked();
13095   6932   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
13096   6933   
                .await
13097   6934   
                .expect("unable to make an HTTP request");
13098   6935   
            ::pretty_assertions::assert_eq!(
13099   6936   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
13100   6937   
                http_response.status()
13101   6938   
            );
13102   6939   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
13103   6940   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
13104   6941   
                http_response.headers(),
13105   6942   
                expected_headers,
13106   6943   
            ));
13107   6944   
        }
13108   6945   
    }
13109         -
    /// Attempted string coercion should result in SerializationException
13110         -
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case17
        6946  +
    /// By default, epoch second timestamps are rejected with a
        6947  +
    /// 400 SerializationException
        6948  +
    /// Test ID: RestJsonQueryTimestampDefaultRejectsEpochSeconds_case1
13111   6949   
    #[::tokio::test]
13112         -
    async fn rest_json_header_boolean_string_coercion_case17_malformed_request() {
        6950  +
    #[::tracing_test::traced_test]
        6951  +
    async fn rest_json_query_timestamp_default_rejects_epoch_seconds_case1_malformed_request() {
13113   6952   
        {
13114   6953   
            #[allow(unused_mut)]
13115   6954   
            let mut http_request = http::Request::builder()
13116         -
                .uri("/MalformedBoolean/true")
        6955  +
                .uri("/MalformedTimestampQueryDefault")
13117   6956   
                .method("POST")
13118         -
                .header("booleanInHeader", "NO")
13119   6957   
                .body(::aws_smithy_http_server::body::Body::empty())
13120   6958   
                .unwrap();
        6959  +
            *http_request.uri_mut() = "/MalformedTimestampQueryDefault?timestamp=1515531081"
        6960  +
                .parse()
        6961  +
                .unwrap();
13121   6962   
            #[allow(unused_mut)]
13122   6963   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
13123   6964   
            let config = crate::service::RestJsonConfig::builder().build();
13124   6965   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
13125         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        6966  +
                            .malformed_timestamp_query_default(move |input: crate::input::MalformedTimestampQueryDefaultInput| {
13126   6967   
                                let sender = sender.clone();
13127   6968   
                                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> };
        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> };
13129   6970   
                                    sender.send(()).await.expect("receiver dropped early");
13130   6971   
                                    result
13131   6972   
                                }
13132   6973   
                            })
13133   6974   
                            .build_unchecked();
13134   6975   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
13135   6976   
                .await
13136   6977   
                .expect("unable to make an HTTP request");
13137   6978   
            ::pretty_assertions::assert_eq!(
13138   6979   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
13139   6980   
                http_response.status()
13140   6981   
            );
13141   6982   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
13142   6983   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
13143   6984   
                http_response.headers(),
13144   6985   
                expected_headers,
13145   6986   
            ));
13146   6987   
        }
13147   6988   
    }
13148         -
    /// Attempted string coercion should result in SerializationException
13149         -
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case18
        6989  +
    /// UTC offsets must be rejected with a
        6990  +
    /// 400 SerializationException
        6991  +
    /// Test ID: RestJsonQueryTimestampDefaultRejectsUTCOffsets
13150   6992   
    #[::tokio::test]
13151         -
    async fn rest_json_header_boolean_string_coercion_case18_malformed_request() {
        6993  +
    #[::tracing_test::traced_test]
        6994  +
    async fn rest_json_query_timestamp_default_rejects_utc_offsets_malformed_request() {
13152   6995   
        {
13153   6996   
            #[allow(unused_mut)]
13154   6997   
            let mut http_request = http::Request::builder()
13155         -
                .uri("/MalformedBoolean/true")
        6998  +
                .uri("/MalformedTimestampQueryDefault")
13156   6999   
                .method("POST")
13157         -
                .header("booleanInHeader", "0")
13158   7000   
                .body(::aws_smithy_http_server::body::Body::empty())
13159   7001   
                .unwrap();
        7002  +
            *http_request.uri_mut() = "/MalformedTimestampQueryDefault?timestamp=$value:L"
        7003  +
                .parse()
        7004  +
                .unwrap();
13160   7005   
            #[allow(unused_mut)]
13161   7006   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
13162   7007   
            let config = crate::service::RestJsonConfig::builder().build();
13163   7008   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
13164         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        7009  +
                            .malformed_timestamp_query_default(move |input: crate::input::MalformedTimestampQueryDefaultInput| {
13165   7010   
                                let sender = sender.clone();
13166   7011   
                                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> };
        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> };
13168   7013   
                                    sender.send(()).await.expect("receiver dropped early");
13169   7014   
                                    result
13170   7015   
                                }
13171   7016   
                            })
13172   7017   
                            .build_unchecked();
13173   7018   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
13174   7019   
                .await
13175   7020   
                .expect("unable to make an HTTP request");
13176   7021   
            ::pretty_assertions::assert_eq!(
13177   7022   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
13178   7023   
                http_response.status()
13179   7024   
            );
13180   7025   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
13181   7026   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
13182   7027   
                http_response.headers(),
13183   7028   
                expected_headers,
13184   7029   
            ));
13185   7030   
        }
13186   7031   
    }
13187         -
    /// Attempted string coercion should result in SerializationException
13188         -
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case19
        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
13189   7035   
    #[::tokio::test]
13190         -
    async fn rest_json_header_boolean_string_coercion_case19_malformed_request() {
        7036  +
    #[::tracing_test::traced_test]
        7037  +
    async fn rest_json_query_timestamp_default_rejects_different8601_formats_case0_malformed_request(
        7038  +
    ) {
13191   7039   
        {
13192   7040   
            #[allow(unused_mut)]
13193   7041   
            let mut http_request = http::Request::builder()
13194         -
                .uri("/MalformedBoolean/true")
        7042  +
                .uri("/MalformedTimestampQueryDefault")
13195   7043   
                .method("POST")
13196         -
                .header("booleanInHeader", "off")
13197   7044   
                .body(::aws_smithy_http_server::body::Body::empty())
13198   7045   
                .unwrap();
        7046  +
            *http_request.uri_mut() =
        7047  +
                "/MalformedTimestampQueryDefault?timestamp=1996-12-19T16:39:57+00"
        7048  +
                    .parse()
        7049  +
                    .unwrap();
13199   7050   
            #[allow(unused_mut)]
13200   7051   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
13201   7052   
            let config = crate::service::RestJsonConfig::builder().build();
13202   7053   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
13203         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        7054  +
                            .malformed_timestamp_query_default(move |input: crate::input::MalformedTimestampQueryDefaultInput| {
13204   7055   
                                let sender = sender.clone();
13205   7056   
                                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> };
        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> };
13207   7058   
                                    sender.send(()).await.expect("receiver dropped early");
13208   7059   
                                    result
13209   7060   
                                }
13210   7061   
                            })
13211   7062   
                            .build_unchecked();
13212   7063   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
13213   7064   
                .await
13214   7065   
                .expect("unable to make an HTTP request");
13215   7066   
            ::pretty_assertions::assert_eq!(
13216   7067   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
13217   7068   
                http_response.status()
13218   7069   
            );
13219   7070   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
13220   7071   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
13221   7072   
                http_response.headers(),
13222   7073   
                expected_headers,
13223   7074   
            ));
13224   7075   
        }
13225   7076   
    }
13226         -
    /// Attempted string coercion should result in SerializationException
13227         -
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case20
        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
13228   7080   
    #[::tokio::test]
13229         -
    async fn rest_json_header_boolean_string_coercion_case20_malformed_request() {
        7081  +
    #[::tracing_test::traced_test]
        7082  +
    async fn rest_json_query_timestamp_default_rejects_different8601_formats_case1_malformed_request(
        7083  +
    ) {
13230   7084   
        {
13231   7085   
            #[allow(unused_mut)]
13232   7086   
            let mut http_request = http::Request::builder()
13233         -
                .uri("/MalformedBoolean/true")
        7087  +
                .uri("/MalformedTimestampQueryDefault")
13234   7088   
                .method("POST")
13235         -
                .header("booleanInHeader", "Off")
13236   7089   
                .body(::aws_smithy_http_server::body::Body::empty())
13237   7090   
                .unwrap();
        7091  +
            *http_request.uri_mut() =
        7092  +
                "/MalformedTimestampQueryDefault?timestamp=1996-12-19T16:39:57+00Z"
        7093  +
                    .parse()
        7094  +
                    .unwrap();
13238   7095   
            #[allow(unused_mut)]
13239   7096   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
13240   7097   
            let config = crate::service::RestJsonConfig::builder().build();
13241   7098   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
13242         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        7099  +
                            .malformed_timestamp_query_default(move |input: crate::input::MalformedTimestampQueryDefaultInput| {
13243   7100   
                                let sender = sender.clone();
13244   7101   
                                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> };
        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> };
13246   7103   
                                    sender.send(()).await.expect("receiver dropped early");
13247   7104   
                                    result
13248   7105   
                                }
13249   7106   
                            })
13250   7107   
                            .build_unchecked();
13251   7108   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
13252   7109   
                .await
13253   7110   
                .expect("unable to make an HTTP request");
13254   7111   
            ::pretty_assertions::assert_eq!(
13255   7112   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
13256   7113   
                http_response.status()
13257   7114   
            );
13258   7115   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
13259   7116   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
13260   7117   
                http_response.headers(),
13261   7118   
                expected_headers,
13262   7119   
            ));
13263   7120   
        }
13264   7121   
    }
13265         -
    /// Attempted string coercion should result in SerializationException
13266         -
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case21
        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
13267   7125   
    #[::tokio::test]
13268         -
    async fn rest_json_header_boolean_string_coercion_case21_malformed_request() {
        7126  +
    #[::tracing_test::traced_test]
        7127  +
    async fn rest_json_query_timestamp_default_rejects_different8601_formats_case2_malformed_request(
        7128  +
    ) {
13269   7129   
        {
13270   7130   
            #[allow(unused_mut)]
13271   7131   
            let mut http_request = http::Request::builder()
13272         -
                .uri("/MalformedBoolean/true")
        7132  +
                .uri("/MalformedTimestampQueryDefault")
13273   7133   
                .method("POST")
13274         -
                .header("booleanInHeader", "OFF")
13275   7134   
                .body(::aws_smithy_http_server::body::Body::empty())
13276   7135   
                .unwrap();
        7136  +
            *http_request.uri_mut() =
        7137  +
                "/MalformedTimestampQueryDefault?timestamp=1996-12-19T16:39:57"
        7138  +
                    .parse()
        7139  +
                    .unwrap();
13277   7140   
            #[allow(unused_mut)]
13278   7141   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
13279   7142   
            let config = crate::service::RestJsonConfig::builder().build();
13280   7143   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
13281         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        7144  +
                            .malformed_timestamp_query_default(move |input: crate::input::MalformedTimestampQueryDefaultInput| {
13282   7145   
                                let sender = sender.clone();
13283   7146   
                                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> };
        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> };
13285   7148   
                                    sender.send(()).await.expect("receiver dropped early");
13286   7149   
                                    result
13287   7150   
                                }
13288   7151   
                            })
13289   7152   
                            .build_unchecked();
13290   7153   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
13291   7154   
                .await
13292   7155   
                .expect("unable to make an HTTP request");
13293   7156   
            ::pretty_assertions::assert_eq!(
13294   7157   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
13295   7158   
                http_response.status()
13296   7159   
            );
13297   7160   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
13298   7161   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
13299   7162   
                http_response.headers(),
13300   7163   
                expected_headers,
13301   7164   
            ));
13302   7165   
        }
13303   7166   
    }
13304         -
}
13305         -
#[cfg(test)]
13306         -
#[allow(unreachable_code, unused_variables)]
13307         -
mod server_malformed_byte_test {
13308         -
    /// Underflow or overflow should result in SerializationException
13309         -
    /// Test ID: RestJsonBodyByteUnderflowOverflow_case0
        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
13310   7170   
    #[::tokio::test]
13311         -
    async fn rest_json_body_byte_underflow_overflow_case0_malformed_request() {
        7171  +
    #[::tracing_test::traced_test]
        7172  +
    async fn rest_json_query_timestamp_default_rejects_different8601_formats_case3_malformed_request(
        7173  +
    ) {
13312   7174   
        {
13313   7175   
            #[allow(unused_mut)]
13314   7176   
            let mut http_request = http::Request::builder()
13315         -
                .uri("/MalformedByte/1")
        7177  +
                .uri("/MalformedTimestampQueryDefault")
13316   7178   
                .method("POST")
13317         -
                .header("content-type", "application/json")
13318         -
                .body(::aws_smithy_http_server::body::Body::from(
13319         -
                    ::bytes::Bytes::from_static("{ \"byteInBody\" : 256 }".as_bytes()),
13320         -
                ))
        7179  +
                .body(::aws_smithy_http_server::body::Body::empty())
        7180  +
                .unwrap();
        7181  +
            *http_request.uri_mut() = "/MalformedTimestampQueryDefault?timestamp=1996-12-19T163957"
        7182  +
                .parse()
13321   7183   
                .unwrap();
13322   7184   
            #[allow(unused_mut)]
13323   7185   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
13324   7186   
            let config = crate::service::RestJsonConfig::builder().build();
13325   7187   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
13326         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
        7188  +
                            .malformed_timestamp_query_default(move |input: crate::input::MalformedTimestampQueryDefaultInput| {
13327   7189   
                                let sender = sender.clone();
13328   7190   
                                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> };
        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> };
13330   7192   
                                    sender.send(()).await.expect("receiver dropped early");
13331   7193   
                                    result
13332   7194   
                                }
13333   7195   
                            })
13334   7196   
                            .build_unchecked();
13335   7197   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
13336   7198   
                .await
13337   7199   
                .expect("unable to make an HTTP request");
13338   7200   
            ::pretty_assertions::assert_eq!(
13339   7201   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
13340   7202   
                http_response.status()
13341   7203   
            );
13342   7204   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
13343   7205   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
13344   7206   
                http_response.headers(),
13345   7207   
                expected_headers,
13346   7208   
            ));
13347   7209   
        }
13348   7210   
    }
13349         -
    /// Underflow or overflow should result in SerializationException
13350         -
    /// Test ID: RestJsonBodyByteUnderflowOverflow_case1
        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
13351   7214   
    #[::tokio::test]
13352         -
    async fn rest_json_body_byte_underflow_overflow_case1_malformed_request() {
        7215  +
    #[::tracing_test::traced_test]
        7216  +
    async fn rest_json_query_timestamp_default_rejects_different8601_formats_case4_malformed_request(
        7217  +
    ) {
13353   7218   
        {
13354   7219   
            #[allow(unused_mut)]
13355   7220   
            let mut http_request = http::Request::builder()
13356         -
                .uri("/MalformedByte/1")
        7221  +
                .uri("/MalformedTimestampQueryDefault")
13357   7222   
                .method("POST")
13358         -
                .header("content-type", "application/json")
13359         -
                .body(::aws_smithy_http_server::body::Body::from(
13360         -
                    ::bytes::Bytes::from_static("{ \"byteInBody\" : -256 }".as_bytes()),
13361         -
                ))
        7223  +
                .body(::aws_smithy_http_server::body::Body::empty())
        7224  +
                .unwrap();
        7225  +
            *http_request.uri_mut() = "/MalformedTimestampQueryDefault?timestamp=19961219T163957Z"
        7226  +
                .parse()
13362   7227   
                .unwrap();
13363   7228   
            #[allow(unused_mut)]
13364   7229   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
13365   7230   
            let config = crate::service::RestJsonConfig::builder().build();
13366   7231   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
13367         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
        7232  +
                            .malformed_timestamp_query_default(move |input: crate::input::MalformedTimestampQueryDefaultInput| {
13368   7233   
                                let sender = sender.clone();
13369   7234   
                                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> };
        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> };
13371   7236   
                                    sender.send(()).await.expect("receiver dropped early");
13372   7237   
                                    result
13373   7238   
                                }
13374   7239   
                            })
13375   7240   
                            .build_unchecked();
13376   7241   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
13377   7242   
                .await
13378   7243   
                .expect("unable to make an HTTP request");
13379   7244   
            ::pretty_assertions::assert_eq!(
13380   7245   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
13381   7246   
                http_response.status()
13382   7247   
            );
13383   7248   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
13384   7249   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
13385   7250   
                http_response.headers(),
13386   7251   
                expected_headers,
13387   7252   
            ));
13388   7253   
        }
13389   7254   
    }
13390         -
    /// Underflow or overflow should result in SerializationException
13391         -
    /// Test ID: RestJsonBodyByteUnderflowOverflow_case2
        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
13392   7258   
    #[::tokio::test]
13393         -
    async fn rest_json_body_byte_underflow_overflow_case2_malformed_request() {
        7259  +
    #[::tracing_test::traced_test]
        7260  +
    async fn rest_json_query_timestamp_default_rejects_different8601_formats_case5_malformed_request(
        7261  +
    ) {
13394   7262   
        {
13395   7263   
            #[allow(unused_mut)]
13396   7264   
            let mut http_request = http::Request::builder()
13397         -
                .uri("/MalformedByte/1")
        7265  +
                .uri("/MalformedTimestampQueryDefault")
13398   7266   
                .method("POST")
13399         -
                .header("content-type", "application/json")
13400         -
                .body(::aws_smithy_http_server::body::Body::from(
13401         -
                    ::bytes::Bytes::from_static(
13402         -
                        "{ \"byteInBody\" : -9223372000000000000 }".as_bytes(),
13403         -
                    ),
13404         -
                ))
        7267  +
                .body(::aws_smithy_http_server::body::Body::empty())
        7268  +
                .unwrap();
        7269  +
            *http_request.uri_mut() = "/MalformedTimestampQueryDefault?timestamp=19961219T163957"
        7270  +
                .parse()
13405   7271   
                .unwrap();
13406   7272   
            #[allow(unused_mut)]
13407   7273   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
13408   7274   
            let config = crate::service::RestJsonConfig::builder().build();
13409   7275   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
13410         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
        7276  +
                            .malformed_timestamp_query_default(move |input: crate::input::MalformedTimestampQueryDefaultInput| {
13411   7277   
                                let sender = sender.clone();
13412   7278   
                                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> };
        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> };
13414   7280   
                                    sender.send(()).await.expect("receiver dropped early");
13415   7281   
                                    result
13416   7282   
                                }
13417   7283   
                            })
13418   7284   
                            .build_unchecked();
13419   7285   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
13420   7286   
                .await
13421   7287   
                .expect("unable to make an HTTP request");
13422   7288   
            ::pretty_assertions::assert_eq!(
13423   7289   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
13424   7290   
                http_response.status()
13425   7291   
            );
13426   7292   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
13427   7293   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
13428   7294   
                http_response.headers(),
13429   7295   
                expected_headers,
13430   7296   
            ));
13431   7297   
        }
13432   7298   
    }
13433         -
    /// Underflow or overflow should result in SerializationException
13434         -
    /// Test ID: RestJsonBodyByteUnderflowOverflow_case3
        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
13435   7302   
    #[::tokio::test]
13436         -
    async fn rest_json_body_byte_underflow_overflow_case3_malformed_request() {
        7303  +
    #[::tracing_test::traced_test]
        7304  +
    async fn rest_json_query_timestamp_default_rejects_different8601_formats_case6_malformed_request(
        7305  +
    ) {
13437   7306   
        {
13438   7307   
            #[allow(unused_mut)]
13439   7308   
            let mut http_request = http::Request::builder()
13440         -
                .uri("/MalformedByte/1")
        7309  +
                .uri("/MalformedTimestampQueryDefault")
13441   7310   
                .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         -
                ))
        7311  +
                .body(::aws_smithy_http_server::body::Body::empty())
13448   7312   
                .unwrap();
        7313  +
            *http_request.uri_mut() =
        7314  +
                "/MalformedTimestampQueryDefault?timestamp=19961219T16:39:57Z"
        7315  +
                    .parse()
        7316  +
                    .unwrap();
13449   7317   
            #[allow(unused_mut)]
13450   7318   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
13451   7319   
            let config = crate::service::RestJsonConfig::builder().build();
13452   7320   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
13453         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
        7321  +
                            .malformed_timestamp_query_default(move |input: crate::input::MalformedTimestampQueryDefaultInput| {
13454   7322   
                                let sender = sender.clone();
13455   7323   
                                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> };
        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> };
13457   7325   
                                    sender.send(()).await.expect("receiver dropped early");
13458   7326   
                                    result
13459   7327   
                                }
13460   7328   
                            })
13461   7329   
                            .build_unchecked();
13462   7330   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
13463   7331   
                .await
13464   7332   
                .expect("unable to make an HTTP request");
13465   7333   
            ::pretty_assertions::assert_eq!(
13466   7334   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
13467   7335   
                http_response.status()
13468   7336   
            );
13469   7337   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
13470   7338   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
13471   7339   
                http_response.headers(),
13472   7340   
                expected_headers,
13473   7341   
            ));
13474   7342   
        }
13475   7343   
    }
13476         -
    /// Underflow or overflow should result in SerializationException
13477         -
    /// Test ID: RestJsonBodyByteUnderflowOverflow_case4
        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
13478   7347   
    #[::tokio::test]
13479         -
    async fn rest_json_body_byte_underflow_overflow_case4_malformed_request() {
        7348  +
    #[::tracing_test::traced_test]
        7349  +
    async fn rest_json_query_timestamp_default_rejects_different8601_formats_case7_malformed_request(
        7350  +
    ) {
13480   7351   
        {
13481   7352   
            #[allow(unused_mut)]
13482   7353   
            let mut http_request = http::Request::builder()
13483         -
                .uri("/MalformedByte/1")
        7354  +
                .uri("/MalformedTimestampQueryDefault")
13484   7355   
                .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         -
                ))
        7356  +
                .body(::aws_smithy_http_server::body::Body::empty())
        7357  +
                .unwrap();
        7358  +
            *http_request.uri_mut() = "/MalformedTimestampQueryDefault?timestamp=19961219T16:39:57"
        7359  +
                .parse()
13491   7360   
                .unwrap();
13492   7361   
            #[allow(unused_mut)]
13493   7362   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
13494   7363   
            let config = crate::service::RestJsonConfig::builder().build();
13495   7364   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
13496         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
        7365  +
                            .malformed_timestamp_query_default(move |input: crate::input::MalformedTimestampQueryDefaultInput| {
13497   7366   
                                let sender = sender.clone();
13498   7367   
                                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> };
        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> };
13500   7369   
                                    sender.send(()).await.expect("receiver dropped early");
13501   7370   
                                    result
13502   7371   
                                }
13503   7372   
                            })
13504   7373   
                            .build_unchecked();
13505   7374   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
13506   7375   
                .await
13507   7376   
                .expect("unable to make an HTTP request");
13508   7377   
            ::pretty_assertions::assert_eq!(
13509   7378   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
13510   7379   
                http_response.status()
13511   7380   
            );
13512   7381   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
13513   7382   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
13514   7383   
                http_response.headers(),
13515   7384   
                expected_headers,
13516   7385   
            ));
13517   7386   
        }
13518   7387   
    }
13519         -
    /// Underflow or overflow should result in SerializationException
13520         -
    /// Test ID: RestJsonPathByteUnderflowOverflow_case0
        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
13521   7391   
    #[::tokio::test]
13522         -
    async fn rest_json_path_byte_underflow_overflow_case0_malformed_request() {
        7392  +
    #[::tracing_test::traced_test]
        7393  +
    async fn rest_json_query_timestamp_default_rejects_different8601_formats_case8_malformed_request(
        7394  +
    ) {
13523   7395   
        {
13524   7396   
            #[allow(unused_mut)]
13525   7397   
            let mut http_request = http::Request::builder()
13526         -
                .uri("/MalformedByte/256")
        7398  +
                .uri("/MalformedTimestampQueryDefault")
13527   7399   
                .method("POST")
13528   7400   
                .body(::aws_smithy_http_server::body::Body::empty())
13529   7401   
                .unwrap();
        7402  +
            *http_request.uri_mut() = "/MalformedTimestampQueryDefault?timestamp=1996-12-19T16:39Z"
        7403  +
                .parse()
        7404  +
                .unwrap();
13530   7405   
            #[allow(unused_mut)]
13531   7406   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
13532   7407   
            let config = crate::service::RestJsonConfig::builder().build();
13533   7408   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
13534         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
        7409  +
                            .malformed_timestamp_query_default(move |input: crate::input::MalformedTimestampQueryDefaultInput| {
13535   7410   
                                let sender = sender.clone();
13536   7411   
                                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> };
        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> };
13538   7413   
                                    sender.send(()).await.expect("receiver dropped early");
13539   7414   
                                    result
13540   7415   
                                }
13541   7416   
                            })
13542   7417   
                            .build_unchecked();
13543   7418   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
13544   7419   
                .await
13545   7420   
                .expect("unable to make an HTTP request");
13546   7421   
            ::pretty_assertions::assert_eq!(
13547   7422   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
13548   7423   
                http_response.status()
13549   7424   
            );
13550   7425   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
13551   7426   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
13552   7427   
                http_response.headers(),
13553   7428   
                expected_headers,
13554   7429   
            ));
13555   7430   
        }
13556   7431   
    }
13557         -
    /// Underflow or overflow should result in SerializationException
13558         -
    /// Test ID: RestJsonPathByteUnderflowOverflow_case1
        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
13559   7435   
    #[::tokio::test]
13560         -
    async fn rest_json_path_byte_underflow_overflow_case1_malformed_request() {
        7436  +
    #[::tracing_test::traced_test]
        7437  +
    async fn rest_json_query_timestamp_default_rejects_different8601_formats_case9_malformed_request(
        7438  +
    ) {
13561   7439   
        {
13562   7440   
            #[allow(unused_mut)]
13563   7441   
            let mut http_request = http::Request::builder()
13564         -
                .uri("/MalformedByte/-256")
        7442  +
                .uri("/MalformedTimestampQueryDefault")
13565   7443   
                .method("POST")
13566   7444   
                .body(::aws_smithy_http_server::body::Body::empty())
13567   7445   
                .unwrap();
        7446  +
            *http_request.uri_mut() = "/MalformedTimestampQueryDefault?timestamp=1996-12-19T16:39"
        7447  +
                .parse()
        7448  +
                .unwrap();
13568   7449   
            #[allow(unused_mut)]
13569   7450   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
13570   7451   
            let config = crate::service::RestJsonConfig::builder().build();
13571   7452   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
13572         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
        7453  +
                            .malformed_timestamp_query_default(move |input: crate::input::MalformedTimestampQueryDefaultInput| {
13573   7454   
                                let sender = sender.clone();
13574   7455   
                                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> };
        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> };
13576   7457   
                                    sender.send(()).await.expect("receiver dropped early");
13577   7458   
                                    result
13578   7459   
                                }
13579   7460   
                            })
13580   7461   
                            .build_unchecked();
13581   7462   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
13582   7463   
                .await
13583   7464   
                .expect("unable to make an HTTP request");
13584   7465   
            ::pretty_assertions::assert_eq!(
13585   7466   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
13586   7467   
                http_response.status()
13587   7468   
            );
13588   7469   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
13589   7470   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
13590   7471   
                http_response.headers(),
13591   7472   
                expected_headers,
13592   7473   
            ));
13593   7474   
        }
13594   7475   
    }
13595         -
    /// Underflow or overflow should result in SerializationException
13596         -
    /// Test ID: RestJsonPathByteUnderflowOverflow_case2
        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
13597   7479   
    #[::tokio::test]
13598         -
    async fn rest_json_path_byte_underflow_overflow_case2_malformed_request() {
        7480  +
    #[::tracing_test::traced_test]
        7481  +
    async fn rest_json_query_timestamp_default_rejects_different8601_formats_case10_malformed_request(
        7482  +
    ) {
13599   7483   
        {
13600   7484   
            #[allow(unused_mut)]
13601   7485   
            let mut http_request = http::Request::builder()
13602         -
                .uri("/MalformedByte/-9223372000000000000")
        7486  +
                .uri("/MalformedTimestampQueryDefault")
13603   7487   
                .method("POST")
13604   7488   
                .body(::aws_smithy_http_server::body::Body::empty())
13605   7489   
                .unwrap();
        7490  +
            *http_request.uri_mut() = "/MalformedTimestampQueryDefault?timestamp=1996-12-19T1639"
        7491  +
                .parse()
        7492  +
                .unwrap();
13606   7493   
            #[allow(unused_mut)]
13607   7494   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
13608   7495   
            let config = crate::service::RestJsonConfig::builder().build();
13609   7496   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
13610         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
        7497  +
                            .malformed_timestamp_query_default(move |input: crate::input::MalformedTimestampQueryDefaultInput| {
13611   7498   
                                let sender = sender.clone();
13612   7499   
                                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> };
        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> };
13614   7501   
                                    sender.send(()).await.expect("receiver dropped early");
13615   7502   
                                    result
13616   7503   
                                }
13617   7504   
                            })
13618   7505   
                            .build_unchecked();
13619   7506   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
13620   7507   
                .await
13621   7508   
                .expect("unable to make an HTTP request");
13622   7509   
            ::pretty_assertions::assert_eq!(
13623   7510   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
13624   7511   
                http_response.status()
13625   7512   
            );
13626   7513   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
13627   7514   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
13628   7515   
                http_response.headers(),
13629   7516   
                expected_headers,
13630   7517   
            ));
13631   7518   
        }
13632   7519   
    }
13633         -
    /// Underflow or overflow should result in SerializationException
13634         -
    /// Test ID: RestJsonPathByteUnderflowOverflow_case3
        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
13635   7523   
    #[::tokio::test]
13636         -
    async fn rest_json_path_byte_underflow_overflow_case3_malformed_request() {
        7524  +
    #[::tracing_test::traced_test]
        7525  +
    async fn rest_json_query_timestamp_default_rejects_different8601_formats_case11_malformed_request(
        7526  +
    ) {
13637   7527   
        {
13638   7528   
            #[allow(unused_mut)]
13639   7529   
            let mut http_request = http::Request::builder()
13640         -
                .uri("/MalformedByte/9223372000000000000")
        7530  +
                .uri("/MalformedTimestampQueryDefault")
13641   7531   
                .method("POST")
13642   7532   
                .body(::aws_smithy_http_server::body::Body::empty())
13643   7533   
                .unwrap();
        7534  +
            *http_request.uri_mut() = "/MalformedTimestampQueryDefault?timestamp=1996-12-19T16Z"
        7535  +
                .parse()
        7536  +
                .unwrap();
13644   7537   
            #[allow(unused_mut)]
13645   7538   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
13646   7539   
            let config = crate::service::RestJsonConfig::builder().build();
13647   7540   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
13648         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
        7541  +
                            .malformed_timestamp_query_default(move |input: crate::input::MalformedTimestampQueryDefaultInput| {
13649   7542   
                                let sender = sender.clone();
13650   7543   
                                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> };
        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> };
13652   7545   
                                    sender.send(()).await.expect("receiver dropped early");
13653   7546   
                                    result
13654   7547   
                                }
13655   7548   
                            })
13656   7549   
                            .build_unchecked();
13657   7550   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
13658   7551   
                .await
13659   7552   
                .expect("unable to make an HTTP request");
13660   7553   
            ::pretty_assertions::assert_eq!(
13661   7554   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
13662   7555   
                http_response.status()
13663   7556   
            );
13664   7557   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
13665   7558   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
13666   7559   
                http_response.headers(),
13667   7560   
                expected_headers,
13668   7561   
            ));
13669   7562   
        }
13670   7563   
    }
13671         -
    /// Underflow or overflow should result in SerializationException
13672         -
    /// Test ID: RestJsonPathByteUnderflowOverflow_case4
        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
13673   7567   
    #[::tokio::test]
13674         -
    async fn rest_json_path_byte_underflow_overflow_case4_malformed_request() {
        7568  +
    #[::tracing_test::traced_test]
        7569  +
    async fn rest_json_query_timestamp_default_rejects_different8601_formats_case12_malformed_request(
        7570  +
    ) {
13675   7571   
        {
13676   7572   
            #[allow(unused_mut)]
13677   7573   
            let mut http_request = http::Request::builder()
13678         -
                .uri("/MalformedByte/123000000000000000000000")
        7574  +
                .uri("/MalformedTimestampQueryDefault")
13679   7575   
                .method("POST")
13680   7576   
                .body(::aws_smithy_http_server::body::Body::empty())
13681   7577   
                .unwrap();
        7578  +
            *http_request.uri_mut() = "/MalformedTimestampQueryDefault?timestamp=1996-12-19T16"
        7579  +
                .parse()
        7580  +
                .unwrap();
13682   7581   
            #[allow(unused_mut)]
13683   7582   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
13684   7583   
            let config = crate::service::RestJsonConfig::builder().build();
13685   7584   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
13686         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
        7585  +
                            .malformed_timestamp_query_default(move |input: crate::input::MalformedTimestampQueryDefaultInput| {
13687   7586   
                                let sender = sender.clone();
13688   7587   
                                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> };
        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> };
13690   7589   
                                    sender.send(()).await.expect("receiver dropped early");
13691   7590   
                                    result
13692   7591   
                                }
13693   7592   
                            })
13694   7593   
                            .build_unchecked();
13695   7594   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
13696   7595   
                .await
13697   7596   
                .expect("unable to make an HTTP request");
13698   7597   
            ::pretty_assertions::assert_eq!(
13699   7598   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
13700   7599   
                http_response.status()
13701   7600   
            );
13702   7601   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
13703   7602   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
13704   7603   
                http_response.headers(),
13705   7604   
                expected_headers,
13706   7605   
            ));
13707   7606   
        }
13708   7607   
    }
13709         -
    /// Underflow or overflow should result in SerializationException
13710         -
    /// Test ID: RestJsonQueryByteUnderflowOverflow_case0
        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
13711   7611   
    #[::tokio::test]
13712         -
    async fn rest_json_query_byte_underflow_overflow_case0_malformed_request() {
        7612  +
    #[::tracing_test::traced_test]
        7613  +
    async fn rest_json_query_timestamp_default_rejects_different8601_formats_case13_malformed_request(
        7614  +
    ) {
13713   7615   
        {
13714   7616   
            #[allow(unused_mut)]
13715   7617   
            let mut http_request = http::Request::builder()
13716         -
                .uri("/MalformedByte/1")
        7618  +
                .uri("/MalformedTimestampQueryDefault")
13717   7619   
                .method("POST")
13718   7620   
                .body(::aws_smithy_http_server::body::Body::empty())
13719   7621   
                .unwrap();
13720         -
            *http_request.uri_mut() = "/MalformedByte/1?byteInQuery=256".parse().unwrap();
        7622  +
            *http_request.uri_mut() =
        7623  +
                "/MalformedTimestampQueryDefault?timestamp=1996-12-19%2016:39:57Z"
        7624  +
                    .parse()
        7625  +
                    .unwrap();
13721   7626   
            #[allow(unused_mut)]
13722   7627   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
13723   7628   
            let config = crate::service::RestJsonConfig::builder().build();
13724   7629   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
13725         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
        7630  +
                            .malformed_timestamp_query_default(move |input: crate::input::MalformedTimestampQueryDefaultInput| {
13726   7631   
                                let sender = sender.clone();
13727   7632   
                                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> };
        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> };
13729   7634   
                                    sender.send(()).await.expect("receiver dropped early");
13730   7635   
                                    result
13731   7636   
                                }
13732   7637   
                            })
13733   7638   
                            .build_unchecked();
13734   7639   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
13735   7640   
                .await
13736   7641   
                .expect("unable to make an HTTP request");
13737   7642   
            ::pretty_assertions::assert_eq!(
13738   7643   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
13739   7644   
                http_response.status()
13740   7645   
            );
13741   7646   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
13742   7647   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
13743   7648   
                http_response.headers(),
13744   7649   
                expected_headers,
13745   7650   
            ));
13746   7651   
        }
13747   7652   
    }
13748         -
    /// Underflow or overflow should result in SerializationException
13749         -
    /// Test ID: RestJsonQueryByteUnderflowOverflow_case1
        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
13750   7656   
    #[::tokio::test]
13751         -
    async fn rest_json_query_byte_underflow_overflow_case1_malformed_request() {
        7657  +
    #[::tracing_test::traced_test]
        7658  +
    async fn rest_json_query_timestamp_default_rejects_different8601_formats_case14_malformed_request(
        7659  +
    ) {
13752   7660   
        {
13753   7661   
            #[allow(unused_mut)]
13754   7662   
            let mut http_request = http::Request::builder()
13755         -
                .uri("/MalformedByte/1")
        7663  +
                .uri("/MalformedTimestampQueryDefault")
13756   7664   
                .method("POST")
13757   7665   
                .body(::aws_smithy_http_server::body::Body::empty())
13758   7666   
                .unwrap();
13759         -
            *http_request.uri_mut() = "/MalformedByte/1?byteInQuery=-256".parse().unwrap();
        7667  +
            *http_request.uri_mut() =
        7668  +
                "/MalformedTimestampQueryDefault?timestamp=2011-12-03T10:15:30+01:00[Europe/Paris]"
        7669  +
                    .parse()
        7670  +
                    .unwrap();
13760   7671   
            #[allow(unused_mut)]
13761   7672   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
13762   7673   
            let config = crate::service::RestJsonConfig::builder().build();
13763   7674   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
13764         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
        7675  +
                            .malformed_timestamp_query_default(move |input: crate::input::MalformedTimestampQueryDefaultInput| {
13765   7676   
                                let sender = sender.clone();
13766   7677   
                                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> };
        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> };
13768   7679   
                                    sender.send(()).await.expect("receiver dropped early");
13769   7680   
                                    result
13770   7681   
                                }
13771   7682   
                            })
13772   7683   
                            .build_unchecked();
13773   7684   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
13774   7685   
                .await
13775   7686   
                .expect("unable to make an HTTP request");
13776   7687   
            ::pretty_assertions::assert_eq!(
13777   7688   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
13778   7689   
                http_response.status()
13779   7690   
            );
13780   7691   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
13781   7692   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
13782   7693   
                http_response.headers(),
13783   7694   
                expected_headers,
13784   7695   
            ));
13785   7696   
        }
13786   7697   
    }
13787         -
    /// Underflow or overflow should result in SerializationException
13788         -
    /// Test ID: RestJsonQueryByteUnderflowOverflow_case2
        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>>
        7706  +
    }
        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)
        7749  +
                            .await
        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  +
            },
        7760  +
        );
        7761  +
        MalformedTimestampPathEpochInputFuture {
        7762  +
            inner: Box::pin(fut),
        7763  +
        }
        7764  +
    }
        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))
        7777  +
                        }
        7778  +
                    }
        7779  +
    }
        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))
        7795  +
            }
        7796  +
        }
        7797  +
    }
        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
13789   7807   
    #[::tokio::test]
13790         -
    async fn rest_json_query_byte_underflow_overflow_case2_malformed_request() {
        7808  +
    #[::tracing_test::traced_test]
        7809  +
    async fn rest_json_path_timestamp_epoch_rejects_date_time_case0_malformed_request() {
13791   7810   
        {
13792   7811   
            #[allow(unused_mut)]
13793   7812   
            let mut http_request = http::Request::builder()
13794         -
                .uri("/MalformedByte/1")
        7813  +
                .uri("/MalformedTimestampPathEpoch/1985-04-12T23%3A20%3A50.52Z")
13795   7814   
                .method("POST")
13796   7815   
                .body(::aws_smithy_http_server::body::Body::empty())
13797   7816   
                .unwrap();
13798         -
            *http_request.uri_mut() = "/MalformedByte/1?byteInQuery=-9223372000000000000"
13799         -
                .parse()
13800         -
                .unwrap();
13801   7817   
            #[allow(unused_mut)]
13802   7818   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
13803   7819   
            let config = crate::service::RestJsonConfig::builder().build();
13804   7820   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
13805         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
        7821  +
                            .malformed_timestamp_path_epoch(move |input: crate::input::MalformedTimestampPathEpochInput| {
13806   7822   
                                let sender = sender.clone();
13807   7823   
                                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> };
        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> };
13809   7825   
                                    sender.send(()).await.expect("receiver dropped early");
13810   7826   
                                    result
13811   7827   
                                }
13812   7828   
                            })
13813   7829   
                            .build_unchecked();
13814   7830   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
13815   7831   
                .await
13816   7832   
                .expect("unable to make an HTTP request");
13817   7833   
            ::pretty_assertions::assert_eq!(
13818   7834   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
13819   7835   
                http_response.status()
13820   7836   
            );
13821   7837   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
13822   7838   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
13823   7839   
                http_response.headers(),
13824   7840   
                expected_headers,
13825   7841   
            ));
13826   7842   
        }
13827   7843   
    }
13828         -
    /// Underflow or overflow should result in SerializationException
13829         -
    /// Test ID: RestJsonQueryByteUnderflowOverflow_case3
        7844  +
    /// When the format is epoch-seconds, RFC3339 timestamps are rejected with a
        7845  +
    /// 400 SerializationException
        7846  +
    /// Test ID: RestJsonPathTimestampEpochRejectsDateTime_case1
13830   7847   
    #[::tokio::test]
13831         -
    async fn rest_json_query_byte_underflow_overflow_case3_malformed_request() {
        7848  +
    #[::tracing_test::traced_test]
        7849  +
    async fn rest_json_path_timestamp_epoch_rejects_date_time_case1_malformed_request() {
13832   7850   
        {
13833   7851   
            #[allow(unused_mut)]
13834   7852   
            let mut http_request = http::Request::builder()
13835         -
                .uri("/MalformedByte/1")
        7853  +
                .uri("/MalformedTimestampPathEpoch/1985-04-12T23%3A20%3A50Z")
13836   7854   
                .method("POST")
13837   7855   
                .body(::aws_smithy_http_server::body::Body::empty())
13838   7856   
                .unwrap();
13839         -
            *http_request.uri_mut() = "/MalformedByte/1?byteInQuery=9223372000000000000"
13840         -
                .parse()
13841         -
                .unwrap();
13842   7857   
            #[allow(unused_mut)]
13843   7858   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
13844   7859   
            let config = crate::service::RestJsonConfig::builder().build();
13845   7860   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
13846         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
        7861  +
                            .malformed_timestamp_path_epoch(move |input: crate::input::MalformedTimestampPathEpochInput| {
13847   7862   
                                let sender = sender.clone();
13848   7863   
                                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> };
        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> };
13850   7865   
                                    sender.send(()).await.expect("receiver dropped early");
13851   7866   
                                    result
13852   7867   
                                }
13853   7868   
                            })
13854   7869   
                            .build_unchecked();
13855   7870   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
13856   7871   
                .await
13857   7872   
                .expect("unable to make an HTTP request");
13858   7873   
            ::pretty_assertions::assert_eq!(
13859   7874   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
13860   7875   
                http_response.status()
13861   7876   
            );
13862   7877   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
13863   7878   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
13864   7879   
                http_response.headers(),
13865   7880   
                expected_headers,
13866   7881   
            ));
13867   7882   
        }
13868   7883   
    }
13869         -
    /// Underflow or overflow should result in SerializationException
13870         -
    /// Test ID: RestJsonQueryByteUnderflowOverflow_case4
        7884  +
    /// When the format is epoch-seconds, RFC3339 timestamps are rejected with a
        7885  +
    /// 400 SerializationException
        7886  +
    /// Test ID: RestJsonPathTimestampEpochRejectsDateTime_case2
13871   7887   
    #[::tokio::test]
13872         -
    async fn rest_json_query_byte_underflow_overflow_case4_malformed_request() {
        7888  +
    #[::tracing_test::traced_test]
        7889  +
    async fn rest_json_path_timestamp_epoch_rejects_date_time_case2_malformed_request() {
13873   7890   
        {
13874   7891   
            #[allow(unused_mut)]
13875   7892   
            let mut http_request = http::Request::builder()
13876         -
                .uri("/MalformedByte/1")
        7893  +
                .uri("/MalformedTimestampPathEpoch/1996-12-19T16%3A39%3A57-08%3A00")
13877   7894   
                .method("POST")
13878   7895   
                .body(::aws_smithy_http_server::body::Body::empty())
13879   7896   
                .unwrap();
13880         -
            *http_request.uri_mut() = "/MalformedByte/1?byteInQuery=123000000000000000000000"
13881         -
                .parse()
13882         -
                .unwrap();
13883   7897   
            #[allow(unused_mut)]
13884   7898   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
13885   7899   
            let config = crate::service::RestJsonConfig::builder().build();
13886   7900   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
13887         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
        7901  +
                            .malformed_timestamp_path_epoch(move |input: crate::input::MalformedTimestampPathEpochInput| {
13888   7902   
                                let sender = sender.clone();
13889   7903   
                                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> };
        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> };
13891   7905   
                                    sender.send(()).await.expect("receiver dropped early");
13892   7906   
                                    result
13893   7907   
                                }
13894   7908   
                            })
13895   7909   
                            .build_unchecked();
13896   7910   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
13897   7911   
                .await
13898   7912   
                .expect("unable to make an HTTP request");
13899   7913   
            ::pretty_assertions::assert_eq!(
13900   7914   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
13901   7915   
                http_response.status()
13902   7916   
            );
13903   7917   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
13904   7918   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
13905   7919   
                http_response.headers(),
13906   7920   
                expected_headers,
13907   7921   
            ));
13908   7922   
        }
13909   7923   
    }
13910         -
    /// Underflow or overflow should result in SerializationException
13911         -
    /// Test ID: RestJsonHeaderByteUnderflowOverflow_case0
        7924  +
    /// When the format is epoch-seconds, IMF-fixdate timestamps are rejected with a
        7925  +
    /// 400 SerializationException
        7926  +
    /// Test ID: RestJsonPathTimestampEpochRejectsHttpDate_case0
13912   7927   
    #[::tokio::test]
13913         -
    async fn rest_json_header_byte_underflow_overflow_case0_malformed_request() {
        7928  +
    #[::tracing_test::traced_test]
        7929  +
    async fn rest_json_path_timestamp_epoch_rejects_http_date_case0_malformed_request() {
13914   7930   
        {
13915   7931   
            #[allow(unused_mut)]
13916   7932   
            let mut http_request = http::Request::builder()
13917         -
                .uri("/MalformedByte/1")
        7933  +
                .uri("/MalformedTimestampPathEpoch/Tue%2C%2029%20Apr%202014%2018%3A30%3A38%20GMT")
13918   7934   
                .method("POST")
13919         -
                .header("byteInHeader", "256")
13920   7935   
                .body(::aws_smithy_http_server::body::Body::empty())
13921   7936   
                .unwrap();
13922   7937   
            #[allow(unused_mut)]
13923   7938   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
13924   7939   
            let config = crate::service::RestJsonConfig::builder().build();
13925   7940   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
13926         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
        7941  +
                            .malformed_timestamp_path_epoch(move |input: crate::input::MalformedTimestampPathEpochInput| {
13927   7942   
                                let sender = sender.clone();
13928   7943   
                                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> };
        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> };
13930   7945   
                                    sender.send(()).await.expect("receiver dropped early");
13931   7946   
                                    result
13932   7947   
                                }
13933   7948   
                            })
13934   7949   
                            .build_unchecked();
13935   7950   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
13936   7951   
                .await
13937   7952   
                .expect("unable to make an HTTP request");
13938   7953   
            ::pretty_assertions::assert_eq!(
13939   7954   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
13940   7955   
                http_response.status()
13941   7956   
            );
13942   7957   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
13943   7958   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
13944   7959   
                http_response.headers(),
13945   7960   
                expected_headers,
13946   7961   
            ));
13947   7962   
        }
13948   7963   
    }
13949         -
    /// Underflow or overflow should result in SerializationException
13950         -
    /// Test ID: RestJsonHeaderByteUnderflowOverflow_case1
        7964  +
    /// When the format is epoch-seconds, IMF-fixdate timestamps are rejected with a
        7965  +
    /// 400 SerializationException
        7966  +
    /// Test ID: RestJsonPathTimestampEpochRejectsHttpDate_case1
13951   7967   
    #[::tokio::test]
13952         -
    async fn rest_json_header_byte_underflow_overflow_case1_malformed_request() {
        7968  +
    #[::tracing_test::traced_test]
        7969  +
    async fn rest_json_path_timestamp_epoch_rejects_http_date_case1_malformed_request() {
13953   7970   
        {
13954   7971   
            #[allow(unused_mut)]
13955         -
            let mut http_request = http::Request::builder()
13956         -
                .uri("/MalformedByte/1")
13957         -
                .method("POST")
13958         -
                .header("byteInHeader", "-256")
13959         -
                .body(::aws_smithy_http_server::body::Body::empty())
13960         -
                .unwrap();
        7972  +
                        let mut http_request = http::Request::builder()
        7973  +
                            .uri("/MalformedTimestampPathEpoch/Sun%2C%2002%20Jan%202000%2020%3A34%3A56.000%20GMT")
        7974  +
                            .method("POST")
        7975  +
            .body(::aws_smithy_http_server::body::Body::empty()).unwrap();
13961   7976   
            #[allow(unused_mut)]
13962   7977   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
13963   7978   
            let config = crate::service::RestJsonConfig::builder().build();
13964   7979   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
13965         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
        7980  +
                            .malformed_timestamp_path_epoch(move |input: crate::input::MalformedTimestampPathEpochInput| {
13966   7981   
                                let sender = sender.clone();
13967   7982   
                                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> };
        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> };
13969   7984   
                                    sender.send(()).await.expect("receiver dropped early");
13970   7985   
                                    result
13971   7986   
                                }
13972   7987   
                            })
13973   7988   
                            .build_unchecked();
13974   7989   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
13975   7990   
                .await
13976   7991   
                .expect("unable to make an HTTP request");
13977   7992   
            ::pretty_assertions::assert_eq!(
13978   7993   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
13979   7994   
                http_response.status()
13980   7995   
            );
13981   7996   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
13982   7997   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
13983   7998   
                http_response.headers(),
13984   7999   
                expected_headers,
13985   8000   
            ));
13986   8001   
        }
13987   8002   
    }
13988         -
    /// Underflow or overflow should result in SerializationException
13989         -
    /// Test ID: RestJsonHeaderByteUnderflowOverflow_case2
        8003  +
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
        8004  +
    /// Test ID: RestJsonPathTimestampEpochRejectsMalformedValues_case0
13990   8005   
    #[::tokio::test]
13991         -
    async fn rest_json_header_byte_underflow_overflow_case2_malformed_request() {
        8006  +
    #[::tracing_test::traced_test]
        8007  +
    async fn rest_json_path_timestamp_epoch_rejects_malformed_values_case0_malformed_request() {
13992   8008   
        {
13993   8009   
            #[allow(unused_mut)]
13994   8010   
            let mut http_request = http::Request::builder()
13995         -
                .uri("/MalformedByte/1")
        8011  +
                .uri("/MalformedTimestampPathEpoch/true")
13996   8012   
                .method("POST")
13997         -
                .header("byteInHeader", "-9223372000000000000")
13998   8013   
                .body(::aws_smithy_http_server::body::Body::empty())
13999   8014   
                .unwrap();
14000   8015   
            #[allow(unused_mut)]
14001   8016   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
14002   8017   
            let config = crate::service::RestJsonConfig::builder().build();
14003   8018   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
14004         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
        8019  +
                            .malformed_timestamp_path_epoch(move |input: crate::input::MalformedTimestampPathEpochInput| {
14005   8020   
                                let sender = sender.clone();
14006   8021   
                                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> };
        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> };
14008   8023   
                                    sender.send(()).await.expect("receiver dropped early");
14009   8024   
                                    result
14010   8025   
                                }
14011   8026   
                            })
14012   8027   
                            .build_unchecked();
14013   8028   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
14014   8029   
                .await
14015   8030   
                .expect("unable to make an HTTP request");
14016   8031   
            ::pretty_assertions::assert_eq!(
14017   8032   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
14018   8033   
                http_response.status()
14019   8034   
            );
14020   8035   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
14021   8036   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
14022   8037   
                http_response.headers(),
14023   8038   
                expected_headers,
14024   8039   
            ));
14025   8040   
        }
14026   8041   
    }
14027         -
    /// Underflow or overflow should result in SerializationException
14028         -
    /// Test ID: RestJsonHeaderByteUnderflowOverflow_case3
        8042  +
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
        8043  +
    /// Test ID: RestJsonPathTimestampEpochRejectsMalformedValues_case1
14029   8044   
    #[::tokio::test]
14030         -
    async fn rest_json_header_byte_underflow_overflow_case3_malformed_request() {
        8045  +
    #[::tracing_test::traced_test]
        8046  +
    async fn rest_json_path_timestamp_epoch_rejects_malformed_values_case1_malformed_request() {
14031   8047   
        {
14032   8048   
            #[allow(unused_mut)]
14033   8049   
            let mut http_request = http::Request::builder()
14034         -
                .uri("/MalformedByte/1")
        8050  +
                .uri("/MalformedTimestampPathEpoch/1515531081ABC")
14035   8051   
                .method("POST")
14036         -
                .header("byteInHeader", "9223372000000000000")
14037   8052   
                .body(::aws_smithy_http_server::body::Body::empty())
14038   8053   
                .unwrap();
14039   8054   
            #[allow(unused_mut)]
14040   8055   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
14041   8056   
            let config = crate::service::RestJsonConfig::builder().build();
14042   8057   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
14043         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
        8058  +
                            .malformed_timestamp_path_epoch(move |input: crate::input::MalformedTimestampPathEpochInput| {
14044   8059   
                                let sender = sender.clone();
14045   8060   
                                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> };
        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> };
14047   8062   
                                    sender.send(()).await.expect("receiver dropped early");
14048   8063   
                                    result
14049   8064   
                                }
14050   8065   
                            })
14051   8066   
                            .build_unchecked();
14052   8067   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
14053   8068   
                .await
14054   8069   
                .expect("unable to make an HTTP request");
14055   8070   
            ::pretty_assertions::assert_eq!(
14056   8071   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
14057   8072   
                http_response.status()
14058   8073   
            );
14059   8074   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
14060   8075   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
14061   8076   
                http_response.headers(),
14062   8077   
                expected_headers,
14063   8078   
            ));
14064   8079   
        }
14065   8080   
    }
14066         -
    /// Underflow or overflow should result in SerializationException
14067         -
    /// Test ID: RestJsonHeaderByteUnderflowOverflow_case4
        8081  +
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
        8082  +
    /// Test ID: RestJsonPathTimestampEpochRejectsMalformedValues_case2
14068   8083   
    #[::tokio::test]
14069         -
    async fn rest_json_header_byte_underflow_overflow_case4_malformed_request() {
        8084  +
    #[::tracing_test::traced_test]
        8085  +
    async fn rest_json_path_timestamp_epoch_rejects_malformed_values_case2_malformed_request() {
14070   8086   
        {
14071   8087   
            #[allow(unused_mut)]
14072   8088   
            let mut http_request = http::Request::builder()
14073         -
                .uri("/MalformedByte/1")
        8089  +
                .uri("/MalformedTimestampPathEpoch/0x42")
14074   8090   
                .method("POST")
14075         -
                .header("byteInHeader", "123000000000000000000000")
14076   8091   
                .body(::aws_smithy_http_server::body::Body::empty())
14077   8092   
                .unwrap();
14078   8093   
            #[allow(unused_mut)]
14079   8094   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
14080   8095   
            let config = crate::service::RestJsonConfig::builder().build();
14081   8096   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
14082         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
        8097  +
                            .malformed_timestamp_path_epoch(move |input: crate::input::MalformedTimestampPathEpochInput| {
14083   8098   
                                let sender = sender.clone();
14084   8099   
                                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> };
        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> };
14086   8101   
                                    sender.send(()).await.expect("receiver dropped early");
14087   8102   
                                    result
14088   8103   
                                }
14089   8104   
                            })
14090   8105   
                            .build_unchecked();
14091   8106   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
14092   8107   
                .await
14093   8108   
                .expect("unable to make an HTTP request");
14094   8109   
            ::pretty_assertions::assert_eq!(
14095   8110   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
14096   8111   
                http_response.status()
14097   8112   
            );
14098   8113   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
14099   8114   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
14100   8115   
                http_response.headers(),
14101   8116   
                expected_headers,
14102   8117   
            ));
14103   8118   
        }
14104   8119   
    }
14105         -
    /// Malformed values in the body should be rejected
14106         -
    /// Test ID: RestJsonBodyByteMalformedValueRejected_case0
        8120  +
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
        8121  +
    /// Test ID: RestJsonPathTimestampEpochRejectsMalformedValues_case3
14107   8122   
    #[::tokio::test]
14108         -
    async fn rest_json_body_byte_malformed_value_rejected_case0_malformed_request() {
        8123  +
    #[::tracing_test::traced_test]
        8124  +
    async fn rest_json_path_timestamp_epoch_rejects_malformed_values_case3_malformed_request() {
14109   8125   
        {
14110   8126   
            #[allow(unused_mut)]
14111   8127   
            let mut http_request = http::Request::builder()
14112         -
                .uri("/MalformedByte/1")
        8128  +
                .uri("/MalformedTimestampPathEpoch/1515531081.123.456")
14113   8129   
                .method("POST")
14114         -
                .header("content-type", "application/json")
14115         -
                .body(::aws_smithy_http_server::body::Body::from(
14116         -
                    ::bytes::Bytes::from_static("{ \"byteInBody\" : \"123\" }".as_bytes()),
14117         -
                ))
        8130  +
                .body(::aws_smithy_http_server::body::Body::empty())
14118   8131   
                .unwrap();
14119   8132   
            #[allow(unused_mut)]
14120   8133   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
14121   8134   
            let config = crate::service::RestJsonConfig::builder().build();
14122   8135   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
14123         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
        8136  +
                            .malformed_timestamp_path_epoch(move |input: crate::input::MalformedTimestampPathEpochInput| {
14124   8137   
                                let sender = sender.clone();
14125   8138   
                                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> };
        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> };
14127   8140   
                                    sender.send(()).await.expect("receiver dropped early");
14128   8141   
                                    result
14129   8142   
                                }
14130   8143   
                            })
14131   8144   
                            .build_unchecked();
14132   8145   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
14133   8146   
                .await
14134   8147   
                .expect("unable to make an HTTP request");
14135   8148   
            ::pretty_assertions::assert_eq!(
14136   8149   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
14137   8150   
                http_response.status()
14138   8151   
            );
14139   8152   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
14140   8153   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
14141   8154   
                http_response.headers(),
14142   8155   
                expected_headers,
14143   8156   
            ));
14144   8157   
        }
14145   8158   
    }
14146         -
    /// Malformed values in the body should be rejected
14147         -
    /// Test ID: RestJsonBodyByteMalformedValueRejected_case1
        8159  +
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
        8160  +
    /// Test ID: RestJsonPathTimestampEpochRejectsMalformedValues_case4
14148   8161   
    #[::tokio::test]
14149         -
    async fn rest_json_body_byte_malformed_value_rejected_case1_malformed_request() {
        8162  +
    #[::tracing_test::traced_test]
        8163  +
    async fn rest_json_path_timestamp_epoch_rejects_malformed_values_case4_malformed_request() {
14150   8164   
        {
14151   8165   
            #[allow(unused_mut)]
14152   8166   
            let mut http_request = http::Request::builder()
14153         -
                .uri("/MalformedByte/1")
14154         -
                .method("POST")
14155         -
                .header("content-type", "application/json")
14156         -
                .body(::aws_smithy_http_server::body::Body::from(
14157         -
                    ::bytes::Bytes::from_static("{ \"byteInBody\" : true }".as_bytes()),
14158         -
                ))
        8167  +
                .uri("/MalformedTimestampPathEpoch/Infinity")
        8168  +
                .method("POST")
        8169  +
                .body(::aws_smithy_http_server::body::Body::empty())
14159   8170   
                .unwrap();
14160   8171   
            #[allow(unused_mut)]
14161   8172   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
14162   8173   
            let config = crate::service::RestJsonConfig::builder().build();
14163   8174   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
14164         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
        8175  +
                            .malformed_timestamp_path_epoch(move |input: crate::input::MalformedTimestampPathEpochInput| {
14165   8176   
                                let sender = sender.clone();
14166   8177   
                                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> };
        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> };
14168   8179   
                                    sender.send(()).await.expect("receiver dropped early");
14169   8180   
                                    result
14170   8181   
                                }
14171   8182   
                            })
14172   8183   
                            .build_unchecked();
14173   8184   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
14174   8185   
                .await
14175   8186   
                .expect("unable to make an HTTP request");
14176   8187   
            ::pretty_assertions::assert_eq!(
14177   8188   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
14178   8189   
                http_response.status()
14179   8190   
            );
14180   8191   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
14181   8192   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
14182   8193   
                http_response.headers(),
14183   8194   
                expected_headers,
14184   8195   
            ));
14185   8196   
        }
14186   8197   
    }
14187         -
    /// Malformed values in the body should be rejected
14188         -
    /// Test ID: RestJsonBodyByteMalformedValueRejected_case2
        8198  +
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
        8199  +
    /// Test ID: RestJsonPathTimestampEpochRejectsMalformedValues_case5
14189   8200   
    #[::tokio::test]
14190         -
    async fn rest_json_body_byte_malformed_value_rejected_case2_malformed_request() {
        8201  +
    #[::tracing_test::traced_test]
        8202  +
    async fn rest_json_path_timestamp_epoch_rejects_malformed_values_case5_malformed_request() {
14191   8203   
        {
14192   8204   
            #[allow(unused_mut)]
14193   8205   
            let mut http_request = http::Request::builder()
14194         -
                .uri("/MalformedByte/1")
        8206  +
                .uri("/MalformedTimestampPathEpoch/-Infinity")
14195   8207   
                .method("POST")
14196         -
                .header("content-type", "application/json")
14197         -
                .body(::aws_smithy_http_server::body::Body::from(
14198         -
                    ::bytes::Bytes::from_static("{ \"byteInBody\" : 1.001 }".as_bytes()),
14199         -
                ))
        8208  +
                .body(::aws_smithy_http_server::body::Body::empty())
14200   8209   
                .unwrap();
14201   8210   
            #[allow(unused_mut)]
14202   8211   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
14203   8212   
            let config = crate::service::RestJsonConfig::builder().build();
14204   8213   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
14205         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
        8214  +
                            .malformed_timestamp_path_epoch(move |input: crate::input::MalformedTimestampPathEpochInput| {
14206   8215   
                                let sender = sender.clone();
14207   8216   
                                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> };
        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> };
14209   8218   
                                    sender.send(()).await.expect("receiver dropped early");
14210   8219   
                                    result
14211   8220   
                                }
14212   8221   
                            })
14213   8222   
                            .build_unchecked();
14214   8223   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
14215   8224   
                .await
14216   8225   
                .expect("unable to make an HTTP request");
14217   8226   
            ::pretty_assertions::assert_eq!(
14218   8227   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
14219   8228   
                http_response.status()
14220   8229   
            );
14221   8230   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
14222   8231   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
14223   8232   
                http_response.headers(),
14224   8233   
                expected_headers,
14225   8234   
            ));
14226   8235   
        }
14227   8236   
    }
14228         -
    /// Malformed values in the body should be rejected
14229         -
    /// Test ID: RestJsonBodyByteMalformedValueRejected_case3
        8237  +
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
        8238  +
    /// Test ID: RestJsonPathTimestampEpochRejectsMalformedValues_case6
14230   8239   
    #[::tokio::test]
14231         -
    async fn rest_json_body_byte_malformed_value_rejected_case3_malformed_request() {
        8240  +
    #[::tracing_test::traced_test]
        8241  +
    async fn rest_json_path_timestamp_epoch_rejects_malformed_values_case6_malformed_request() {
14232   8242   
        {
14233   8243   
            #[allow(unused_mut)]
14234   8244   
            let mut http_request = http::Request::builder()
14235         -
                .uri("/MalformedByte/1")
        8245  +
                .uri("/MalformedTimestampPathEpoch/NaN")
14236   8246   
                .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         -
                ))
        8247  +
                .body(::aws_smithy_http_server::body::Body::empty())
14241   8248   
                .unwrap();
14242   8249   
            #[allow(unused_mut)]
14243   8250   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
14244   8251   
            let config = crate::service::RestJsonConfig::builder().build();
14245   8252   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
14246         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
        8253  +
                            .malformed_timestamp_path_epoch(move |input: crate::input::MalformedTimestampPathEpochInput| {
14247   8254   
                                let sender = sender.clone();
14248   8255   
                                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> };
        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> };
14250   8257   
                                    sender.send(()).await.expect("receiver dropped early");
14251   8258   
                                    result
14252   8259   
                                }
14253   8260   
                            })
14254   8261   
                            .build_unchecked();
14255   8262   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
14256   8263   
                .await
14257   8264   
                .expect("unable to make an HTTP request");
14258   8265   
            ::pretty_assertions::assert_eq!(
14259   8266   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
14260   8267   
                http_response.status()
14261   8268   
            );
14262   8269   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
14263   8270   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
14264   8271   
                http_response.headers(),
14265   8272   
                expected_headers,
14266   8273   
            ));
14267   8274   
        }
14268   8275   
    }
14269         -
    /// Malformed values in the body should be rejected
14270         -
    /// Test ID: RestJsonBodyByteMalformedValueRejected_case4
        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
14271   8385   
    #[::tokio::test]
14272         -
    async fn rest_json_body_byte_malformed_value_rejected_case4_malformed_request() {
        8386  +
    #[::tracing_test::traced_test]
        8387  +
    async fn rest_json_path_timestamp_http_date_rejects_date_time_case0_malformed_request() {
14273   8388   
        {
14274   8389   
            #[allow(unused_mut)]
14275   8390   
            let mut http_request = http::Request::builder()
14276         -
                .uri("/MalformedByte/1")
        8391  +
                .uri("/MalformedTimestampPathHttpDate/1985-04-12T23%3A20%3A50.52Z")
14277   8392   
                .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         -
                ))
        8393  +
                .body(::aws_smithy_http_server::body::Body::empty())
14282   8394   
                .unwrap();
14283   8395   
            #[allow(unused_mut)]
14284   8396   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
14285   8397   
            let config = crate::service::RestJsonConfig::builder().build();
14286   8398   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
14287         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
        8399  +
                            .malformed_timestamp_path_http_date(move |input: crate::input::MalformedTimestampPathHttpDateInput| {
14288   8400   
                                let sender = sender.clone();
14289   8401   
                                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> };
        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> };
14291   8403   
                                    sender.send(()).await.expect("receiver dropped early");
14292   8404   
                                    result
14293   8405   
                                }
14294   8406   
                            })
14295   8407   
                            .build_unchecked();
14296   8408   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
14297   8409   
                .await
14298   8410   
                .expect("unable to make an HTTP request");
14299   8411   
            ::pretty_assertions::assert_eq!(
14300   8412   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
14301   8413   
                http_response.status()
14302   8414   
            );
14303   8415   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
14304   8416   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
14305   8417   
                http_response.headers(),
14306   8418   
                expected_headers,
14307   8419   
            ));
14308   8420   
        }
14309   8421   
    }
14310         -
    /// Malformed values in the body should be rejected
14311         -
    /// Test ID: RestJsonBodyByteMalformedValueRejected_case5
        8422  +
    /// When the format is http-date, RFC3339 timestamps are rejected with a
        8423  +
    /// 400 SerializationException
        8424  +
    /// Test ID: RestJsonPathTimestampHttpDateRejectsDateTime_case1
14312   8425   
    #[::tokio::test]
14313         -
    async fn rest_json_body_byte_malformed_value_rejected_case5_malformed_request() {
        8426  +
    #[::tracing_test::traced_test]
        8427  +
    async fn rest_json_path_timestamp_http_date_rejects_date_time_case1_malformed_request() {
14314   8428   
        {
14315   8429   
            #[allow(unused_mut)]
14316   8430   
            let mut http_request = http::Request::builder()
14317         -
                .uri("/MalformedByte/1")
        8431  +
                .uri("/MalformedTimestampPathHttpDate/1985-04-12T23%3A20%3A50Z")
14318   8432   
                .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         -
                ))
        8433  +
                .body(::aws_smithy_http_server::body::Body::empty())
14323   8434   
                .unwrap();
14324   8435   
            #[allow(unused_mut)]
14325   8436   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
14326   8437   
            let config = crate::service::RestJsonConfig::builder().build();
14327   8438   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
14328         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
        8439  +
                            .malformed_timestamp_path_http_date(move |input: crate::input::MalformedTimestampPathHttpDateInput| {
14329   8440   
                                let sender = sender.clone();
14330   8441   
                                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> };
        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> };
14332   8443   
                                    sender.send(()).await.expect("receiver dropped early");
14333   8444   
                                    result
14334   8445   
                                }
14335   8446   
                            })
14336   8447   
                            .build_unchecked();
14337   8448   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
14338   8449   
                .await
14339   8450   
                .expect("unable to make an HTTP request");
14340   8451   
            ::pretty_assertions::assert_eq!(
14341   8452   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
14342   8453   
                http_response.status()
14343   8454   
            );
14344   8455   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
14345   8456   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
14346   8457   
                http_response.headers(),
14347   8458   
                expected_headers,
14348   8459   
            ));
14349   8460   
        }
14350   8461   
    }
14351         -
    /// Malformed values in the body should be rejected
14352         -
    /// Test ID: RestJsonBodyByteMalformedValueRejected_case6
        8462  +
    /// When the format is http-date, RFC3339 timestamps are rejected with a
        8463  +
    /// 400 SerializationException
        8464  +
    /// Test ID: RestJsonPathTimestampHttpDateRejectsDateTime_case2
14353   8465   
    #[::tokio::test]
14354         -
    async fn rest_json_body_byte_malformed_value_rejected_case6_malformed_request() {
        8466  +
    #[::tracing_test::traced_test]
        8467  +
    async fn rest_json_path_timestamp_http_date_rejects_date_time_case2_malformed_request() {
14355   8468   
        {
14356   8469   
            #[allow(unused_mut)]
14357   8470   
            let mut http_request = http::Request::builder()
14358         -
                .uri("/MalformedByte/1")
        8471  +
                .uri("/MalformedTimestampPathHttpDate/1996-12-19T16%3A39%3A57-08%3A00")
14359   8472   
                .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         -
                ))
        8473  +
                .body(::aws_smithy_http_server::body::Body::empty())
14364   8474   
                .unwrap();
14365   8475   
            #[allow(unused_mut)]
14366   8476   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
14367   8477   
            let config = crate::service::RestJsonConfig::builder().build();
14368   8478   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
14369         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
        8479  +
                            .malformed_timestamp_path_http_date(move |input: crate::input::MalformedTimestampPathHttpDateInput| {
14370   8480   
                                let sender = sender.clone();
14371   8481   
                                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> };
        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> };
14373   8483   
                                    sender.send(()).await.expect("receiver dropped early");
14374   8484   
                                    result
14375   8485   
                                }
14376   8486   
                            })
14377   8487   
                            .build_unchecked();
14378   8488   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
14379   8489   
                .await
14380   8490   
                .expect("unable to make an HTTP request");
14381   8491   
            ::pretty_assertions::assert_eq!(
14382   8492   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
14383   8493   
                http_response.status()
14384   8494   
            );
14385   8495   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
14386   8496   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
14387   8497   
                http_response.headers(),
14388   8498   
                expected_headers,
14389   8499   
            ));
14390   8500   
        }
14391   8501   
    }
14392         -
    /// Malformed values in the body should be rejected
14393         -
    /// Test ID: RestJsonBodyByteMalformedValueRejected_case7
        8502  +
    /// When the format is http-date,  epoch second timestamps are rejected with a
        8503  +
    /// 400 SerializationException
        8504  +
    /// Test ID: RestJsonPathTimestampHttpDateRejectsEpochSeconds_case0
14394   8505   
    #[::tokio::test]
14395         -
    async fn rest_json_body_byte_malformed_value_rejected_case7_malformed_request() {
        8506  +
    #[::tracing_test::traced_test]
        8507  +
    async fn rest_json_path_timestamp_http_date_rejects_epoch_seconds_case0_malformed_request() {
14396   8508   
        {
14397   8509   
            #[allow(unused_mut)]
14398   8510   
            let mut http_request = http::Request::builder()
14399         -
                .uri("/MalformedByte/1")
        8511  +
                .uri("/MalformedTimestampPathHttpDate/1515531081.1234")
14400   8512   
                .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         -
                ))
        8513  +
                .body(::aws_smithy_http_server::body::Body::empty())
14405   8514   
                .unwrap();
14406   8515   
            #[allow(unused_mut)]
14407   8516   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
14408   8517   
            let config = crate::service::RestJsonConfig::builder().build();
14409   8518   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
14410         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
        8519  +
                            .malformed_timestamp_path_http_date(move |input: crate::input::MalformedTimestampPathHttpDateInput| {
14411   8520   
                                let sender = sender.clone();
14412   8521   
                                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> };
        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> };
14414   8523   
                                    sender.send(()).await.expect("receiver dropped early");
14415   8524   
                                    result
14416   8525   
                                }
14417   8526   
                            })
14418   8527   
                            .build_unchecked();
14419   8528   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
14420   8529   
                .await
14421   8530   
                .expect("unable to make an HTTP request");
14422   8531   
            ::pretty_assertions::assert_eq!(
14423   8532   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
14424   8533   
                http_response.status()
14425   8534   
            );
14426   8535   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
14427   8536   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
14428   8537   
                http_response.headers(),
14429   8538   
                expected_headers,
14430   8539   
            ));
14431   8540   
        }
14432   8541   
    }
14433         -
    /// Malformed values in the body should be rejected
14434         -
    /// Test ID: RestJsonBodyByteMalformedValueRejected_case8
        8542  +
    /// When the format is http-date,  epoch second timestamps are rejected with a
        8543  +
    /// 400 SerializationException
        8544  +
    /// Test ID: RestJsonPathTimestampHttpDateRejectsEpochSeconds_case1
14435   8545   
    #[::tokio::test]
14436         -
    async fn rest_json_body_byte_malformed_value_rejected_case8_malformed_request() {
        8546  +
    #[::tracing_test::traced_test]
        8547  +
    async fn rest_json_path_timestamp_http_date_rejects_epoch_seconds_case1_malformed_request() {
14437   8548   
        {
14438   8549   
            #[allow(unused_mut)]
14439   8550   
            let mut http_request = http::Request::builder()
14440         -
                .uri("/MalformedByte/1")
        8551  +
                .uri("/MalformedTimestampPathHttpDate/1515531081")
14441   8552   
                .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         -
                ))
        8553  +
                .body(::aws_smithy_http_server::body::Body::empty())
14446   8554   
                .unwrap();
14447   8555   
            #[allow(unused_mut)]
14448   8556   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
14449   8557   
            let config = crate::service::RestJsonConfig::builder().build();
14450   8558   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
14451         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
        8559  +
                            .malformed_timestamp_path_http_date(move |input: crate::input::MalformedTimestampPathHttpDateInput| {
14452   8560   
                                let sender = sender.clone();
14453   8561   
                                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> };
        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> };
14455   8563   
                                    sender.send(()).await.expect("receiver dropped early");
14456   8564   
                                    result
14457   8565   
                                }
14458   8566   
                            })
14459   8567   
                            .build_unchecked();
14460   8568   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
14461   8569   
                .await
14462   8570   
                .expect("unable to make an HTTP request");
14463   8571   
            ::pretty_assertions::assert_eq!(
14464   8572   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
14465   8573   
                http_response.status()
14466   8574   
            );
14467   8575   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
14468   8576   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
14469   8577   
                http_response.headers(),
14470   8578   
                expected_headers,
14471   8579   
            ));
14472   8580   
        }
14473   8581   
    }
14474         -
    /// Malformed values in the body should be rejected
14475         -
    /// Test ID: RestJsonBodyByteMalformedValueRejected_case9
        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
14476   8691   
    #[::tokio::test]
14477         -
    async fn rest_json_body_byte_malformed_value_rejected_case9_malformed_request() {
        8692  +
    #[::tracing_test::traced_test]
        8693  +
    async fn rest_json_path_timestamp_default_rejects_http_date_case0_malformed_request() {
14478   8694   
        {
14479   8695   
            #[allow(unused_mut)]
14480   8696   
            let mut http_request = http::Request::builder()
14481         -
                .uri("/MalformedByte/1")
        8697  +
                .uri("/MalformedTimestampPathDefault/Tue%2C%2029%20Apr%202014%2018%3A30%3A38%20GMT")
14482   8698   
                .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         -
                ))
        8699  +
                .body(::aws_smithy_http_server::body::Body::empty())
14487   8700   
                .unwrap();
14488   8701   
            #[allow(unused_mut)]
14489   8702   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
14490   8703   
            let config = crate::service::RestJsonConfig::builder().build();
14491   8704   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
14492         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
        8705  +
                            .malformed_timestamp_path_default(move |input: crate::input::MalformedTimestampPathDefaultInput| {
14493   8706   
                                let sender = sender.clone();
14494   8707   
                                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> };
        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> };
14496   8709   
                                    sender.send(()).await.expect("receiver dropped early");
14497   8710   
                                    result
14498   8711   
                                }
14499   8712   
                            })
14500   8713   
                            .build_unchecked();
14501   8714   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
14502   8715   
                .await
14503   8716   
                .expect("unable to make an HTTP request");
14504   8717   
            ::pretty_assertions::assert_eq!(
14505   8718   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
14506   8719   
                http_response.status()
14507   8720   
            );
14508   8721   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
14509   8722   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
14510   8723   
                http_response.headers(),
14511   8724   
                expected_headers,
14512   8725   
            ));
14513   8726   
        }
14514   8727   
    }
14515         -
    /// Malformed values in the body should be rejected
14516         -
    /// Test ID: RestJsonBodyByteMalformedValueRejected_case10
        8728  +
    /// By default, IMF-fixdate timestamps are rejected with a
        8729  +
    /// 400 SerializationException
        8730  +
    /// Test ID: RestJsonPathTimestampDefaultRejectsHttpDate_case1
14517   8731   
    #[::tokio::test]
14518         -
    async fn rest_json_body_byte_malformed_value_rejected_case10_malformed_request() {
        8732  +
    #[::tracing_test::traced_test]
        8733  +
    async fn rest_json_path_timestamp_default_rejects_http_date_case1_malformed_request() {
14519   8734   
        {
14520   8735   
            #[allow(unused_mut)]
14521         -
            let mut http_request = http::Request::builder()
14522         -
                .uri("/MalformedByte/1")
14523         -
                .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         -
                ))
14528         -
                .unwrap();
        8736  +
                        let mut http_request = http::Request::builder()
        8737  +
                            .uri("/MalformedTimestampPathDefault/Sun%2C%2002%20Jan%202000%2020%3A34%3A56.000%20GMT")
        8738  +
                            .method("POST")
        8739  +
            .body(::aws_smithy_http_server::body::Body::empty()).unwrap();
14529   8740   
            #[allow(unused_mut)]
14530   8741   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
14531   8742   
            let config = crate::service::RestJsonConfig::builder().build();
14532   8743   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
14533         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
        8744  +
                            .malformed_timestamp_path_default(move |input: crate::input::MalformedTimestampPathDefaultInput| {
14534   8745   
                                let sender = sender.clone();
14535   8746   
                                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> };
        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> };
14537   8748   
                                    sender.send(()).await.expect("receiver dropped early");
14538   8749   
                                    result
14539   8750   
                                }
14540   8751   
                            })
14541   8752   
                            .build_unchecked();
14542   8753   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
14543   8754   
                .await
14544   8755   
                .expect("unable to make an HTTP request");
14545   8756   
            ::pretty_assertions::assert_eq!(
14546   8757   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
14547   8758   
                http_response.status()
14548   8759   
            );
14549   8760   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
14550   8761   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
14551   8762   
                http_response.headers(),
14552   8763   
                expected_headers,
14553   8764   
            ));
14554   8765   
        }
14555   8766   
    }
14556         -
    /// Malformed values in the path should be rejected
14557         -
    /// Test ID: RestJsonPathByteMalformedValueRejected_case0
        8767  +
    /// By default, epoch second timestamps are rejected with a
        8768  +
    /// 400 SerializationException
        8769  +
    /// Test ID: RestJsonPathTimestampDefaultRejectsEpochSeconds_case0
14558   8770   
    #[::tokio::test]
14559         -
    async fn rest_json_path_byte_malformed_value_rejected_case0_malformed_request() {
        8771  +
    #[::tracing_test::traced_test]
        8772  +
    async fn rest_json_path_timestamp_default_rejects_epoch_seconds_case0_malformed_request() {
14560   8773   
        {
14561   8774   
            #[allow(unused_mut)]
14562   8775   
            let mut http_request = http::Request::builder()
14563         -
                .uri("/MalformedByte/true")
        8776  +
                .uri("/MalformedTimestampPathDefault/1515531081.1234")
14564   8777   
                .method("POST")
14565   8778   
                .body(::aws_smithy_http_server::body::Body::empty())
14566   8779   
                .unwrap();
14567   8780   
            #[allow(unused_mut)]
14568   8781   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
14569   8782   
            let config = crate::service::RestJsonConfig::builder().build();
14570   8783   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
14571         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
        8784  +
                            .malformed_timestamp_path_default(move |input: crate::input::MalformedTimestampPathDefaultInput| {
14572   8785   
                                let sender = sender.clone();
14573   8786   
                                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> };
        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> };
14575   8788   
                                    sender.send(()).await.expect("receiver dropped early");
14576   8789   
                                    result
14577   8790   
                                }
14578   8791   
                            })
14579   8792   
                            .build_unchecked();
14580   8793   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
14581   8794   
                .await
14582   8795   
                .expect("unable to make an HTTP request");
14583   8796   
            ::pretty_assertions::assert_eq!(
14584   8797   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
14585   8798   
                http_response.status()
14586   8799   
            );
14587   8800   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
14588   8801   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
14589   8802   
                http_response.headers(),
14590   8803   
                expected_headers,
14591   8804   
            ));
14592   8805   
        }
14593   8806   
    }
14594         -
    /// Malformed values in the path should be rejected
14595         -
    /// Test ID: RestJsonPathByteMalformedValueRejected_case1
        8807  +
    /// By default, epoch second timestamps are rejected with a
        8808  +
    /// 400 SerializationException
        8809  +
    /// Test ID: RestJsonPathTimestampDefaultRejectsEpochSeconds_case1
14596   8810   
    #[::tokio::test]
14597         -
    async fn rest_json_path_byte_malformed_value_rejected_case1_malformed_request() {
        8811  +
    #[::tracing_test::traced_test]
        8812  +
    async fn rest_json_path_timestamp_default_rejects_epoch_seconds_case1_malformed_request() {
14598   8813   
        {
14599   8814   
            #[allow(unused_mut)]
14600   8815   
            let mut http_request = http::Request::builder()
14601         -
                .uri("/MalformedByte/1.001")
        8816  +
                .uri("/MalformedTimestampPathDefault/1515531081")
14602   8817   
                .method("POST")
14603   8818   
                .body(::aws_smithy_http_server::body::Body::empty())
14604   8819   
                .unwrap();
14605   8820   
            #[allow(unused_mut)]
14606   8821   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
14607   8822   
            let config = crate::service::RestJsonConfig::builder().build();
14608   8823   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
14609         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
        8824  +
                            .malformed_timestamp_path_default(move |input: crate::input::MalformedTimestampPathDefaultInput| {
14610   8825   
                                let sender = sender.clone();
14611   8826   
                                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> };
        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> };
14613   8828   
                                    sender.send(()).await.expect("receiver dropped early");
14614   8829   
                                    result
14615   8830   
                                }
14616   8831   
                            })
14617   8832   
                            .build_unchecked();
14618   8833   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
14619   8834   
                .await
14620   8835   
                .expect("unable to make an HTTP request");
14621   8836   
            ::pretty_assertions::assert_eq!(
14622   8837   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
14623   8838   
                http_response.status()
14624   8839   
            );
14625   8840   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
14626   8841   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
14627   8842   
                http_response.headers(),
14628   8843   
                expected_headers,
14629   8844   
            ));
14630   8845   
        }
14631   8846   
    }
14632         -
    /// Malformed values in the path should be rejected
14633         -
    /// Test ID: RestJsonPathByteMalformedValueRejected_case2
        8847  +
    /// UTC offsets must be rejected with a
        8848  +
    /// 400 SerializationException
        8849  +
    /// Test ID: RestJsonPathTimestampDefaultRejectsUTCOffsets
14634   8850   
    #[::tokio::test]
14635         -
    async fn rest_json_path_byte_malformed_value_rejected_case2_malformed_request() {
        8851  +
    #[::tracing_test::traced_test]
        8852  +
    async fn rest_json_path_timestamp_default_rejects_utc_offsets_malformed_request() {
14636   8853   
        {
14637   8854   
            #[allow(unused_mut)]
14638   8855   
            let mut http_request = http::Request::builder()
14639         -
                .uri("/MalformedByte/2ABC")
        8856  +
                .uri("/MalformedTimestampPathDefault/1996-12-19T16%3A39%3A57-08%3A00")
14640   8857   
                .method("POST")
14641   8858   
                .body(::aws_smithy_http_server::body::Body::empty())
14642   8859   
                .unwrap();
14643   8860   
            #[allow(unused_mut)]
14644   8861   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
14645   8862   
            let config = crate::service::RestJsonConfig::builder().build();
14646   8863   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
14647         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
        8864  +
                            .malformed_timestamp_path_default(move |input: crate::input::MalformedTimestampPathDefaultInput| {
14648   8865   
                                let sender = sender.clone();
14649   8866   
                                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> };
        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> };
14651   8868   
                                    sender.send(()).await.expect("receiver dropped early");
14652   8869   
                                    result
14653   8870   
                                }
14654   8871   
                            })
14655   8872   
                            .build_unchecked();
14656   8873   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
14657   8874   
                .await
14658   8875   
                .expect("unable to make an HTTP request");
14659   8876   
            ::pretty_assertions::assert_eq!(
14660   8877   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
14661   8878   
                http_response.status()
14662   8879   
            );
14663   8880   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
14664   8881   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
14665   8882   
                http_response.headers(),
14666   8883   
                expected_headers,
14667   8884   
            ));
14668   8885   
        }
14669   8886   
    }
14670         -
    /// Malformed values in the path should be rejected
14671         -
    /// Test ID: RestJsonPathByteMalformedValueRejected_case3
        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
14672   8890   
    #[::tokio::test]
14673         -
    async fn rest_json_path_byte_malformed_value_rejected_case3_malformed_request() {
        8891  +
    #[::tracing_test::traced_test]
        8892  +
    async fn rest_json_path_timestamp_default_rejects_different8601_formats_case0_malformed_request(
        8893  +
    ) {
14674   8894   
        {
14675   8895   
            #[allow(unused_mut)]
14676   8896   
            let mut http_request = http::Request::builder()
14677         -
                .uri("/MalformedByte/0x42")
        8897  +
                .uri("/MalformedTimestampPathDefault/1996-12-19T16%3A39%3A57%2B00")
14678   8898   
                .method("POST")
14679   8899   
                .body(::aws_smithy_http_server::body::Body::empty())
14680   8900   
                .unwrap();
14681   8901   
            #[allow(unused_mut)]
14682   8902   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
14683   8903   
            let config = crate::service::RestJsonConfig::builder().build();
14684   8904   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
14685         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
        8905  +
                            .malformed_timestamp_path_default(move |input: crate::input::MalformedTimestampPathDefaultInput| {
14686   8906   
                                let sender = sender.clone();
14687   8907   
                                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> };
        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> };
14689   8909   
                                    sender.send(()).await.expect("receiver dropped early");
14690   8910   
                                    result
14691   8911   
                                }
14692   8912   
                            })
14693   8913   
                            .build_unchecked();
14694   8914   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
14695   8915   
                .await
14696   8916   
                .expect("unable to make an HTTP request");
14697   8917   
            ::pretty_assertions::assert_eq!(
14698   8918   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
14699   8919   
                http_response.status()
14700   8920   
            );
14701   8921   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
14702   8922   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
14703   8923   
                http_response.headers(),
14704   8924   
                expected_headers,
14705   8925   
            ));
14706   8926   
        }
14707   8927   
    }
14708         -
    /// Malformed values in the path should be rejected
14709         -
    /// Test ID: RestJsonPathByteMalformedValueRejected_case4
        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
14710   8931   
    #[::tokio::test]
14711         -
    async fn rest_json_path_byte_malformed_value_rejected_case4_malformed_request() {
        8932  +
    #[::tracing_test::traced_test]
        8933  +
    async fn rest_json_path_timestamp_default_rejects_different8601_formats_case1_malformed_request(
        8934  +
    ) {
14712   8935   
        {
14713   8936   
            #[allow(unused_mut)]
14714   8937   
            let mut http_request = http::Request::builder()
14715         -
                .uri("/MalformedByte/Infinity")
        8938  +
                .uri("/MalformedTimestampPathDefault/1996-12-19T16%3A39%3A57%2B00Z")
14716   8939   
                .method("POST")
14717   8940   
                .body(::aws_smithy_http_server::body::Body::empty())
14718   8941   
                .unwrap();
14719   8942   
            #[allow(unused_mut)]
14720   8943   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
14721   8944   
            let config = crate::service::RestJsonConfig::builder().build();
14722   8945   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
14723         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
        8946  +
                            .malformed_timestamp_path_default(move |input: crate::input::MalformedTimestampPathDefaultInput| {
14724   8947   
                                let sender = sender.clone();
14725   8948   
                                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> };
        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> };
14727   8950   
                                    sender.send(()).await.expect("receiver dropped early");
14728   8951   
                                    result
14729   8952   
                                }
14730   8953   
                            })
14731   8954   
                            .build_unchecked();
14732   8955   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
14733   8956   
                .await
14734   8957   
                .expect("unable to make an HTTP request");
14735   8958   
            ::pretty_assertions::assert_eq!(
14736   8959   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
14737   8960   
                http_response.status()
14738   8961   
            );
14739   8962   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
14740   8963   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
14741   8964   
                http_response.headers(),
14742   8965   
                expected_headers,
14743   8966   
            ));
14744   8967   
        }
14745   8968   
    }
14746         -
    /// Malformed values in the path should be rejected
14747         -
    /// Test ID: RestJsonPathByteMalformedValueRejected_case5
        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
14748   8972   
    #[::tokio::test]
14749         -
    async fn rest_json_path_byte_malformed_value_rejected_case5_malformed_request() {
        8973  +
    #[::tracing_test::traced_test]
        8974  +
    async fn rest_json_path_timestamp_default_rejects_different8601_formats_case2_malformed_request(
        8975  +
    ) {
14750   8976   
        {
14751   8977   
            #[allow(unused_mut)]
14752   8978   
            let mut http_request = http::Request::builder()
14753         -
                .uri("/MalformedByte/-Infinity")
        8979  +
                .uri("/MalformedTimestampPathDefault/1996-12-19T16%3A39%3A57")
14754   8980   
                .method("POST")
14755   8981   
                .body(::aws_smithy_http_server::body::Body::empty())
14756   8982   
                .unwrap();
14757   8983   
            #[allow(unused_mut)]
14758   8984   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
14759   8985   
            let config = crate::service::RestJsonConfig::builder().build();
14760   8986   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
14761         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
        8987  +
                            .malformed_timestamp_path_default(move |input: crate::input::MalformedTimestampPathDefaultInput| {
14762   8988   
                                let sender = sender.clone();
14763   8989   
                                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> };
        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> };
14765   8991   
                                    sender.send(()).await.expect("receiver dropped early");
14766   8992   
                                    result
14767   8993   
                                }
14768   8994   
                            })
14769   8995   
                            .build_unchecked();
14770   8996   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
14771   8997   
                .await
14772   8998   
                .expect("unable to make an HTTP request");
14773   8999   
            ::pretty_assertions::assert_eq!(
14774   9000   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
14775   9001   
                http_response.status()
14776   9002   
            );
14777   9003   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
14778   9004   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
14779   9005   
                http_response.headers(),
14780   9006   
                expected_headers,
14781   9007   
            ));
14782   9008   
        }
14783   9009   
    }
14784         -
    /// Malformed values in the path should be rejected
14785         -
    /// Test ID: RestJsonPathByteMalformedValueRejected_case6
        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
14786   9013   
    #[::tokio::test]
14787         -
    async fn rest_json_path_byte_malformed_value_rejected_case6_malformed_request() {
        9014  +
    #[::tracing_test::traced_test]
        9015  +
    async fn rest_json_path_timestamp_default_rejects_different8601_formats_case3_malformed_request(
        9016  +
    ) {
14788   9017   
        {
14789   9018   
            #[allow(unused_mut)]
14790   9019   
            let mut http_request = http::Request::builder()
14791         -
                .uri("/MalformedByte/NaN")
        9020  +
                .uri("/MalformedTimestampPathDefault/1996-12-19T163957")
14792   9021   
                .method("POST")
14793   9022   
                .body(::aws_smithy_http_server::body::Body::empty())
14794   9023   
                .unwrap();
14795   9024   
            #[allow(unused_mut)]
14796   9025   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
14797   9026   
            let config = crate::service::RestJsonConfig::builder().build();
14798   9027   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
14799         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
        9028  +
                            .malformed_timestamp_path_default(move |input: crate::input::MalformedTimestampPathDefaultInput| {
14800   9029   
                                let sender = sender.clone();
14801   9030   
                                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> };
        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> };
14803   9032   
                                    sender.send(()).await.expect("receiver dropped early");
14804   9033   
                                    result
14805   9034   
                                }
14806   9035   
                            })
14807   9036   
                            .build_unchecked();
14808   9037   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
14809   9038   
                .await
14810   9039   
                .expect("unable to make an HTTP request");
14811   9040   
            ::pretty_assertions::assert_eq!(
14812   9041   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
14813   9042   
                http_response.status()
14814   9043   
            );
14815   9044   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
14816   9045   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
14817   9046   
                http_response.headers(),
14818   9047   
                expected_headers,
14819   9048   
            ));
14820   9049   
        }
14821   9050   
    }
14822         -
    /// Malformed values in query parameters should be rejected
14823         -
    /// Test ID: RestJsonQueryByteMalformedValueRejected_case0
        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
14824   9054   
    #[::tokio::test]
14825         -
    async fn rest_json_query_byte_malformed_value_rejected_case0_malformed_request() {
        9055  +
    #[::tracing_test::traced_test]
        9056  +
    async fn rest_json_path_timestamp_default_rejects_different8601_formats_case4_malformed_request(
        9057  +
    ) {
14826   9058   
        {
14827   9059   
            #[allow(unused_mut)]
14828   9060   
            let mut http_request = http::Request::builder()
14829         -
                .uri("/MalformedByte/1")
        9061  +
                .uri("/MalformedTimestampPathDefault/19961219T163957Z")
14830   9062   
                .method("POST")
14831   9063   
                .body(::aws_smithy_http_server::body::Body::empty())
14832   9064   
                .unwrap();
14833         -
            *http_request.uri_mut() = "/MalformedByte/1?byteInQuery=true".parse().unwrap();
14834   9065   
            #[allow(unused_mut)]
14835   9066   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
14836   9067   
            let config = crate::service::RestJsonConfig::builder().build();
14837   9068   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
14838         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
        9069  +
                            .malformed_timestamp_path_default(move |input: crate::input::MalformedTimestampPathDefaultInput| {
14839   9070   
                                let sender = sender.clone();
14840   9071   
                                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> };
        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> };
14842   9073   
                                    sender.send(()).await.expect("receiver dropped early");
14843   9074   
                                    result
14844   9075   
                                }
14845   9076   
                            })
14846   9077   
                            .build_unchecked();
14847   9078   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
14848   9079   
                .await
14849   9080   
                .expect("unable to make an HTTP request");
14850   9081   
            ::pretty_assertions::assert_eq!(
14851   9082   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
14852   9083   
                http_response.status()
14853   9084   
            );
14854   9085   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
14855   9086   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
14856   9087   
                http_response.headers(),
14857   9088   
                expected_headers,
14858   9089   
            ));
14859   9090   
        }
14860   9091   
    }
14861         -
    /// Malformed values in query parameters should be rejected
14862         -
    /// Test ID: RestJsonQueryByteMalformedValueRejected_case1
        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
14863   9095   
    #[::tokio::test]
14864         -
    async fn rest_json_query_byte_malformed_value_rejected_case1_malformed_request() {
        9096  +
    #[::tracing_test::traced_test]
        9097  +
    async fn rest_json_path_timestamp_default_rejects_different8601_formats_case5_malformed_request(
        9098  +
    ) {
14865   9099   
        {
14866   9100   
            #[allow(unused_mut)]
14867   9101   
            let mut http_request = http::Request::builder()
14868         -
                .uri("/MalformedByte/1")
        9102  +
                .uri("/MalformedTimestampPathDefault/19961219T163957")
14869   9103   
                .method("POST")
14870   9104   
                .body(::aws_smithy_http_server::body::Body::empty())
14871   9105   
                .unwrap();
14872         -
            *http_request.uri_mut() = "/MalformedByte/1?byteInQuery=1.001".parse().unwrap();
14873   9106   
            #[allow(unused_mut)]
14874   9107   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
14875   9108   
            let config = crate::service::RestJsonConfig::builder().build();
14876   9109   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
14877         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
        9110  +
                            .malformed_timestamp_path_default(move |input: crate::input::MalformedTimestampPathDefaultInput| {
14878   9111   
                                let sender = sender.clone();
14879   9112   
                                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> };
        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> };
14881   9114   
                                    sender.send(()).await.expect("receiver dropped early");
14882   9115   
                                    result
14883   9116   
                                }
14884   9117   
                            })
14885   9118   
                            .build_unchecked();
14886   9119   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
14887   9120   
                .await
14888   9121   
                .expect("unable to make an HTTP request");
14889   9122   
            ::pretty_assertions::assert_eq!(
14890   9123   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
14891   9124   
                http_response.status()
14892   9125   
            );
14893   9126   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
14894   9127   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
14895   9128   
                http_response.headers(),
14896   9129   
                expected_headers,
14897   9130   
            ));
14898   9131   
        }
14899   9132   
    }
14900         -
    /// Malformed values in query parameters should be rejected
14901         -
    /// Test ID: RestJsonQueryByteMalformedValueRejected_case2
        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
14902   9136   
    #[::tokio::test]
14903         -
    async fn rest_json_query_byte_malformed_value_rejected_case2_malformed_request() {
        9137  +
    #[::tracing_test::traced_test]
        9138  +
    async fn rest_json_path_timestamp_default_rejects_different8601_formats_case6_malformed_request(
        9139  +
    ) {
14904   9140   
        {
14905   9141   
            #[allow(unused_mut)]
14906   9142   
            let mut http_request = http::Request::builder()
14907         -
                .uri("/MalformedByte/1")
        9143  +
                .uri("/MalformedTimestampPathDefault/19961219T16%3A39%3A57Z")
14908   9144   
                .method("POST")
14909   9145   
                .body(::aws_smithy_http_server::body::Body::empty())
14910   9146   
                .unwrap();
14911         -
            *http_request.uri_mut() = "/MalformedByte/1?byteInQuery=2ABC".parse().unwrap();
14912   9147   
            #[allow(unused_mut)]
14913   9148   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
14914   9149   
            let config = crate::service::RestJsonConfig::builder().build();
14915   9150   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
14916         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
        9151  +
                            .malformed_timestamp_path_default(move |input: crate::input::MalformedTimestampPathDefaultInput| {
14917   9152   
                                let sender = sender.clone();
14918   9153   
                                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> };
        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> };
14920   9155   
                                    sender.send(()).await.expect("receiver dropped early");
14921   9156   
                                    result
14922   9157   
                                }
14923   9158   
                            })
14924   9159   
                            .build_unchecked();
14925   9160   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
14926   9161   
                .await
14927   9162   
                .expect("unable to make an HTTP request");
14928   9163   
            ::pretty_assertions::assert_eq!(
14929   9164   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
14930   9165   
                http_response.status()
14931   9166   
            );
14932   9167   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
14933   9168   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
14934   9169   
                http_response.headers(),
14935   9170   
                expected_headers,
14936   9171   
            ));
14937   9172   
        }
14938   9173   
    }
14939         -
    /// Malformed values in query parameters should be rejected
14940         -
    /// Test ID: RestJsonQueryByteMalformedValueRejected_case3
        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
14941   9177   
    #[::tokio::test]
14942         -
    async fn rest_json_query_byte_malformed_value_rejected_case3_malformed_request() {
        9178  +
    #[::tracing_test::traced_test]
        9179  +
    async fn rest_json_path_timestamp_default_rejects_different8601_formats_case7_malformed_request(
        9180  +
    ) {
14943   9181   
        {
14944   9182   
            #[allow(unused_mut)]
14945   9183   
            let mut http_request = http::Request::builder()
14946         -
                .uri("/MalformedByte/1")
        9184  +
                .uri("/MalformedTimestampPathDefault/19961219T16%3A39%3A57")
14947   9185   
                .method("POST")
14948   9186   
                .body(::aws_smithy_http_server::body::Body::empty())
14949   9187   
                .unwrap();
14950         -
            *http_request.uri_mut() = "/MalformedByte/1?byteInQuery=0x42".parse().unwrap();
14951   9188   
            #[allow(unused_mut)]
14952   9189   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
14953   9190   
            let config = crate::service::RestJsonConfig::builder().build();
14954   9191   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
14955         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
        9192  +
                            .malformed_timestamp_path_default(move |input: crate::input::MalformedTimestampPathDefaultInput| {
14956   9193   
                                let sender = sender.clone();
14957   9194   
                                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> };
        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> };
14959   9196   
                                    sender.send(()).await.expect("receiver dropped early");
14960   9197   
                                    result
14961   9198   
                                }
14962   9199   
                            })
14963   9200   
                            .build_unchecked();
14964   9201   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
14965   9202   
                .await
14966   9203   
                .expect("unable to make an HTTP request");
14967   9204   
            ::pretty_assertions::assert_eq!(
14968   9205   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
14969   9206   
                http_response.status()
14970   9207   
            );
14971   9208   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
14972   9209   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
14973   9210   
                http_response.headers(),
14974   9211   
                expected_headers,
14975   9212   
            ));
14976   9213   
        }
14977   9214   
    }
14978         -
    /// Malformed values in query parameters should be rejected
14979         -
    /// Test ID: RestJsonQueryByteMalformedValueRejected_case4
        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
14980   9218   
    #[::tokio::test]
14981         -
    async fn rest_json_query_byte_malformed_value_rejected_case4_malformed_request() {
        9219  +
    #[::tracing_test::traced_test]
        9220  +
    async fn rest_json_path_timestamp_default_rejects_different8601_formats_case8_malformed_request(
        9221  +
    ) {
14982   9222   
        {
14983   9223   
            #[allow(unused_mut)]
14984   9224   
            let mut http_request = http::Request::builder()
14985         -
                .uri("/MalformedByte/1")
        9225  +
                .uri("/MalformedTimestampPathDefault/1996-12-19T16%3A39Z")
14986   9226   
                .method("POST")
14987   9227   
                .body(::aws_smithy_http_server::body::Body::empty())
14988   9228   
                .unwrap();
14989         -
            *http_request.uri_mut() = "/MalformedByte/1?byteInQuery=Infinity".parse().unwrap();
14990   9229   
            #[allow(unused_mut)]
14991   9230   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
14992   9231   
            let config = crate::service::RestJsonConfig::builder().build();
14993   9232   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
14994         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
        9233  +
                            .malformed_timestamp_path_default(move |input: crate::input::MalformedTimestampPathDefaultInput| {
14995   9234   
                                let sender = sender.clone();
14996   9235   
                                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> };
        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> };
14998   9237   
                                    sender.send(()).await.expect("receiver dropped early");
14999   9238   
                                    result
15000   9239   
                                }
15001   9240   
                            })
15002   9241   
                            .build_unchecked();
15003   9242   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
15004   9243   
                .await
15005   9244   
                .expect("unable to make an HTTP request");
15006   9245   
            ::pretty_assertions::assert_eq!(
15007   9246   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
15008   9247   
                http_response.status()
15009   9248   
            );
15010   9249   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
15011   9250   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
15012   9251   
                http_response.headers(),
15013   9252   
                expected_headers,
15014   9253   
            ));
15015   9254   
        }
15016   9255   
    }
15017         -
    /// Malformed values in query parameters should be rejected
15018         -
    /// Test ID: RestJsonQueryByteMalformedValueRejected_case5
        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
15019   9259   
    #[::tokio::test]
15020         -
    async fn rest_json_query_byte_malformed_value_rejected_case5_malformed_request() {
        9260  +
    #[::tracing_test::traced_test]
        9261  +
    async fn rest_json_path_timestamp_default_rejects_different8601_formats_case9_malformed_request(
        9262  +
    ) {
15021   9263   
        {
15022   9264   
            #[allow(unused_mut)]
15023   9265   
            let mut http_request = http::Request::builder()
15024         -
                .uri("/MalformedByte/1")
        9266  +
                .uri("/MalformedTimestampPathDefault/1996-12-19T16%3A39")
15025   9267   
                .method("POST")
15026   9268   
                .body(::aws_smithy_http_server::body::Body::empty())
15027   9269   
                .unwrap();
15028         -
            *http_request.uri_mut() = "/MalformedByte/1?byteInQuery=-Infinity".parse().unwrap();
15029   9270   
            #[allow(unused_mut)]
15030   9271   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
15031   9272   
            let config = crate::service::RestJsonConfig::builder().build();
15032   9273   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
15033         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
        9274  +
                            .malformed_timestamp_path_default(move |input: crate::input::MalformedTimestampPathDefaultInput| {
15034   9275   
                                let sender = sender.clone();
15035   9276   
                                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> };
        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> };
15037   9278   
                                    sender.send(()).await.expect("receiver dropped early");
15038   9279   
                                    result
15039   9280   
                                }
15040   9281   
                            })
15041   9282   
                            .build_unchecked();
15042   9283   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
15043   9284   
                .await
15044   9285   
                .expect("unable to make an HTTP request");
15045   9286   
            ::pretty_assertions::assert_eq!(
15046   9287   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
15047   9288   
                http_response.status()
15048   9289   
            );
15049   9290   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
15050   9291   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
15051   9292   
                http_response.headers(),
15052   9293   
                expected_headers,
15053   9294   
            ));
15054   9295   
        }
15055   9296   
    }
15056         -
    /// Malformed values in query parameters should be rejected
15057         -
    /// Test ID: RestJsonQueryByteMalformedValueRejected_case6
        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
15058   9300   
    #[::tokio::test]
15059         -
    async fn rest_json_query_byte_malformed_value_rejected_case6_malformed_request() {
        9301  +
    #[::tracing_test::traced_test]
        9302  +
    async fn rest_json_path_timestamp_default_rejects_different8601_formats_case10_malformed_request(
        9303  +
    ) {
15060   9304   
        {
15061   9305   
            #[allow(unused_mut)]
15062   9306   
            let mut http_request = http::Request::builder()
15063         -
                .uri("/MalformedByte/1")
        9307  +
                .uri("/MalformedTimestampPathDefault/1996-12-19T1639")
15064   9308   
                .method("POST")
15065   9309   
                .body(::aws_smithy_http_server::body::Body::empty())
15066   9310   
                .unwrap();
15067         -
            *http_request.uri_mut() = "/MalformedByte/1?byteInQuery=NaN".parse().unwrap();
15068   9311   
            #[allow(unused_mut)]
15069   9312   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
15070   9313   
            let config = crate::service::RestJsonConfig::builder().build();
15071   9314   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
15072         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
        9315  +
                            .malformed_timestamp_path_default(move |input: crate::input::MalformedTimestampPathDefaultInput| {
15073   9316   
                                let sender = sender.clone();
15074   9317   
                                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> };
        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> };
15076   9319   
                                    sender.send(()).await.expect("receiver dropped early");
15077   9320   
                                    result
15078   9321   
                                }
15079   9322   
                            })
15080   9323   
                            .build_unchecked();
15081   9324   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
15082   9325   
                .await
15083   9326   
                .expect("unable to make an HTTP request");
15084   9327   
            ::pretty_assertions::assert_eq!(
15085   9328   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
15086   9329   
                http_response.status()
15087   9330   
            );
15088   9331   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
15089   9332   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
15090   9333   
                http_response.headers(),
15091   9334   
                expected_headers,
15092   9335   
            ));
15093   9336   
        }
15094   9337   
    }
15095         -
    /// Malformed values in headers should be rejected
15096         -
    /// Test ID: RestJsonHeaderByteMalformedValueRejected_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
15097   9341   
    #[::tokio::test]
15098         -
    async fn rest_json_header_byte_malformed_value_rejected_case0_malformed_request() {
        9342  +
    #[::tracing_test::traced_test]
        9343  +
    async fn rest_json_path_timestamp_default_rejects_different8601_formats_case11_malformed_request(
        9344  +
    ) {
15099   9345   
        {
15100   9346   
            #[allow(unused_mut)]
15101   9347   
            let mut http_request = http::Request::builder()
15102         -
                .uri("/MalformedByte/1")
        9348  +
                .uri("/MalformedTimestampPathDefault/1996-12-19T16Z")
15103   9349   
                .method("POST")
15104         -
                .header("byteInHeader", "true")
15105   9350   
                .body(::aws_smithy_http_server::body::Body::empty())
15106   9351   
                .unwrap();
15107   9352   
            #[allow(unused_mut)]
15108   9353   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
15109   9354   
            let config = crate::service::RestJsonConfig::builder().build();
15110   9355   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
15111         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
        9356  +
                            .malformed_timestamp_path_default(move |input: crate::input::MalformedTimestampPathDefaultInput| {
15112   9357   
                                let sender = sender.clone();
15113   9358   
                                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> };
        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> };
15115   9360   
                                    sender.send(()).await.expect("receiver dropped early");
15116   9361   
                                    result
15117   9362   
                                }
15118   9363   
                            })
15119   9364   
                            .build_unchecked();
15120   9365   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
15121   9366   
                .await
15122   9367   
                .expect("unable to make an HTTP request");
15123   9368   
            ::pretty_assertions::assert_eq!(
15124   9369   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
15125   9370   
                http_response.status()
15126   9371   
            );
15127   9372   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
15128   9373   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
15129   9374   
                http_response.headers(),
15130   9375   
                expected_headers,
15131   9376   
            ));
15132   9377   
        }
15133   9378   
    }
15134         -
    /// Malformed values in headers should be rejected
15135         -
    /// Test ID: RestJsonHeaderByteMalformedValueRejected_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
15136   9382   
    #[::tokio::test]
15137         -
    async fn rest_json_header_byte_malformed_value_rejected_case1_malformed_request() {
        9383  +
    #[::tracing_test::traced_test]
        9384  +
    async fn rest_json_path_timestamp_default_rejects_different8601_formats_case12_malformed_request(
        9385  +
    ) {
15138   9386   
        {
15139   9387   
            #[allow(unused_mut)]
15140   9388   
            let mut http_request = http::Request::builder()
15141         -
                .uri("/MalformedByte/1")
        9389  +
                .uri("/MalformedTimestampPathDefault/1996-12-19T16")
15142   9390   
                .method("POST")
15143         -
                .header("byteInHeader", "1.001")
15144   9391   
                .body(::aws_smithy_http_server::body::Body::empty())
15145   9392   
                .unwrap();
15146   9393   
            #[allow(unused_mut)]
15147   9394   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
15148   9395   
            let config = crate::service::RestJsonConfig::builder().build();
15149   9396   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
15150         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
        9397  +
                            .malformed_timestamp_path_default(move |input: crate::input::MalformedTimestampPathDefaultInput| {
15151   9398   
                                let sender = sender.clone();
15152   9399   
                                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> };
        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> };
15154   9401   
                                    sender.send(()).await.expect("receiver dropped early");
15155   9402   
                                    result
15156   9403   
                                }
15157   9404   
                            })
15158   9405   
                            .build_unchecked();
15159   9406   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
15160   9407   
                .await
15161   9408   
                .expect("unable to make an HTTP request");
15162   9409   
            ::pretty_assertions::assert_eq!(
15163   9410   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
15164   9411   
                http_response.status()
15165   9412   
            );
15166   9413   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
15167   9414   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
15168   9415   
                http_response.headers(),
15169   9416   
                expected_headers,
15170   9417   
            ));
15171   9418   
        }
15172   9419   
    }
15173         -
    /// Malformed values in headers should be rejected
15174         -
    /// Test ID: RestJsonHeaderByteMalformedValueRejected_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
15175   9423   
    #[::tokio::test]
15176         -
    async fn rest_json_header_byte_malformed_value_rejected_case2_malformed_request() {
        9424  +
    #[::tracing_test::traced_test]
        9425  +
    async fn rest_json_path_timestamp_default_rejects_different8601_formats_case13_malformed_request(
        9426  +
    ) {
15177   9427   
        {
15178   9428   
            #[allow(unused_mut)]
15179   9429   
            let mut http_request = http::Request::builder()
15180         -
                .uri("/MalformedByte/1")
        9430  +
                .uri("/MalformedTimestampPathDefault/1996-12-19%2016%3A39%3A57Z")
15181   9431   
                .method("POST")
15182         -
                .header("byteInHeader", "2ABC")
15183   9432   
                .body(::aws_smithy_http_server::body::Body::empty())
15184   9433   
                .unwrap();
15185   9434   
            #[allow(unused_mut)]
15186   9435   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
15187   9436   
            let config = crate::service::RestJsonConfig::builder().build();
15188   9437   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
15189         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
        9438  +
                            .malformed_timestamp_path_default(move |input: crate::input::MalformedTimestampPathDefaultInput| {
15190   9439   
                                let sender = sender.clone();
15191   9440   
                                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> };
        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> };
15193   9442   
                                    sender.send(()).await.expect("receiver dropped early");
15194   9443   
                                    result
15195   9444   
                                }
15196   9445   
                            })
15197   9446   
                            .build_unchecked();
15198   9447   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
15199   9448   
                .await
15200   9449   
                .expect("unable to make an HTTP request");
15201   9450   
            ::pretty_assertions::assert_eq!(
15202   9451   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
15203   9452   
                http_response.status()
15204   9453   
            );
15205   9454   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
15206   9455   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
15207   9456   
                http_response.headers(),
15208   9457   
                expected_headers,
15209   9458   
            ));
15210   9459   
        }
15211   9460   
    }
15212         -
    /// Malformed values in headers should be rejected
15213         -
    /// Test ID: RestJsonHeaderByteMalformedValueRejected_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
15214   9464   
    #[::tokio::test]
15215         -
    async fn rest_json_header_byte_malformed_value_rejected_case3_malformed_request() {
        9465  +
    #[::tracing_test::traced_test]
        9466  +
    async fn rest_json_path_timestamp_default_rejects_different8601_formats_case14_malformed_request(
        9467  +
    ) {
15216   9468   
        {
15217   9469   
            #[allow(unused_mut)]
15218         -
            let mut http_request = http::Request::builder()
15219         -
                .uri("/MalformedByte/1")
15220         -
                .method("POST")
15221         -
                .header("byteInHeader", "0x42")
15222         -
                .body(::aws_smithy_http_server::body::Body::empty())
15223         -
                .unwrap();
        9470  +
                        let mut http_request = http::Request::builder()
        9471  +
                            .uri("/MalformedTimestampPathDefault/2011-12-03T10%3A15%3A30%2B01%3A00%5BEurope%2FParis%5D")
        9472  +
                            .method("POST")
        9473  +
            .body(::aws_smithy_http_server::body::Body::empty()).unwrap();
15224   9474   
            #[allow(unused_mut)]
15225   9475   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
15226   9476   
            let config = crate::service::RestJsonConfig::builder().build();
15227   9477   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
15228         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
        9478  +
                            .malformed_timestamp_path_default(move |input: crate::input::MalformedTimestampPathDefaultInput| {
15229   9479   
                                let sender = sender.clone();
15230   9480   
                                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> };
        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> };
15232   9482   
                                    sender.send(()).await.expect("receiver dropped early");
15233   9483   
                                    result
15234   9484   
                                }
15235   9485   
                            })
15236   9486   
                            .build_unchecked();
15237   9487   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
15238   9488   
                .await
15239   9489   
                .expect("unable to make an HTTP request");
15240   9490   
            ::pretty_assertions::assert_eq!(
15241   9491   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
15242   9492   
                http_response.status()
15243   9493   
            );
15244   9494   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
15245   9495   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
15246   9496   
                http_response.headers(),
15247   9497   
                expected_headers,
15248   9498   
            ));
15249   9499   
        }
15250   9500   
    }
15251         -
    /// Malformed values in headers should be rejected
15252         -
    /// Test ID: RestJsonHeaderByteMalformedValueRejected_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
15253   9595   
    #[::tokio::test]
15254         -
    async fn rest_json_header_byte_malformed_value_rejected_case4_malformed_request() {
        9596  +
    #[::tracing_test::traced_test]
        9597  +
    async fn rest_json_header_malformed_string_invalid_base64_media_type_case0_malformed_request() {
15255   9598   
        {
15256   9599   
            #[allow(unused_mut)]
15257   9600   
            let mut http_request = http::Request::builder()
15258         -
                .uri("/MalformedByte/1")
        9601  +
                .uri("/MalformedString")
15259   9602   
                .method("POST")
15260         -
                .header("byteInHeader", "Infinity")
        9603  +
                .header("content-type", "application/json")
        9604  +
                .header("amz-media-typed-header", "xyz")
15261   9605   
                .body(::aws_smithy_http_server::body::Body::empty())
15262   9606   
                .unwrap();
15263   9607   
            #[allow(unused_mut)]
15264   9608   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
15265   9609   
            let config = crate::service::RestJsonConfig::builder().build();
15266   9610   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
15267         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
        9611  +
                            .malformed_string(move |input: crate::input::MalformedStringInput| {
15268   9612   
                                let sender = sender.clone();
15269   9613   
                                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> };
        9614  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedStringOutput };
15271   9615   
                                    sender.send(()).await.expect("receiver dropped early");
15272   9616   
                                    result
15273   9617   
                                }
15274   9618   
                            })
15275   9619   
                            .build_unchecked();
15276   9620   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
15277   9621   
                .await
15278   9622   
                .expect("unable to make an HTTP request");
15279   9623   
            ::pretty_assertions::assert_eq!(
15280   9624   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
15281   9625   
                http_response.status()
15282   9626   
            );
15283   9627   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
15284   9628   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
15285   9629   
                http_response.headers(),
15286   9630   
                expected_headers,
15287   9631   
            ));
15288   9632   
        }
15289   9633   
    }
15290         -
    /// Malformed values in headers should be rejected
15291         -
    /// Test ID: RestJsonHeaderByteMalformedValueRejected_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
15292   9638   
    #[::tokio::test]
15293         -
    async fn rest_json_header_byte_malformed_value_rejected_case5_malformed_request() {
        9639  +
    #[::tracing_test::traced_test]
        9640  +
    async fn rest_json_header_malformed_string_invalid_base64_media_type_case1_malformed_request() {
15294   9641   
        {
15295   9642   
            #[allow(unused_mut)]
15296   9643   
            let mut http_request = http::Request::builder()
15297         -
                .uri("/MalformedByte/1")
        9644  +
                .uri("/MalformedString")
15298   9645   
                .method("POST")
15299         -
                .header("byteInHeader", "-Infinity")
        9646  +
                .header("content-type", "application/json")
        9647  +
                .header("amz-media-typed-header", "YmxvYg=")
15300   9648   
                .body(::aws_smithy_http_server::body::Body::empty())
15301   9649   
                .unwrap();
15302   9650   
            #[allow(unused_mut)]
15303   9651   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
15304   9652   
            let config = crate::service::RestJsonConfig::builder().build();
15305   9653   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
15306         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
        9654  +
                            .malformed_string(move |input: crate::input::MalformedStringInput| {
15307   9655   
                                let sender = sender.clone();
15308   9656   
                                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> };
        9657  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedStringOutput };
15310   9658   
                                    sender.send(()).await.expect("receiver dropped early");
15311   9659   
                                    result
15312   9660   
                                }
15313   9661   
                            })
15314   9662   
                            .build_unchecked();
15315   9663   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
15316   9664   
                .await
15317   9665   
                .expect("unable to make an HTTP request");
15318   9666   
            ::pretty_assertions::assert_eq!(
15319   9667   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
15320   9668   
                http_response.status()
15321   9669   
            );
15322   9670   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
15323   9671   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
15324   9672   
                http_response.headers(),
15325   9673   
                expected_headers,
15326   9674   
            ));
15327   9675   
        }
15328   9676   
    }
15329         -
    /// Malformed values in headers should be rejected
15330         -
    /// Test ID: RestJsonHeaderByteMalformedValueRejected_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
15331   9681   
    #[::tokio::test]
15332         -
    async fn rest_json_header_byte_malformed_value_rejected_case6_malformed_request() {
        9682  +
    #[::tracing_test::traced_test]
        9683  +
    async fn rest_json_header_malformed_string_invalid_base64_media_type_case2_malformed_request() {
15333   9684   
        {
15334   9685   
            #[allow(unused_mut)]
15335   9686   
            let mut http_request = http::Request::builder()
15336         -
                .uri("/MalformedByte/1")
        9687  +
                .uri("/MalformedString")
15337   9688   
                .method("POST")
15338         -
                .header("byteInHeader", "NaN")
        9689  +
                .header("content-type", "application/json")
        9690  +
                .header("amz-media-typed-header", "[][]")
15339   9691   
                .body(::aws_smithy_http_server::body::Body::empty())
15340   9692   
                .unwrap();
15341   9693   
            #[allow(unused_mut)]
15342   9694   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
15343   9695   
            let config = crate::service::RestJsonConfig::builder().build();
15344   9696   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
15345         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
        9697  +
                            .malformed_string(move |input: crate::input::MalformedStringInput| {
15346   9698   
                                let sender = sender.clone();
15347   9699   
                                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> };
        9700  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedStringOutput };
15349   9701   
                                    sender.send(()).await.expect("receiver dropped early");
15350   9702   
                                    result
15351   9703   
                                }
15352   9704   
                            })
15353   9705   
                            .build_unchecked();
15354   9706   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
15355   9707   
                .await
15356   9708   
                .expect("unable to make an HTTP request");
15357   9709   
            ::pretty_assertions::assert_eq!(
15358   9710   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
15359   9711   
                http_response.status()
15360   9712   
            );
15361   9713   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
15362   9714   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
15363   9715   
                http_response.headers(),
15364   9716   
                expected_headers,
15365   9717   
            ));
15366   9718   
        }
15367   9719   
    }
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
        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
15374   9724   
    #[::tokio::test]
15375         -
    async fn rest_json_with_body_expects_application_json_content_type_malformed_request() {
        9725  +
    #[::tracing_test::traced_test]
        9726  +
    async fn rest_json_header_malformed_string_invalid_base64_media_type_case3_malformed_request() {
15376   9727   
        {
15377   9728   
            #[allow(unused_mut)]
15378   9729   
            let mut http_request = http::Request::builder()
15379         -
                .uri("/MalformedContentTypeWithBody")
        9730  +
                .uri("/MalformedString")
15380   9731   
                .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         -
                ))
        9732  +
                .header("content-type", "application/json")
        9733  +
                .header("amz-media-typed-header", "-_==")
        9734  +
                .body(::aws_smithy_http_server::body::Body::empty())
15385   9735   
                .unwrap();
15386   9736   
            #[allow(unused_mut)]
15387   9737   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
15388   9738   
            let config = crate::service::RestJsonConfig::builder().build();
15389   9739   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
15390         -
                            .malformed_content_type_with_body(move |input: crate::input::MalformedContentTypeWithBodyInput| {
        9740  +
                            .malformed_string(move |input: crate::input::MalformedStringInput| {
15391   9741   
                                let sender = sender.clone();
15392   9742   
                                async move {
15393         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedContentTypeWithBodyOutput };
        9743  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedStringOutput };
15394   9744   
                                    sender.send(()).await.expect("receiver dropped early");
15395   9745   
                                    result
15396   9746   
                                }
15397   9747   
                            })
15398   9748   
                            .build_unchecked();
15399   9749   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
15400   9750   
                .await
15401   9751   
                .expect("unable to make an HTTP request");
15402   9752   
            ::pretty_assertions::assert_eq!(
15403         -
                http::StatusCode::from_u16(415).expect("invalid expected HTTP status code"),
        9753  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
15404   9754   
                http_response.status()
15405   9755   
            );
15406         -
            let expected_headers = [("x-amzn-errortype", "UnsupportedMediaTypeException")];
        9756  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
15407   9757   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
15408   9758   
                http_response.headers(),
15409   9759   
                expected_headers,
15410   9760   
            ));
15411   9761   
        }
15412   9762   
    }
15413   9763   
}
15414         -
#[cfg(test)]
        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  +
15415   9870   
#[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
        9871  +
#[cfg(test)]
        9872  +
mod malformed_double_test {
        9873  +
        9874  +
    /// Malformed values in the body should be rejected
        9875  +
    /// Test ID: RestJsonBodyDoubleMalformedValueRejected_case0
15419   9876   
    #[::tokio::test]
15420         -
    async fn rest_json_without_body_expects_empty_content_type_malformed_request() {
        9877  +
    #[::tracing_test::traced_test]
        9878  +
    async fn rest_json_body_double_malformed_value_rejected_case0_malformed_request() {
15421   9879   
        {
15422   9880   
            #[allow(unused_mut)]
15423   9881   
            let mut http_request = http::Request::builder()
15424         -
                .uri("/MalformedContentTypeWithoutBody")
        9882  +
                .uri("/MalformedDouble/1")
15425   9883   
                .method("POST")
15426   9884   
                .header("content-type", "application/json")
15427   9885   
                .body(::aws_smithy_http_server::body::Body::from(
15428         -
                    ::bytes::Bytes::from_static("{}".as_bytes()),
        9886  +
                    ::bytes::Bytes::from_static("{ \"doubleInBody\" : \"123\" }".as_bytes()),
15429   9887   
                ))
15430   9888   
                .unwrap();
15431   9889   
            #[allow(unused_mut)]
15432   9890   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
15433   9891   
            let config = crate::service::RestJsonConfig::builder().build();
15434   9892   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
15435         -
                            .malformed_content_type_without_body(move |input: crate::input::MalformedContentTypeWithoutBodyInput| {
        9893  +
                            .malformed_double(move |input: crate::input::MalformedDoubleInput| {
15436   9894   
                                let sender = sender.clone();
15437   9895   
                                async move {
15438         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedContentTypeWithoutBodyOutput };
        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> };
15439   9897   
                                    sender.send(()).await.expect("receiver dropped early");
15440   9898   
                                    result
15441   9899   
                                }
15442   9900   
                            })
15443   9901   
                            .build_unchecked();
15444   9902   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
15445   9903   
                .await
15446   9904   
                .expect("unable to make an HTTP request");
15447   9905   
            ::pretty_assertions::assert_eq!(
15448         -
                http::StatusCode::from_u16(415).expect("invalid expected HTTP status code"),
        9906  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
15449   9907   
                http_response.status()
15450   9908   
            );
15451         -
            let expected_headers = [("x-amzn-errortype", "UnsupportedMediaTypeException")];
        9909  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
15452   9910   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
15453   9911   
                http_response.headers(),
15454   9912   
                expected_headers,
15455   9913   
            ));
15456   9914   
        }
15457   9915   
    }
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
        9916  +
    /// Malformed values in the body should be rejected
        9917  +
    /// Test ID: RestJsonBodyDoubleMalformedValueRejected_case1
15464   9918   
    #[::tokio::test]
15465         -
    async fn rest_json_with_payload_expects_modeled_content_type_malformed_request() {
        9919  +
    #[::tracing_test::traced_test]
        9920  +
    async fn rest_json_body_double_malformed_value_rejected_case1_malformed_request() {
15466   9921   
        {
15467   9922   
            #[allow(unused_mut)]
15468   9923   
            let mut http_request = http::Request::builder()
15469         -
                .uri("/MalformedContentTypeWithPayload")
        9924  +
                .uri("/MalformedDouble/1")
15470   9925   
                .method("POST")
15471   9926   
                .header("content-type", "application/json")
15472   9927   
                .body(::aws_smithy_http_server::body::Body::from(
15473         -
                    ::bytes::Bytes::from_static("{}".as_bytes()),
        9928  +
                    ::bytes::Bytes::from_static("{ \"doubleInBody\" : true }".as_bytes()),
15474   9929   
                ))
15475   9930   
                .unwrap();
15476   9931   
            #[allow(unused_mut)]
15477   9932   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
15478   9933   
            let config = crate::service::RestJsonConfig::builder().build();
15479   9934   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
15480         -
                            .malformed_content_type_with_payload(move |input: crate::input::MalformedContentTypeWithPayloadInput| {
        9935  +
                            .malformed_double(move |input: crate::input::MalformedDoubleInput| {
15481   9936   
                                let sender = sender.clone();
15482   9937   
                                async move {
15483         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedContentTypeWithPayloadOutput };
        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> };
15484   9939   
                                    sender.send(()).await.expect("receiver dropped early");
15485   9940   
                                    result
15486   9941   
                                }
15487   9942   
                            })
15488   9943   
                            .build_unchecked();
15489   9944   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
15490   9945   
                .await
15491   9946   
                .expect("unable to make an HTTP request");
15492   9947   
            ::pretty_assertions::assert_eq!(
15493         -
                http::StatusCode::from_u16(415).expect("invalid expected HTTP status code"),
        9948  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
15494   9949   
                http_response.status()
15495   9950   
            );
15496         -
            let expected_headers = [("x-amzn-errortype", "UnsupportedMediaTypeException")];
        9951  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
15497   9952   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
15498   9953   
                http_response.headers(),
15499   9954   
                expected_headers,
15500   9955   
            ));
15501   9956   
        }
15502   9957   
    }
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
        9958  +
    /// Malformed values in the body should be rejected
        9959  +
    /// Test ID: RestJsonBodyDoubleMalformedValueRejected_case2
15506   9960   
    #[::tokio::test]
15507         -
    async fn rest_json_with_payload_expects_implied_content_type_malformed_request() {
        9961  +
    #[::tracing_test::traced_test]
        9962  +
    async fn rest_json_body_double_malformed_value_rejected_case2_malformed_request() {
15508   9963   
        {
15509   9964   
            #[allow(unused_mut)]
15510   9965   
            let mut http_request = http::Request::builder()
15511         -
                .uri("/MalformedContentTypeWithPayload")
        9966  +
                .uri("/MalformedDouble/1")
15512   9967   
                .method("POST")
15513   9968   
                .header("content-type", "application/json")
15514   9969   
                .body(::aws_smithy_http_server::body::Body::from(
15515         -
                    ::bytes::Bytes::from_static("{}".as_bytes()),
        9970  +
                    ::bytes::Bytes::from_static("{ \"doubleInBody\" : 2ABC }".as_bytes()),
15516   9971   
                ))
15517   9972   
                .unwrap();
15518   9973   
            #[allow(unused_mut)]
15519   9974   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
15520   9975   
            let config = crate::service::RestJsonConfig::builder().build();
15521   9976   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
15522         -
                            .malformed_content_type_with_payload(move |input: crate::input::MalformedContentTypeWithPayloadInput| {
        9977  +
                            .malformed_double(move |input: crate::input::MalformedDoubleInput| {
15523   9978   
                                let sender = sender.clone();
15524   9979   
                                async move {
15525         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedContentTypeWithPayloadOutput };
        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> };
15526   9981   
                                    sender.send(()).await.expect("receiver dropped early");
15527   9982   
                                    result
15528   9983   
                                }
15529   9984   
                            })
15530   9985   
                            .build_unchecked();
15531   9986   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
15532   9987   
                .await
15533   9988   
                .expect("unable to make an HTTP request");
15534   9989   
            ::pretty_assertions::assert_eq!(
15535         -
                http::StatusCode::from_u16(415).expect("invalid expected HTTP status code"),
        9990  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
15536   9991   
                http_response.status()
15537   9992   
            );
15538         -
            let expected_headers = [("x-amzn-errortype", "UnsupportedMediaTypeException")];
        9993  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
15539   9994   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
15540   9995   
                http_response.headers(),
15541   9996   
                expected_headers,
15542   9997   
            ));
15543   9998   
        }
15544   9999   
    }
15545         -
}
15546         -
#[cfg(test)]
15547         -
#[allow(unreachable_code, unused_variables)]
15548         -
mod server_malformed_double_test {
15549  10000   
    /// Malformed values in the body should be rejected
15550         -
    /// Test ID: RestJsonBodyDoubleMalformedValueRejected_case0
       10001  +
    /// Test ID: RestJsonBodyDoubleMalformedValueRejected_case3
15551  10002   
    #[::tokio::test]
15552         -
    async fn rest_json_body_double_malformed_value_rejected_case0_malformed_request() {
       10003  +
    #[::tracing_test::traced_test]
       10004  +
    async fn rest_json_body_double_malformed_value_rejected_case3_malformed_request() {
15553  10005   
        {
15554  10006   
            #[allow(unused_mut)]
15555  10007   
            let mut http_request = http::Request::builder()
15556  10008   
                .uri("/MalformedDouble/1")
15557  10009   
                .method("POST")
15558  10010   
                .header("content-type", "application/json")
15559  10011   
                .body(::aws_smithy_http_server::body::Body::from(
15560         -
                    ::bytes::Bytes::from_static("{ \"doubleInBody\" : \"123\" }".as_bytes()),
       10012  +
                    ::bytes::Bytes::from_static("{ \"doubleInBody\" : 0x42 }".as_bytes()),
15561  10013   
                ))
15562  10014   
                .unwrap();
15563  10015   
            #[allow(unused_mut)]
15564  10016   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
15565  10017   
            let config = crate::service::RestJsonConfig::builder().build();
15566  10018   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
15567  10019   
                            .malformed_double(move |input: crate::input::MalformedDoubleInput| {
15568  10020   
                                let sender = sender.clone();
15569  10021   
                                async move {
15570  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> };
15571  10023   
                                    sender.send(()).await.expect("receiver dropped early");
15572  10024   
                                    result
15573  10025   
                                }
15574  10026   
                            })
15575  10027   
                            .build_unchecked();
15576  10028   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
15577  10029   
                .await
15578  10030   
                .expect("unable to make an HTTP request");
15579  10031   
            ::pretty_assertions::assert_eq!(
15580  10032   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
15581  10033   
                http_response.status()
15582  10034   
            );
15583  10035   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
15584  10036   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
15585  10037   
                http_response.headers(),
15586  10038   
                expected_headers,
15587  10039   
            ));
15588  10040   
        }
15589  10041   
    }
15590  10042   
    /// Malformed values in the body should be rejected
15591         -
    /// Test ID: RestJsonBodyDoubleMalformedValueRejected_case1
       10043  +
    /// Test ID: RestJsonBodyDoubleMalformedValueRejected_case4
15592  10044   
    #[::tokio::test]
15593         -
    async fn rest_json_body_double_malformed_value_rejected_case1_malformed_request() {
       10045  +
    #[::tracing_test::traced_test]
       10046  +
    async fn rest_json_body_double_malformed_value_rejected_case4_malformed_request() {
15594  10047   
        {
15595  10048   
            #[allow(unused_mut)]
15596  10049   
            let mut http_request = http::Request::builder()
15597  10050   
                .uri("/MalformedDouble/1")
15598  10051   
                .method("POST")
15599  10052   
                .header("content-type", "application/json")
15600  10053   
                .body(::aws_smithy_http_server::body::Body::from(
15601         -
                    ::bytes::Bytes::from_static("{ \"doubleInBody\" : true }".as_bytes()),
       10054  +
                    ::bytes::Bytes::from_static("{ \"doubleInBody\" : Infinity }".as_bytes()),
15602  10055   
                ))
15603  10056   
                .unwrap();
15604  10057   
            #[allow(unused_mut)]
15605  10058   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
15606  10059   
            let config = crate::service::RestJsonConfig::builder().build();
15607  10060   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
15608  10061   
                            .malformed_double(move |input: crate::input::MalformedDoubleInput| {
15609  10062   
                                let sender = sender.clone();
15610  10063   
                                async move {
15611  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> };
15612  10065   
                                    sender.send(()).await.expect("receiver dropped early");
15613  10066   
                                    result
15614  10067   
                                }
15615  10068   
                            })
15616  10069   
                            .build_unchecked();
15617  10070   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
15618  10071   
                .await
15619  10072   
                .expect("unable to make an HTTP request");
15620  10073   
            ::pretty_assertions::assert_eq!(
15621  10074   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
15622  10075   
                http_response.status()
15623  10076   
            );
15624  10077   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
15625  10078   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
15626  10079   
                http_response.headers(),
15627  10080   
                expected_headers,
15628  10081   
            ));
15629  10082   
        }
15630  10083   
    }
15631  10084   
    /// Malformed values in the body should be rejected
15632         -
    /// Test ID: RestJsonBodyDoubleMalformedValueRejected_case2
       10085  +
    /// Test ID: RestJsonBodyDoubleMalformedValueRejected_case5
15633  10086   
    #[::tokio::test]
15634         -
    async fn rest_json_body_double_malformed_value_rejected_case2_malformed_request() {
       10087  +
    #[::tracing_test::traced_test]
       10088  +
    async fn rest_json_body_double_malformed_value_rejected_case5_malformed_request() {
15635  10089   
        {
15636  10090   
            #[allow(unused_mut)]
15637  10091   
            let mut http_request = http::Request::builder()
15638  10092   
                .uri("/MalformedDouble/1")
15639  10093   
                .method("POST")
15640  10094   
                .header("content-type", "application/json")
15641  10095   
                .body(::aws_smithy_http_server::body::Body::from(
15642         -
                    ::bytes::Bytes::from_static("{ \"doubleInBody\" : 2ABC }".as_bytes()),
       10096  +
                    ::bytes::Bytes::from_static("{ \"doubleInBody\" : -Infinity }".as_bytes()),
15643  10097   
                ))
15644  10098   
                .unwrap();
15645  10099   
            #[allow(unused_mut)]
15646  10100   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
15647  10101   
            let config = crate::service::RestJsonConfig::builder().build();
15648  10102   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
15649  10103   
                            .malformed_double(move |input: crate::input::MalformedDoubleInput| {
15650  10104   
                                let sender = sender.clone();
15651  10105   
                                async move {
15652  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> };
15653  10107   
                                    sender.send(()).await.expect("receiver dropped early");
15654  10108   
                                    result
15655  10109   
                                }
15656  10110   
                            })
15657  10111   
                            .build_unchecked();
15658  10112   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
15659  10113   
                .await
15660  10114   
                .expect("unable to make an HTTP request");
15661  10115   
            ::pretty_assertions::assert_eq!(
15662  10116   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
15663  10117   
                http_response.status()
15664  10118   
            );
15665  10119   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
15666  10120   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
15667  10121   
                http_response.headers(),
15668  10122   
                expected_headers,
15669  10123   
            ));
15670  10124   
        }
15671  10125   
    }
15672  10126   
    /// Malformed values in the body should be rejected
15673         -
    /// Test ID: RestJsonBodyDoubleMalformedValueRejected_case3
       10127  +
    /// Test ID: RestJsonBodyDoubleMalformedValueRejected_case6
15674  10128   
    #[::tokio::test]
15675         -
    async fn rest_json_body_double_malformed_value_rejected_case3_malformed_request() {
       10129  +
    #[::tracing_test::traced_test]
       10130  +
    async fn rest_json_body_double_malformed_value_rejected_case6_malformed_request() {
15676  10131   
        {
15677  10132   
            #[allow(unused_mut)]
15678  10133   
            let mut http_request = http::Request::builder()
15679  10134   
                .uri("/MalformedDouble/1")
15680  10135   
                .method("POST")
15681  10136   
                .header("content-type", "application/json")
15682  10137   
                .body(::aws_smithy_http_server::body::Body::from(
15683         -
                    ::bytes::Bytes::from_static("{ \"doubleInBody\" : 0x42 }".as_bytes()),
       10138  +
                    ::bytes::Bytes::from_static("{ \"doubleInBody\" : NaN }".as_bytes()),
15684  10139   
                ))
15685  10140   
                .unwrap();
15686  10141   
            #[allow(unused_mut)]
15687  10142   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
15688  10143   
            let config = crate::service::RestJsonConfig::builder().build();
15689  10144   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
15690  10145   
                            .malformed_double(move |input: crate::input::MalformedDoubleInput| {
15691  10146   
                                let sender = sender.clone();
15692  10147   
                                async move {
15693  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> };
15694  10149   
                                    sender.send(()).await.expect("receiver dropped early");
15695  10150   
                                    result
15696  10151   
                                }
15697  10152   
                            })
15698  10153   
                            .build_unchecked();
15699  10154   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
15700  10155   
                .await
15701  10156   
                .expect("unable to make an HTTP request");
15702  10157   
            ::pretty_assertions::assert_eq!(
15703  10158   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
15704  10159   
                http_response.status()
15705  10160   
            );
15706  10161   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
15707  10162   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
15708  10163   
                http_response.headers(),
15709  10164   
                expected_headers,
15710  10165   
            ));
15711  10166   
        }
15712  10167   
    }
15713         -
    /// Malformed values in the body should be rejected
15714         -
    /// Test ID: RestJsonBodyDoubleMalformedValueRejected_case4
       10168  +
    /// Malformed values in the path should be rejected
       10169  +
    /// Test ID: RestJsonPathDoubleMalformedValueRejected_case0
15715  10170   
    #[::tokio::test]
15716         -
    async fn rest_json_body_double_malformed_value_rejected_case4_malformed_request() {
       10171  +
    #[::tracing_test::traced_test]
       10172  +
    async fn rest_json_path_double_malformed_value_rejected_case0_malformed_request() {
15717  10173   
        {
15718  10174   
            #[allow(unused_mut)]
15719  10175   
            let mut http_request = http::Request::builder()
15720         -
                .uri("/MalformedDouble/1")
       10176  +
                .uri("/MalformedDouble/true")
15721  10177   
                .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         -
                ))
       10178  +
                .body(::aws_smithy_http_server::body::Body::empty())
15726  10179   
                .unwrap();
15727  10180   
            #[allow(unused_mut)]
15728  10181   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
15729  10182   
            let config = crate::service::RestJsonConfig::builder().build();
15730  10183   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
15731  10184   
                            .malformed_double(move |input: crate::input::MalformedDoubleInput| {
15732  10185   
                                let sender = sender.clone();
15733  10186   
                                async move {
15734  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> };
15735  10188   
                                    sender.send(()).await.expect("receiver dropped early");
15736  10189   
                                    result
15737  10190   
                                }
15738  10191   
                            })
15739  10192   
                            .build_unchecked();
15740  10193   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
15741  10194   
                .await
15742  10195   
                .expect("unable to make an HTTP request");
15743  10196   
            ::pretty_assertions::assert_eq!(
15744  10197   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
15745  10198   
                http_response.status()
15746  10199   
            );
15747  10200   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
15748  10201   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
15749  10202   
                http_response.headers(),
15750  10203   
                expected_headers,
15751  10204   
            ));
15752  10205   
        }
15753  10206   
    }
15754         -
    /// Malformed values in the body should be rejected
15755         -
    /// Test ID: RestJsonBodyDoubleMalformedValueRejected_case5
       10207  +
    /// Malformed values in the path should be rejected
       10208  +
    /// Test ID: RestJsonPathDoubleMalformedValueRejected_case1
15756  10209   
    #[::tokio::test]
15757         -
    async fn rest_json_body_double_malformed_value_rejected_case5_malformed_request() {
       10210  +
    #[::tracing_test::traced_test]
       10211  +
    async fn rest_json_path_double_malformed_value_rejected_case1_malformed_request() {
15758  10212   
        {
15759  10213   
            #[allow(unused_mut)]
15760  10214   
            let mut http_request = http::Request::builder()
15761         -
                .uri("/MalformedDouble/1")
       10215  +
                .uri("/MalformedDouble/2ABC")
15762  10216   
                .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         -
                ))
       10217  +
                .body(::aws_smithy_http_server::body::Body::empty())
15767  10218   
                .unwrap();
15768  10219   
            #[allow(unused_mut)]
15769  10220   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
15770  10221   
            let config = crate::service::RestJsonConfig::builder().build();
15771  10222   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
15772  10223   
                            .malformed_double(move |input: crate::input::MalformedDoubleInput| {
15773  10224   
                                let sender = sender.clone();
15774  10225   
                                async move {
15775  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> };
15776  10227   
                                    sender.send(()).await.expect("receiver dropped early");
15777  10228   
                                    result
15778  10229   
                                }
15779  10230   
                            })
15780  10231   
                            .build_unchecked();
15781  10232   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
15782  10233   
                .await
15783  10234   
                .expect("unable to make an HTTP request");
15784  10235   
            ::pretty_assertions::assert_eq!(
15785  10236   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
15786  10237   
                http_response.status()
15787  10238   
            );
15788  10239   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
15789  10240   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
15790  10241   
                http_response.headers(),
15791  10242   
                expected_headers,
15792  10243   
            ));
15793  10244   
        }
15794  10245   
    }
15795         -
    /// Malformed values in the body should be rejected
15796         -
    /// Test ID: RestJsonBodyDoubleMalformedValueRejected_case6
       10246  +
    /// Malformed values in the path should be rejected
       10247  +
    /// Test ID: RestJsonPathDoubleMalformedValueRejected_case2
15797  10248   
    #[::tokio::test]
15798         -
    async fn rest_json_body_double_malformed_value_rejected_case6_malformed_request() {
       10249  +
    #[::tracing_test::traced_test]
       10250  +
    async fn rest_json_path_double_malformed_value_rejected_case2_malformed_request() {
15799  10251   
        {
15800  10252   
            #[allow(unused_mut)]
15801  10253   
            let mut http_request = http::Request::builder()
15802         -
                .uri("/MalformedDouble/1")
       10254  +
                .uri("/MalformedDouble/0x42")
15803  10255   
                .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         -
                ))
       10256  +
                .body(::aws_smithy_http_server::body::Body::empty())
15808  10257   
                .unwrap();
15809  10258   
            #[allow(unused_mut)]
15810  10259   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
15811  10260   
            let config = crate::service::RestJsonConfig::builder().build();
15812  10261   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
15813  10262   
                            .malformed_double(move |input: crate::input::MalformedDoubleInput| {
15814  10263   
                                let sender = sender.clone();
15815  10264   
                                async move {
15816  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> };
15817  10266   
                                    sender.send(()).await.expect("receiver dropped early");
15818  10267   
                                    result
15819  10268   
                                }
15820  10269   
                            })
15821  10270   
                            .build_unchecked();
15822  10271   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
15823  10272   
                .await
15824  10273   
                .expect("unable to make an HTTP request");
15825  10274   
            ::pretty_assertions::assert_eq!(
15826  10275   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
15827  10276   
                http_response.status()
15828  10277   
            );
15829  10278   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
15830  10279   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
15831  10280   
                http_response.headers(),
15832  10281   
                expected_headers,
15833  10282   
            ));
15834  10283   
        }
15835  10284   
    }
15836         -
    /// Malformed values in the path should be rejected
15837         -
    /// Test ID: RestJsonPathDoubleMalformedValueRejected_case0
       10285  +
    /// Malformed values in query parameters should be rejected
       10286  +
    /// Test ID: RestJsonQueryDoubleMalformedValueRejected_case0
15838  10287   
    #[::tokio::test]
15839         -
    async fn rest_json_path_double_malformed_value_rejected_case0_malformed_request() {
       10288  +
    #[::tracing_test::traced_test]
       10289  +
    async fn rest_json_query_double_malformed_value_rejected_case0_malformed_request() {
15840  10290   
        {
15841  10291   
            #[allow(unused_mut)]
15842  10292   
            let mut http_request = http::Request::builder()
15843         -
                .uri("/MalformedDouble/true")
       10293  +
                .uri("/MalformedDouble/1")
15844  10294   
                .method("POST")
15845  10295   
                .body(::aws_smithy_http_server::body::Body::empty())
15846  10296   
                .unwrap();
       10297  +
            *http_request.uri_mut() = "/MalformedDouble/1?doubleInQuery=true".parse().unwrap();
15847  10298   
            #[allow(unused_mut)]
15848  10299   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
15849  10300   
            let config = crate::service::RestJsonConfig::builder().build();
15850  10301   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
15851  10302   
                            .malformed_double(move |input: crate::input::MalformedDoubleInput| {
15852  10303   
                                let sender = sender.clone();
15853  10304   
                                async move {
15854  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> };
15855  10306   
                                    sender.send(()).await.expect("receiver dropped early");
15856  10307   
                                    result
15857  10308   
                                }
15858  10309   
                            })
15859  10310   
                            .build_unchecked();
15860  10311   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
15861  10312   
                .await
15862  10313   
                .expect("unable to make an HTTP request");
15863  10314   
            ::pretty_assertions::assert_eq!(
15864  10315   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
15865  10316   
                http_response.status()
15866  10317   
            );
15867  10318   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
15868  10319   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
15869  10320   
                http_response.headers(),
15870  10321   
                expected_headers,
15871  10322   
            ));
15872  10323   
        }
15873  10324   
    }
15874         -
    /// Malformed values in the path should be rejected
15875         -
    /// Test ID: RestJsonPathDoubleMalformedValueRejected_case1
       10325  +
    /// Malformed values in query parameters should be rejected
       10326  +
    /// Test ID: RestJsonQueryDoubleMalformedValueRejected_case1
15876  10327   
    #[::tokio::test]
15877         -
    async fn rest_json_path_double_malformed_value_rejected_case1_malformed_request() {
       10328  +
    #[::tracing_test::traced_test]
       10329  +
    async fn rest_json_query_double_malformed_value_rejected_case1_malformed_request() {
15878  10330   
        {
15879  10331   
            #[allow(unused_mut)]
15880  10332   
            let mut http_request = http::Request::builder()
15881         -
                .uri("/MalformedDouble/2ABC")
       10333  +
                .uri("/MalformedDouble/1")
15882  10334   
                .method("POST")
15883  10335   
                .body(::aws_smithy_http_server::body::Body::empty())
15884  10336   
                .unwrap();
       10337  +
            *http_request.uri_mut() = "/MalformedDouble/1?doubleInQuery=2ABC".parse().unwrap();
15885  10338   
            #[allow(unused_mut)]
15886  10339   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
15887  10340   
            let config = crate::service::RestJsonConfig::builder().build();
15888  10341   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
15889  10342   
                            .malformed_double(move |input: crate::input::MalformedDoubleInput| {
15890  10343   
                                let sender = sender.clone();
15891  10344   
                                async move {
15892  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> };
15893  10346   
                                    sender.send(()).await.expect("receiver dropped early");
15894  10347   
                                    result
15895  10348   
                                }
15896  10349   
                            })
15897  10350   
                            .build_unchecked();
15898  10351   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
15899  10352   
                .await
15900  10353   
                .expect("unable to make an HTTP request");
15901  10354   
            ::pretty_assertions::assert_eq!(
15902  10355   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
15903  10356   
                http_response.status()
15904  10357   
            );
15905  10358   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
15906  10359   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
15907  10360   
                http_response.headers(),
15908  10361   
                expected_headers,
15909  10362   
            ));
15910  10363   
        }
15911  10364   
    }
15912         -
    /// Malformed values in the path should be rejected
15913         -
    /// Test ID: RestJsonPathDoubleMalformedValueRejected_case2
       10365  +
    /// Malformed values in query parameters should be rejected
       10366  +
    /// Test ID: RestJsonQueryDoubleMalformedValueRejected_case2
15914  10367   
    #[::tokio::test]
15915         -
    async fn rest_json_path_double_malformed_value_rejected_case2_malformed_request() {
       10368  +
    #[::tracing_test::traced_test]
       10369  +
    async fn rest_json_query_double_malformed_value_rejected_case2_malformed_request() {
15916  10370   
        {
15917  10371   
            #[allow(unused_mut)]
15918  10372   
            let mut http_request = http::Request::builder()
15919         -
                .uri("/MalformedDouble/0x42")
       10373  +
                .uri("/MalformedDouble/1")
15920  10374   
                .method("POST")
15921  10375   
                .body(::aws_smithy_http_server::body::Body::empty())
15922  10376   
                .unwrap();
       10377  +
            *http_request.uri_mut() = "/MalformedDouble/1?doubleInQuery=0x42".parse().unwrap();
15923  10378   
            #[allow(unused_mut)]
15924  10379   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
15925  10380   
            let config = crate::service::RestJsonConfig::builder().build();
15926  10381   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
15927  10382   
                            .malformed_double(move |input: crate::input::MalformedDoubleInput| {
15928  10383   
                                let sender = sender.clone();
15929  10384   
                                async move {
15930  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> };
15931  10386   
                                    sender.send(()).await.expect("receiver dropped early");
15932  10387   
                                    result
15933  10388   
                                }
15934  10389   
                            })
15935  10390   
                            .build_unchecked();
15936  10391   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
15937  10392   
                .await
15938  10393   
                .expect("unable to make an HTTP request");
15939  10394   
            ::pretty_assertions::assert_eq!(
15940  10395   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
15941  10396   
                http_response.status()
15942  10397   
            );
15943  10398   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
15944  10399   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
15945  10400   
                http_response.headers(),
15946  10401   
                expected_headers,
15947  10402   
            ));
15948  10403   
        }
15949  10404   
    }
15950         -
    /// Malformed values in query parameters should be rejected
15951         -
    /// Test ID: RestJsonQueryDoubleMalformedValueRejected_case0
       10405  +
    /// Malformed values in headers should be rejected
       10406  +
    /// Test ID: RestJsonHeaderDoubleMalformedValueRejected_case0
15952  10407   
    #[::tokio::test]
15953         -
    async fn rest_json_query_double_malformed_value_rejected_case0_malformed_request() {
       10408  +
    #[::tracing_test::traced_test]
       10409  +
    async fn rest_json_header_double_malformed_value_rejected_case0_malformed_request() {
15954  10410   
        {
15955  10411   
            #[allow(unused_mut)]
15956  10412   
            let mut http_request = http::Request::builder()
15957  10413   
                .uri("/MalformedDouble/1")
15958  10414   
                .method("POST")
       10415  +
                .header("doubleInHeader", "true")
15959  10416   
                .body(::aws_smithy_http_server::body::Body::empty())
15960  10417   
                .unwrap();
15961         -
            *http_request.uri_mut() = "/MalformedDouble/1?doubleInQuery=true".parse().unwrap();
15962  10418   
            #[allow(unused_mut)]
15963  10419   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
15964  10420   
            let config = crate::service::RestJsonConfig::builder().build();
15965  10421   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
15966  10422   
                            .malformed_double(move |input: crate::input::MalformedDoubleInput| {
15967  10423   
                                let sender = sender.clone();
15968  10424   
                                async move {
15969  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> };
15970  10426   
                                    sender.send(()).await.expect("receiver dropped early");
15971  10427   
                                    result
15972  10428   
                                }
15973  10429   
                            })
15974  10430   
                            .build_unchecked();
15975  10431   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
15976  10432   
                .await
15977  10433   
                .expect("unable to make an HTTP request");
15978  10434   
            ::pretty_assertions::assert_eq!(
15979  10435   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
15980  10436   
                http_response.status()
15981  10437   
            );
15982  10438   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
15983  10439   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
15984  10440   
                http_response.headers(),
15985  10441   
                expected_headers,
15986  10442   
            ));
15987  10443   
        }
15988  10444   
    }
15989         -
    /// Malformed values in query parameters should be rejected
15990         -
    /// Test ID: RestJsonQueryDoubleMalformedValueRejected_case1
       10445  +
    /// Malformed values in headers should be rejected
       10446  +
    /// Test ID: RestJsonHeaderDoubleMalformedValueRejected_case1
15991  10447   
    #[::tokio::test]
15992         -
    async fn rest_json_query_double_malformed_value_rejected_case1_malformed_request() {
       10448  +
    #[::tracing_test::traced_test]
       10449  +
    async fn rest_json_header_double_malformed_value_rejected_case1_malformed_request() {
15993  10450   
        {
15994  10451   
            #[allow(unused_mut)]
15995  10452   
            let mut http_request = http::Request::builder()
15996  10453   
                .uri("/MalformedDouble/1")
15997  10454   
                .method("POST")
       10455  +
                .header("doubleInHeader", "2ABC")
15998  10456   
                .body(::aws_smithy_http_server::body::Body::empty())
15999  10457   
                .unwrap();
16000         -
            *http_request.uri_mut() = "/MalformedDouble/1?doubleInQuery=2ABC".parse().unwrap();
16001  10458   
            #[allow(unused_mut)]
16002  10459   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
16003  10460   
            let config = crate::service::RestJsonConfig::builder().build();
16004  10461   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
16005  10462   
                            .malformed_double(move |input: crate::input::MalformedDoubleInput| {
16006  10463   
                                let sender = sender.clone();
16007  10464   
                                async move {
16008  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> };
16009  10466   
                                    sender.send(()).await.expect("receiver dropped early");
16010  10467   
                                    result
16011  10468   
                                }
16012  10469   
                            })
16013  10470   
                            .build_unchecked();
16014  10471   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
16015  10472   
                .await
16016  10473   
                .expect("unable to make an HTTP request");
16017  10474   
            ::pretty_assertions::assert_eq!(
16018  10475   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
16019  10476   
                http_response.status()
16020  10477   
            );
16021  10478   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
16022  10479   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
16023  10480   
                http_response.headers(),
16024  10481   
                expected_headers,
16025  10482   
            ));
16026  10483   
        }
16027  10484   
    }
16028         -
    /// Malformed values in query parameters should be rejected
16029         -
    /// Test ID: RestJsonQueryDoubleMalformedValueRejected_case2
       10485  +
    /// Malformed values in headers should be rejected
       10486  +
    /// Test ID: RestJsonHeaderDoubleMalformedValueRejected_case2
16030  10487   
    #[::tokio::test]
16031         -
    async fn rest_json_query_double_malformed_value_rejected_case2_malformed_request() {
       10488  +
    #[::tracing_test::traced_test]
       10489  +
    async fn rest_json_header_double_malformed_value_rejected_case2_malformed_request() {
16032  10490   
        {
16033  10491   
            #[allow(unused_mut)]
16034  10492   
            let mut http_request = http::Request::builder()
16035  10493   
                .uri("/MalformedDouble/1")
16036  10494   
                .method("POST")
       10495  +
                .header("doubleInHeader", "0x42")
16037  10496   
                .body(::aws_smithy_http_server::body::Body::empty())
16038  10497   
                .unwrap();
16039         -
            *http_request.uri_mut() = "/MalformedDouble/1?doubleInQuery=0x42".parse().unwrap();
16040  10498   
            #[allow(unused_mut)]
16041  10499   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
16042  10500   
            let config = crate::service::RestJsonConfig::builder().build();
16043  10501   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
16044  10502   
                            .malformed_double(move |input: crate::input::MalformedDoubleInput| {
16045  10503   
                                let sender = sender.clone();
16046  10504   
                                async move {
16047  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> };
16048  10506   
                                    sender.send(()).await.expect("receiver dropped early");
16049  10507   
                                    result
16050  10508   
                                }
16051  10509   
                            })
16052  10510   
                            .build_unchecked();
16053  10511   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
16054  10512   
                .await
16055  10513   
                .expect("unable to make an HTTP request");
16056  10514   
            ::pretty_assertions::assert_eq!(
16057  10515   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
16058  10516   
                http_response.status()
16059  10517   
            );
16060  10518   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
16061  10519   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
16062  10520   
                http_response.headers(),
16063  10521   
                expected_headers,
16064  10522   
            ));
16065  10523   
        }
16066  10524   
    }
16067         -
    /// Malformed values in headers should be rejected
16068         -
    /// Test ID: RestJsonHeaderDoubleMalformedValueRejected_case0
       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>>
       10533  +
    }
       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)
       10576  +
                .await
       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  +
            },
       10587  +
        );
       10588  +
        MalformedFloatInputFuture {
       10589  +
            inner: Box::pin(fut),
       10590  +
        }
       10591  +
    }
       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)
       10600  +
        {
       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))
       10605  +
            }
       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()),
       10619  +
                );
       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))
       10625  +
            }
       10626  +
        }
       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
16069  10636   
    #[::tokio::test]
16070         -
    async fn rest_json_header_double_malformed_value_rejected_case0_malformed_request() {
       10637  +
    #[::tracing_test::traced_test]
       10638  +
    async fn rest_json_body_float_malformed_value_rejected_case0_malformed_request() {
16071  10639   
        {
16072  10640   
            #[allow(unused_mut)]
16073  10641   
            let mut http_request = http::Request::builder()
16074         -
                .uri("/MalformedDouble/1")
       10642  +
                .uri("/MalformedFloat/1")
16075  10643   
                .method("POST")
16076         -
                .header("doubleInHeader", "true")
16077         -
                .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  +
                ))
16078  10648   
                .unwrap();
16079  10649   
            #[allow(unused_mut)]
16080  10650   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
16081  10651   
            let config = crate::service::RestJsonConfig::builder().build();
16082  10652   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
16083         -
                            .malformed_double(move |input: crate::input::MalformedDoubleInput| {
       10653  +
                            .malformed_float(move |input: crate::input::MalformedFloatInput| {
16084  10654   
                                let sender = sender.clone();
16085  10655   
                                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> };
       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> };
16087  10657   
                                    sender.send(()).await.expect("receiver dropped early");
16088  10658   
                                    result
16089  10659   
                                }
16090  10660   
                            })
16091  10661   
                            .build_unchecked();
16092  10662   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
16093  10663   
                .await
16094  10664   
                .expect("unable to make an HTTP request");
16095  10665   
            ::pretty_assertions::assert_eq!(
16096  10666   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
16097  10667   
                http_response.status()
16098  10668   
            );
16099  10669   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
16100  10670   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
16101  10671   
                http_response.headers(),
16102  10672   
                expected_headers,
16103  10673   
            ));
16104  10674   
        }
16105  10675   
    }
16106         -
    /// Malformed values in headers should be rejected
16107         -
    /// Test ID: RestJsonHeaderDoubleMalformedValueRejected_case1
       10676  +
    /// Malformed values in the body should be rejected
       10677  +
    /// Test ID: RestJsonBodyFloatMalformedValueRejected_case1
16108  10678   
    #[::tokio::test]
16109         -
    async fn rest_json_header_double_malformed_value_rejected_case1_malformed_request() {
       10679  +
    #[::tracing_test::traced_test]
       10680  +
    async fn rest_json_body_float_malformed_value_rejected_case1_malformed_request() {
16110  10681   
        {
16111  10682   
            #[allow(unused_mut)]
16112  10683   
            let mut http_request = http::Request::builder()
16113         -
                .uri("/MalformedDouble/1")
       10684  +
                .uri("/MalformedFloat/1")
16114  10685   
                .method("POST")
16115         -
                .header("doubleInHeader", "2ABC")
16116         -
                .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  +
                ))
16117  10690   
                .unwrap();
16118  10691   
            #[allow(unused_mut)]
16119  10692   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
16120  10693   
            let config = crate::service::RestJsonConfig::builder().build();
16121  10694   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
16122         -
                            .malformed_double(move |input: crate::input::MalformedDoubleInput| {
       10695  +
                            .malformed_float(move |input: crate::input::MalformedFloatInput| {
16123  10696   
                                let sender = sender.clone();
16124  10697   
                                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> };
       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> };
16126  10699   
                                    sender.send(()).await.expect("receiver dropped early");
16127  10700   
                                    result
16128  10701   
                                }
16129  10702   
                            })
16130  10703   
                            .build_unchecked();
16131  10704   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
16132  10705   
                .await
16133  10706   
                .expect("unable to make an HTTP request");
16134  10707   
            ::pretty_assertions::assert_eq!(
16135  10708   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
16136  10709   
                http_response.status()
16137  10710   
            );
16138  10711   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
16139  10712   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
16140  10713   
                http_response.headers(),
16141  10714   
                expected_headers,
16142  10715   
            ));
16143  10716   
        }
16144  10717   
    }
16145         -
    /// Malformed values in headers should be rejected
16146         -
    /// Test ID: RestJsonHeaderDoubleMalformedValueRejected_case2
       10718  +
    /// Malformed values in the body should be rejected
       10719  +
    /// Test ID: RestJsonBodyFloatMalformedValueRejected_case2
16147  10720   
    #[::tokio::test]
16148         -
    async fn rest_json_header_double_malformed_value_rejected_case2_malformed_request() {
       10721  +
    #[::tracing_test::traced_test]
       10722  +
    async fn rest_json_body_float_malformed_value_rejected_case2_malformed_request() {
16149  10723   
        {
16150  10724   
            #[allow(unused_mut)]
16151  10725   
            let mut http_request = http::Request::builder()
16152         -
                .uri("/MalformedDouble/1")
       10726  +
                .uri("/MalformedFloat/1")
16153  10727   
                .method("POST")
16154         -
                .header("doubleInHeader", "0x42")
16155         -
                .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  +
                ))
16156  10732   
                .unwrap();
16157  10733   
            #[allow(unused_mut)]
16158  10734   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
16159  10735   
            let config = crate::service::RestJsonConfig::builder().build();
16160  10736   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
16161         -
                            .malformed_double(move |input: crate::input::MalformedDoubleInput| {
       10737  +
                            .malformed_float(move |input: crate::input::MalformedFloatInput| {
16162  10738   
                                let sender = sender.clone();
16163  10739   
                                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> };
       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> };
16165  10741   
                                    sender.send(()).await.expect("receiver dropped early");
16166  10742   
                                    result
16167  10743   
                                }
16168  10744   
                            })
16169  10745   
                            .build_unchecked();
16170  10746   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
16171  10747   
                .await
16172  10748   
                .expect("unable to make an HTTP request");
16173  10749   
            ::pretty_assertions::assert_eq!(
16174  10750   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
16175  10751   
                http_response.status()
16176  10752   
            );
16177  10753   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
16178  10754   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
16179  10755   
                http_response.headers(),
16180  10756   
                expected_headers,
16181  10757   
            ));
16182  10758   
        }
16183  10759   
    }
16184         -
}
16185         -
#[cfg(test)]
16186         -
#[allow(unreachable_code, unused_variables)]
16187         -
mod server_malformed_float_test {
16188  10760   
    /// Malformed values in the body should be rejected
16189         -
    /// Test ID: RestJsonBodyFloatMalformedValueRejected_case0
       10761  +
    /// Test ID: RestJsonBodyFloatMalformedValueRejected_case3
16190  10762   
    #[::tokio::test]
16191         -
    async fn rest_json_body_float_malformed_value_rejected_case0_malformed_request() {
       10763  +
    #[::tracing_test::traced_test]
       10764  +
    async fn rest_json_body_float_malformed_value_rejected_case3_malformed_request() {
16192  10765   
        {
16193  10766   
            #[allow(unused_mut)]
16194  10767   
            let mut http_request = http::Request::builder()
16195  10768   
                .uri("/MalformedFloat/1")
16196  10769   
                .method("POST")
16197  10770   
                .header("content-type", "application/json")
16198  10771   
                .body(::aws_smithy_http_server::body::Body::from(
16199         -
                    ::bytes::Bytes::from_static("{ \"floatInBody\" : \"123\" }".as_bytes()),
       10772  +
                    ::bytes::Bytes::from_static("{ \"floatInBody\" : 0x42 }".as_bytes()),
16200  10773   
                ))
16201  10774   
                .unwrap();
16202  10775   
            #[allow(unused_mut)]
16203  10776   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
16204  10777   
            let config = crate::service::RestJsonConfig::builder().build();
16205  10778   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
16206  10779   
                            .malformed_float(move |input: crate::input::MalformedFloatInput| {
16207  10780   
                                let sender = sender.clone();
16208  10781   
                                async move {
16209  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> };
16210  10783   
                                    sender.send(()).await.expect("receiver dropped early");
16211  10784   
                                    result
16212  10785   
                                }
16213  10786   
                            })
16214  10787   
                            .build_unchecked();
16215  10788   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
16216  10789   
                .await
16217  10790   
                .expect("unable to make an HTTP request");
16218  10791   
            ::pretty_assertions::assert_eq!(
16219  10792   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
16220  10793   
                http_response.status()
16221  10794   
            );
16222  10795   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
16223  10796   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
16224  10797   
                http_response.headers(),
16225  10798   
                expected_headers,
16226  10799   
            ));
16227  10800   
        }
16228  10801   
    }
16229  10802   
    /// Malformed values in the body should be rejected
16230         -
    /// Test ID: RestJsonBodyFloatMalformedValueRejected_case1
       10803  +
    /// Test ID: RestJsonBodyFloatMalformedValueRejected_case4
16231  10804   
    #[::tokio::test]
16232         -
    async fn rest_json_body_float_malformed_value_rejected_case1_malformed_request() {
       10805  +
    #[::tracing_test::traced_test]
       10806  +
    async fn rest_json_body_float_malformed_value_rejected_case4_malformed_request() {
16233  10807   
        {
16234  10808   
            #[allow(unused_mut)]
16235  10809   
            let mut http_request = http::Request::builder()
16236  10810   
                .uri("/MalformedFloat/1")
16237  10811   
                .method("POST")
16238  10812   
                .header("content-type", "application/json")
16239  10813   
                .body(::aws_smithy_http_server::body::Body::from(
16240         -
                    ::bytes::Bytes::from_static("{ \"floatInBody\" : true }".as_bytes()),
       10814  +
                    ::bytes::Bytes::from_static("{ \"floatInBody\" : Infinity }".as_bytes()),
16241  10815   
                ))
16242  10816   
                .unwrap();
16243  10817   
            #[allow(unused_mut)]
16244  10818   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
16245  10819   
            let config = crate::service::RestJsonConfig::builder().build();
16246  10820   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
16247  10821   
                            .malformed_float(move |input: crate::input::MalformedFloatInput| {
16248  10822   
                                let sender = sender.clone();
16249  10823   
                                async move {
16250  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> };
16251  10825   
                                    sender.send(()).await.expect("receiver dropped early");
16252  10826   
                                    result
16253  10827   
                                }
16254  10828   
                            })
16255  10829   
                            .build_unchecked();
16256  10830   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
16257  10831   
                .await
16258  10832   
                .expect("unable to make an HTTP request");
16259  10833   
            ::pretty_assertions::assert_eq!(
16260  10834   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
16261  10835   
                http_response.status()
16262  10836   
            );
16263  10837   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
16264  10838   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
16265  10839   
                http_response.headers(),
16266  10840   
                expected_headers,
16267  10841   
            ));
16268  10842   
        }
16269  10843   
    }
16270  10844   
    /// Malformed values in the body should be rejected
16271         -
    /// Test ID: RestJsonBodyFloatMalformedValueRejected_case2
       10845  +
    /// Test ID: RestJsonBodyFloatMalformedValueRejected_case5
16272  10846   
    #[::tokio::test]
16273         -
    async fn rest_json_body_float_malformed_value_rejected_case2_malformed_request() {
       10847  +
    #[::tracing_test::traced_test]
       10848  +
    async fn rest_json_body_float_malformed_value_rejected_case5_malformed_request() {
16274  10849   
        {
16275  10850   
            #[allow(unused_mut)]
16276  10851   
            let mut http_request = http::Request::builder()
16277  10852   
                .uri("/MalformedFloat/1")
16278  10853   
                .method("POST")
16279  10854   
                .header("content-type", "application/json")
16280  10855   
                .body(::aws_smithy_http_server::body::Body::from(
16281         -
                    ::bytes::Bytes::from_static("{ \"floatInBody\" : 2ABC }".as_bytes()),
       10856  +
                    ::bytes::Bytes::from_static("{ \"floatInBody\" : -Infinity }".as_bytes()),
16282  10857   
                ))
16283  10858   
                .unwrap();
16284  10859   
            #[allow(unused_mut)]
16285  10860   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
16286  10861   
            let config = crate::service::RestJsonConfig::builder().build();
16287  10862   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
16288  10863   
                            .malformed_float(move |input: crate::input::MalformedFloatInput| {
16289  10864   
                                let sender = sender.clone();
16290  10865   
                                async move {
16291  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> };
16292  10867   
                                    sender.send(()).await.expect("receiver dropped early");
16293  10868   
                                    result
16294  10869   
                                }
16295  10870   
                            })
16296  10871   
                            .build_unchecked();
16297  10872   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
16298  10873   
                .await
16299  10874   
                .expect("unable to make an HTTP request");
16300  10875   
            ::pretty_assertions::assert_eq!(
16301  10876   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
16302  10877   
                http_response.status()
16303  10878   
            );
16304  10879   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
16305  10880   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
16306  10881   
                http_response.headers(),
16307  10882   
                expected_headers,
16308  10883   
            ));
16309  10884   
        }
16310  10885   
    }
16311  10886   
    /// Malformed values in the body should be rejected
16312         -
    /// Test ID: RestJsonBodyFloatMalformedValueRejected_case3
       10887  +
    /// Test ID: RestJsonBodyFloatMalformedValueRejected_case6
16313  10888   
    #[::tokio::test]
16314         -
    async fn rest_json_body_float_malformed_value_rejected_case3_malformed_request() {
       10889  +
    #[::tracing_test::traced_test]
       10890  +
    async fn rest_json_body_float_malformed_value_rejected_case6_malformed_request() {
16315  10891   
        {
16316  10892   
            #[allow(unused_mut)]
16317  10893   
            let mut http_request = http::Request::builder()
16318  10894   
                .uri("/MalformedFloat/1")
16319  10895   
                .method("POST")
16320  10896   
                .header("content-type", "application/json")
16321  10897   
                .body(::aws_smithy_http_server::body::Body::from(
16322         -
                    ::bytes::Bytes::from_static("{ \"floatInBody\" : 0x42 }".as_bytes()),
       10898  +
                    ::bytes::Bytes::from_static("{ \"floatInBody\" : NaN }".as_bytes()),
16323  10899   
                ))
16324  10900   
                .unwrap();
16325  10901   
            #[allow(unused_mut)]
16326  10902   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
16327  10903   
            let config = crate::service::RestJsonConfig::builder().build();
16328  10904   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
16329  10905   
                            .malformed_float(move |input: crate::input::MalformedFloatInput| {
16330  10906   
                                let sender = sender.clone();
16331  10907   
                                async move {
16332  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> };
16333  10909   
                                    sender.send(()).await.expect("receiver dropped early");
16334  10910   
                                    result
16335  10911   
                                }
16336  10912   
                            })
16337  10913   
                            .build_unchecked();
16338  10914   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
16339  10915   
                .await
16340  10916   
                .expect("unable to make an HTTP request");
16341  10917   
            ::pretty_assertions::assert_eq!(
16342  10918   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
16343  10919   
                http_response.status()
16344  10920   
            );
16345  10921   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
16346  10922   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
16347  10923   
                http_response.headers(),
16348  10924   
                expected_headers,
16349  10925   
            ));
16350  10926   
        }
16351  10927   
    }
16352         -
    /// Malformed values in the body should be rejected
16353         -
    /// Test ID: RestJsonBodyFloatMalformedValueRejected_case4
       10928  +
    /// Malformed values in the path should be rejected
       10929  +
    /// Test ID: RestJsonPathFloatMalformedValueRejected_case0
16354  10930   
    #[::tokio::test]
16355         -
    async fn rest_json_body_float_malformed_value_rejected_case4_malformed_request() {
       10931  +
    #[::tracing_test::traced_test]
       10932  +
    async fn rest_json_path_float_malformed_value_rejected_case0_malformed_request() {
16356  10933   
        {
16357  10934   
            #[allow(unused_mut)]
16358  10935   
            let mut http_request = http::Request::builder()
16359         -
                .uri("/MalformedFloat/1")
       10936  +
                .uri("/MalformedFloat/true")
16360  10937   
                .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         -
                ))
       10938  +
                .body(::aws_smithy_http_server::body::Body::empty())
16365  10939   
                .unwrap();
16366  10940   
            #[allow(unused_mut)]
16367  10941   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
16368  10942   
            let config = crate::service::RestJsonConfig::builder().build();
16369  10943   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
16370  10944   
                            .malformed_float(move |input: crate::input::MalformedFloatInput| {
16371  10945   
                                let sender = sender.clone();
16372  10946   
                                async move {
16373  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> };
16374  10948   
                                    sender.send(()).await.expect("receiver dropped early");
16375  10949   
                                    result
16376  10950   
                                }
16377  10951   
                            })
16378  10952   
                            .build_unchecked();
16379  10953   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
16380  10954   
                .await
16381  10955   
                .expect("unable to make an HTTP request");
16382  10956   
            ::pretty_assertions::assert_eq!(
16383  10957   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
16384  10958   
                http_response.status()
16385  10959   
            );
16386  10960   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
16387  10961   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
16388  10962   
                http_response.headers(),
16389  10963   
                expected_headers,
16390  10964   
            ));
16391  10965   
        }
16392  10966   
    }
16393         -
    /// Malformed values in the body should be rejected
16394         -
    /// Test ID: RestJsonBodyFloatMalformedValueRejected_case5
       10967  +
    /// Malformed values in the path should be rejected
       10968  +
    /// Test ID: RestJsonPathFloatMalformedValueRejected_case1
16395  10969   
    #[::tokio::test]
16396         -
    async fn rest_json_body_float_malformed_value_rejected_case5_malformed_request() {
       10970  +
    #[::tracing_test::traced_test]
       10971  +
    async fn rest_json_path_float_malformed_value_rejected_case1_malformed_request() {
16397  10972   
        {
16398  10973   
            #[allow(unused_mut)]
16399  10974   
            let mut http_request = http::Request::builder()
16400         -
                .uri("/MalformedFloat/1")
       10975  +
                .uri("/MalformedFloat/2ABC")
16401  10976   
                .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         -
                ))
       10977  +
                .body(::aws_smithy_http_server::body::Body::empty())
16406  10978   
                .unwrap();
16407  10979   
            #[allow(unused_mut)]
16408  10980   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
16409  10981   
            let config = crate::service::RestJsonConfig::builder().build();
16410  10982   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
16411  10983   
                            .malformed_float(move |input: crate::input::MalformedFloatInput| {
16412  10984   
                                let sender = sender.clone();
16413  10985   
                                async move {
16414  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> };
16415  10987   
                                    sender.send(()).await.expect("receiver dropped early");
16416  10988   
                                    result
16417  10989   
                                }
16418  10990   
                            })
16419  10991   
                            .build_unchecked();
16420  10992   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
16421  10993   
                .await
16422  10994   
                .expect("unable to make an HTTP request");
16423  10995   
            ::pretty_assertions::assert_eq!(
16424  10996   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
16425  10997   
                http_response.status()
16426  10998   
            );
16427  10999   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
16428  11000   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
16429  11001   
                http_response.headers(),
16430  11002   
                expected_headers,
16431  11003   
            ));
16432  11004   
        }
16433  11005   
    }
16434         -
    /// Malformed values in the body should be rejected
16435         -
    /// Test ID: RestJsonBodyFloatMalformedValueRejected_case6
       11006  +
    /// Malformed values in the path should be rejected
       11007  +
    /// Test ID: RestJsonPathFloatMalformedValueRejected_case2
16436  11008   
    #[::tokio::test]
16437         -
    async fn rest_json_body_float_malformed_value_rejected_case6_malformed_request() {
       11009  +
    #[::tracing_test::traced_test]
       11010  +
    async fn rest_json_path_float_malformed_value_rejected_case2_malformed_request() {
16438  11011   
        {
16439  11012   
            #[allow(unused_mut)]
16440  11013   
            let mut http_request = http::Request::builder()
16441         -
                .uri("/MalformedFloat/1")
       11014  +
                .uri("/MalformedFloat/0x42")
16442  11015   
                .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         -
                ))
       11016  +
                .body(::aws_smithy_http_server::body::Body::empty())
16447  11017   
                .unwrap();
16448  11018   
            #[allow(unused_mut)]
16449  11019   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
16450  11020   
            let config = crate::service::RestJsonConfig::builder().build();
16451  11021   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
16452  11022   
                            .malformed_float(move |input: crate::input::MalformedFloatInput| {
16453  11023   
                                let sender = sender.clone();
16454  11024   
                                async move {
16455  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> };
16456  11026   
                                    sender.send(()).await.expect("receiver dropped early");
16457  11027   
                                    result
16458  11028   
                                }
16459  11029   
                            })
16460  11030   
                            .build_unchecked();
16461  11031   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
16462  11032   
                .await
16463  11033   
                .expect("unable to make an HTTP request");
16464  11034   
            ::pretty_assertions::assert_eq!(
16465  11035   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
16466  11036   
                http_response.status()
16467  11037   
            );
16468  11038   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
16469  11039   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
16470  11040   
                http_response.headers(),
16471  11041   
                expected_headers,
16472  11042   
            ));
16473  11043   
        }
16474  11044   
    }
16475         -
    /// Malformed values in the path should be rejected
16476         -
    /// Test ID: RestJsonPathFloatMalformedValueRejected_case0
       11045  +
    /// Malformed values in query parameters should be rejected
       11046  +
    /// Test ID: RestJsonQueryFloatMalformedValueRejected_case0
16477  11047   
    #[::tokio::test]
16478         -
    async fn rest_json_path_float_malformed_value_rejected_case0_malformed_request() {
       11048  +
    #[::tracing_test::traced_test]
       11049  +
    async fn rest_json_query_float_malformed_value_rejected_case0_malformed_request() {
16479  11050   
        {
16480  11051   
            #[allow(unused_mut)]
16481  11052   
            let mut http_request = http::Request::builder()
16482         -
                .uri("/MalformedFloat/true")
       11053  +
                .uri("/MalformedFloat/1")
16483  11054   
                .method("POST")
16484  11055   
                .body(::aws_smithy_http_server::body::Body::empty())
16485  11056   
                .unwrap();
       11057  +
            *http_request.uri_mut() = "/MalformedFloat/1?floatInQuery=true".parse().unwrap();
16486  11058   
            #[allow(unused_mut)]
16487  11059   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
16488  11060   
            let config = crate::service::RestJsonConfig::builder().build();
16489  11061   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
16490  11062   
                            .malformed_float(move |input: crate::input::MalformedFloatInput| {
16491  11063   
                                let sender = sender.clone();
16492  11064   
                                async move {
16493  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> };
16494  11066   
                                    sender.send(()).await.expect("receiver dropped early");
16495  11067   
                                    result
16496  11068   
                                }
16497  11069   
                            })
16498  11070   
                            .build_unchecked();
16499  11071   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
16500  11072   
                .await
16501  11073   
                .expect("unable to make an HTTP request");
16502  11074   
            ::pretty_assertions::assert_eq!(
16503  11075   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
16504  11076   
                http_response.status()
16505  11077   
            );
16506  11078   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
16507  11079   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
16508  11080   
                http_response.headers(),
16509  11081   
                expected_headers,
16510  11082   
            ));
16511  11083   
        }
16512  11084   
    }
16513         -
    /// Malformed values in the path should be rejected
16514         -
    /// Test ID: RestJsonPathFloatMalformedValueRejected_case1
       11085  +
    /// Malformed values in query parameters should be rejected
       11086  +
    /// Test ID: RestJsonQueryFloatMalformedValueRejected_case1
16515  11087   
    #[::tokio::test]
16516         -
    async fn rest_json_path_float_malformed_value_rejected_case1_malformed_request() {
       11088  +
    #[::tracing_test::traced_test]
       11089  +
    async fn rest_json_query_float_malformed_value_rejected_case1_malformed_request() {
16517  11090   
        {
16518  11091   
            #[allow(unused_mut)]
16519  11092   
            let mut http_request = http::Request::builder()
16520         -
                .uri("/MalformedFloat/2ABC")
       11093  +
                .uri("/MalformedFloat/1")
16521  11094   
                .method("POST")
16522  11095   
                .body(::aws_smithy_http_server::body::Body::empty())
16523  11096   
                .unwrap();
       11097  +
            *http_request.uri_mut() = "/MalformedFloat/1?floatInQuery=2ABC".parse().unwrap();
16524  11098   
            #[allow(unused_mut)]
16525  11099   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
16526  11100   
            let config = crate::service::RestJsonConfig::builder().build();
16527  11101   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
16528  11102   
                            .malformed_float(move |input: crate::input::MalformedFloatInput| {
16529  11103   
                                let sender = sender.clone();
16530  11104   
                                async move {
16531  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> };
16532  11106   
                                    sender.send(()).await.expect("receiver dropped early");
16533  11107   
                                    result
16534  11108   
                                }
16535  11109   
                            })
16536  11110   
                            .build_unchecked();
16537  11111   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
16538  11112   
                .await
16539  11113   
                .expect("unable to make an HTTP request");
16540  11114   
            ::pretty_assertions::assert_eq!(
16541  11115   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
16542  11116   
                http_response.status()
16543  11117   
            );
16544  11118   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
16545  11119   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
16546  11120   
                http_response.headers(),
16547  11121   
                expected_headers,
16548  11122   
            ));
16549  11123   
        }
16550  11124   
    }
16551         -
    /// Malformed values in the path should be rejected
16552         -
    /// Test ID: RestJsonPathFloatMalformedValueRejected_case2
       11125  +
    /// Malformed values in query parameters should be rejected
       11126  +
    /// Test ID: RestJsonQueryFloatMalformedValueRejected_case2
16553  11127   
    #[::tokio::test]
16554         -
    async fn rest_json_path_float_malformed_value_rejected_case2_malformed_request() {
       11128  +
    #[::tracing_test::traced_test]
       11129  +
    async fn rest_json_query_float_malformed_value_rejected_case2_malformed_request() {
16555  11130   
        {
16556  11131   
            #[allow(unused_mut)]
16557  11132   
            let mut http_request = http::Request::builder()
16558         -
                .uri("/MalformedFloat/0x42")
       11133  +
                .uri("/MalformedFloat/1")
16559  11134   
                .method("POST")
16560  11135   
                .body(::aws_smithy_http_server::body::Body::empty())
16561  11136   
                .unwrap();
       11137  +
            *http_request.uri_mut() = "/MalformedFloat/1?floatInQuery=0x42".parse().unwrap();
16562  11138   
            #[allow(unused_mut)]
16563  11139   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
16564  11140   
            let config = crate::service::RestJsonConfig::builder().build();
16565  11141   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
16566  11142   
                            .malformed_float(move |input: crate::input::MalformedFloatInput| {
16567  11143   
                                let sender = sender.clone();
16568  11144   
                                async move {
16569  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> };
16570  11146   
                                    sender.send(()).await.expect("receiver dropped early");
16571  11147   
                                    result
16572  11148   
                                }
16573  11149   
                            })
16574  11150   
                            .build_unchecked();
16575  11151   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
16576  11152   
                .await
16577  11153   
                .expect("unable to make an HTTP request");
16578  11154   
            ::pretty_assertions::assert_eq!(
16579  11155   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
16580  11156   
                http_response.status()
16581  11157   
            );
16582  11158   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
16583  11159   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
16584  11160   
                http_response.headers(),
16585  11161   
                expected_headers,
16586  11162   
            ));
16587  11163   
        }
16588  11164   
    }
16589         -
    /// Malformed values in query parameters should be rejected
16590         -
    /// Test ID: RestJsonQueryFloatMalformedValueRejected_case0
       11165  +
    /// Malformed values in headers should be rejected
       11166  +
    /// Test ID: RestJsonHeaderFloatMalformedValueRejected_case0
16591  11167   
    #[::tokio::test]
16592         -
    async fn rest_json_query_float_malformed_value_rejected_case0_malformed_request() {
       11168  +
    #[::tracing_test::traced_test]
       11169  +
    async fn rest_json_header_float_malformed_value_rejected_case0_malformed_request() {
16593  11170   
        {
16594  11171   
            #[allow(unused_mut)]
16595  11172   
            let mut http_request = http::Request::builder()
16596  11173   
                .uri("/MalformedFloat/1")
16597  11174   
                .method("POST")
       11175  +
                .header("floatInHeader", "true")
16598  11176   
                .body(::aws_smithy_http_server::body::Body::empty())
16599  11177   
                .unwrap();
16600         -
            *http_request.uri_mut() = "/MalformedFloat/1?floatInQuery=true".parse().unwrap();
16601  11178   
            #[allow(unused_mut)]
16602  11179   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
16603  11180   
            let config = crate::service::RestJsonConfig::builder().build();
16604  11181   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
16605  11182   
                            .malformed_float(move |input: crate::input::MalformedFloatInput| {
16606  11183   
                                let sender = sender.clone();
16607  11184   
                                async move {
16608  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> };
16609  11186   
                                    sender.send(()).await.expect("receiver dropped early");
16610  11187   
                                    result
16611  11188   
                                }
16612  11189   
                            })
16613  11190   
                            .build_unchecked();
16614  11191   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
16615  11192   
                .await
16616  11193   
                .expect("unable to make an HTTP request");
16617  11194   
            ::pretty_assertions::assert_eq!(
16618  11195   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
16619  11196   
                http_response.status()
16620  11197   
            );
16621  11198   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
16622  11199   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
16623  11200   
                http_response.headers(),
16624  11201   
                expected_headers,
16625  11202   
            ));
16626  11203   
        }
16627  11204   
    }
16628         -
    /// Malformed values in query parameters should be rejected
16629         -
    /// Test ID: RestJsonQueryFloatMalformedValueRejected_case1
       11205  +
    /// Malformed values in headers should be rejected
       11206  +
    /// Test ID: RestJsonHeaderFloatMalformedValueRejected_case1
16630  11207   
    #[::tokio::test]
16631         -
    async fn rest_json_query_float_malformed_value_rejected_case1_malformed_request() {
       11208  +
    #[::tracing_test::traced_test]
       11209  +
    async fn rest_json_header_float_malformed_value_rejected_case1_malformed_request() {
16632  11210   
        {
16633  11211   
            #[allow(unused_mut)]
16634  11212   
            let mut http_request = http::Request::builder()
16635  11213   
                .uri("/MalformedFloat/1")
16636  11214   
                .method("POST")
       11215  +
                .header("floatInHeader", "2ABC")
16637  11216   
                .body(::aws_smithy_http_server::body::Body::empty())
16638  11217   
                .unwrap();
16639         -
            *http_request.uri_mut() = "/MalformedFloat/1?floatInQuery=2ABC".parse().unwrap();
16640  11218   
            #[allow(unused_mut)]
16641  11219   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
16642  11220   
            let config = crate::service::RestJsonConfig::builder().build();
16643  11221   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
16644  11222   
                            .malformed_float(move |input: crate::input::MalformedFloatInput| {
16645  11223   
                                let sender = sender.clone();
16646  11224   
                                async move {
16647  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> };
16648  11226   
                                    sender.send(()).await.expect("receiver dropped early");
16649  11227   
                                    result
16650  11228   
                                }
16651  11229   
                            })
16652  11230   
                            .build_unchecked();
16653  11231   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
16654  11232   
                .await
16655  11233   
                .expect("unable to make an HTTP request");
16656  11234   
            ::pretty_assertions::assert_eq!(
16657  11235   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
16658  11236   
                http_response.status()
16659  11237   
            );
16660  11238   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
16661  11239   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
16662  11240   
                http_response.headers(),
16663  11241   
                expected_headers,
16664  11242   
            ));
16665  11243   
        }
16666  11244   
    }
16667         -
    /// Malformed values in query parameters should be rejected
16668         -
    /// Test ID: RestJsonQueryFloatMalformedValueRejected_case2
       11245  +
    /// Malformed values in headers should be rejected
       11246  +
    /// Test ID: RestJsonHeaderFloatMalformedValueRejected_case2
16669  11247   
    #[::tokio::test]
16670         -
    async fn rest_json_query_float_malformed_value_rejected_case2_malformed_request() {
       11248  +
    #[::tracing_test::traced_test]
       11249  +
    async fn rest_json_header_float_malformed_value_rejected_case2_malformed_request() {
16671  11250   
        {
16672  11251   
            #[allow(unused_mut)]
16673  11252   
            let mut http_request = http::Request::builder()
16674  11253   
                .uri("/MalformedFloat/1")
16675  11254   
                .method("POST")
       11255  +
                .header("floatInHeader", "0x42")
16676  11256   
                .body(::aws_smithy_http_server::body::Body::empty())
16677  11257   
                .unwrap();
16678         -
            *http_request.uri_mut() = "/MalformedFloat/1?floatInQuery=0x42".parse().unwrap();
16679  11258   
            #[allow(unused_mut)]
16680  11259   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
16681  11260   
            let config = crate::service::RestJsonConfig::builder().build();
16682  11261   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
16683  11262   
                            .malformed_float(move |input: crate::input::MalformedFloatInput| {
16684  11263   
                                let sender = sender.clone();
16685  11264   
                                async move {
16686  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> };
16687  11266   
                                    sender.send(()).await.expect("receiver dropped early");
16688  11267   
                                    result
16689  11268   
                                }
16690  11269   
                            })
16691  11270   
                            .build_unchecked();
16692  11271   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
16693  11272   
                .await
16694  11273   
                .expect("unable to make an HTTP request");
16695  11274   
            ::pretty_assertions::assert_eq!(
16696  11275   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
16697  11276   
                http_response.status()
16698  11277   
            );
16699  11278   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
16700  11279   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
16701  11280   
                http_response.headers(),
16702  11281   
                expected_headers,
16703  11282   
            ));
16704  11283   
        }
16705  11284   
    }
16706         -
    /// Malformed values in headers should be rejected
16707         -
    /// Test ID: RestJsonHeaderFloatMalformedValueRejected_case0
       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>>
       11293  +
    }
       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)
       11336  +
                .await
       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  +
            },
       11347  +
        );
       11348  +
        MalformedLongInputFuture {
       11349  +
            inner: Box::pin(fut),
       11350  +
        }
       11351  +
    }
       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))
       11364  +
            }
       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()),
       11378  +
                );
       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  +
            }
       11385  +
        }
       11386  +
    }
       11387  +
}
       11388  +
       11389  +
#[allow(unreachable_code, unused_variables)]
       11390  +
#[cfg(test)]
       11391  +
mod malformed_long_test {
       11392  +
       11393  +
    /// Underflow or overflow should result in SerializationException
       11394  +
    /// Test ID: RestJsonBodyLongUnderflowOverflow_case0
16708  11395   
    #[::tokio::test]
16709         -
    async fn rest_json_header_float_malformed_value_rejected_case0_malformed_request() {
       11396  +
    #[::tracing_test::traced_test]
       11397  +
    async fn rest_json_body_long_underflow_overflow_case0_malformed_request() {
16710  11398   
        {
16711  11399   
            #[allow(unused_mut)]
16712  11400   
            let mut http_request = http::Request::builder()
16713         -
                .uri("/MalformedFloat/1")
       11401  +
                .uri("/MalformedLong/1")
16714  11402   
                .method("POST")
16715         -
                .header("floatInHeader", "true")
16716         -
                .body(::aws_smithy_http_server::body::Body::empty())
       11403  +
                .header("content-type", "application/json")
       11404  +
                .body(::aws_smithy_http_server::body::Body::from(
       11405  +
                    ::bytes::Bytes::from_static(
       11406  +
                        "{ \"longInBody\" : -184467440737095500000 }".as_bytes(),
       11407  +
                    ),
       11408  +
                ))
16717  11409   
                .unwrap();
16718  11410   
            #[allow(unused_mut)]
16719  11411   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
16720  11412   
            let config = crate::service::RestJsonConfig::builder().build();
16721  11413   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
16722         -
                            .malformed_float(move |input: crate::input::MalformedFloatInput| {
       11414  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
16723  11415   
                                let sender = sender.clone();
16724  11416   
                                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> };
       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> };
16726  11418   
                                    sender.send(()).await.expect("receiver dropped early");
16727  11419   
                                    result
16728  11420   
                                }
16729  11421   
                            })
16730  11422   
                            .build_unchecked();
16731  11423   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
16732  11424   
                .await
16733  11425   
                .expect("unable to make an HTTP request");
16734  11426   
            ::pretty_assertions::assert_eq!(
16735  11427   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
16736  11428   
                http_response.status()
16737  11429   
            );
16738  11430   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
16739  11431   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
16740  11432   
                http_response.headers(),
16741  11433   
                expected_headers,
16742  11434   
            ));
16743  11435   
        }
16744  11436   
    }
16745         -
    /// Malformed values in headers should be rejected
16746         -
    /// Test ID: RestJsonHeaderFloatMalformedValueRejected_case1
       11437  +
    /// Underflow or overflow should result in SerializationException
       11438  +
    /// Test ID: RestJsonBodyLongUnderflowOverflow_case1
16747  11439   
    #[::tokio::test]
16748         -
    async fn rest_json_header_float_malformed_value_rejected_case1_malformed_request() {
       11440  +
    #[::tracing_test::traced_test]
       11441  +
    async fn rest_json_body_long_underflow_overflow_case1_malformed_request() {
16749  11442   
        {
16750  11443   
            #[allow(unused_mut)]
16751  11444   
            let mut http_request = http::Request::builder()
16752         -
                .uri("/MalformedFloat/1")
       11445  +
                .uri("/MalformedLong/1")
16753  11446   
                .method("POST")
16754         -
                .header("floatInHeader", "2ABC")
16755         -
                .body(::aws_smithy_http_server::body::Body::empty())
       11447  +
                .header("content-type", "application/json")
       11448  +
                .body(::aws_smithy_http_server::body::Body::from(
       11449  +
                    ::bytes::Bytes::from_static(
       11450  +
                        "{ \"longInBody\" : 184467440737095500000 }".as_bytes(),
       11451  +
                    ),
       11452  +
                ))
16756  11453   
                .unwrap();
16757  11454   
            #[allow(unused_mut)]
16758  11455   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
16759  11456   
            let config = crate::service::RestJsonConfig::builder().build();
16760  11457   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
16761         -
                            .malformed_float(move |input: crate::input::MalformedFloatInput| {
       11458  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
16762  11459   
                                let sender = sender.clone();
16763  11460   
                                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> };
       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> };
16765  11462   
                                    sender.send(()).await.expect("receiver dropped early");
16766  11463   
                                    result
16767  11464   
                                }
16768  11465   
                            })
16769  11466   
                            .build_unchecked();
16770  11467   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
16771  11468   
                .await
16772  11469   
                .expect("unable to make an HTTP request");
16773  11470   
            ::pretty_assertions::assert_eq!(
16774  11471   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
16775  11472   
                http_response.status()
16776  11473   
            );
16777  11474   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
16778  11475   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
16779  11476   
                http_response.headers(),
16780  11477   
                expected_headers,
16781  11478   
            ));
16782  11479   
        }
16783  11480   
    }
16784         -
    /// Malformed values in headers should be rejected
16785         -
    /// Test ID: RestJsonHeaderFloatMalformedValueRejected_case2
       11481  +
    /// Underflow or overflow should result in SerializationException
       11482  +
    /// Test ID: RestJsonBodyLongUnderflowOverflow_case2
16786  11483   
    #[::tokio::test]
16787         -
    async fn rest_json_header_float_malformed_value_rejected_case2_malformed_request() {
       11484  +
    #[::tracing_test::traced_test]
       11485  +
    async fn rest_json_body_long_underflow_overflow_case2_malformed_request() {
16788  11486   
        {
16789  11487   
            #[allow(unused_mut)]
16790  11488   
            let mut http_request = http::Request::builder()
16791         -
                .uri("/MalformedFloat/1")
       11489  +
                .uri("/MalformedLong/1")
16792  11490   
                .method("POST")
16793         -
                .header("floatInHeader", "0x42")
16794         -
                .body(::aws_smithy_http_server::body::Body::empty())
       11491  +
                .header("content-type", "application/json")
       11492  +
                .body(::aws_smithy_http_server::body::Body::from(
       11493  +
                    ::bytes::Bytes::from_static(
       11494  +
                        "{ \"longInBody\" : 123000000000000000000000 }".as_bytes(),
       11495  +
                    ),
       11496  +
                ))
16795  11497   
                .unwrap();
16796  11498   
            #[allow(unused_mut)]
16797  11499   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
16798  11500   
            let config = crate::service::RestJsonConfig::builder().build();
16799  11501   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
16800         -
                            .malformed_float(move |input: crate::input::MalformedFloatInput| {
       11502  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
16801  11503   
                                let sender = sender.clone();
16802  11504   
                                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> };
       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> };
16804  11506   
                                    sender.send(()).await.expect("receiver dropped early");
16805  11507   
                                    result
16806  11508   
                                }
16807  11509   
                            })
16808  11510   
                            .build_unchecked();
16809  11511   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
16810  11512   
                .await
16811  11513   
                .expect("unable to make an HTTP request");
16812  11514   
            ::pretty_assertions::assert_eq!(
16813  11515   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
16814  11516   
                http_response.status()
16815  11517   
            );
16816  11518   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
16817  11519   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
16818  11520   
                http_response.headers(),
16819  11521   
                expected_headers,
16820  11522   
            ));
16821  11523   
        }
16822  11524   
    }
16823         -
}
16824         -
#[cfg(test)]
16825         -
#[allow(unreachable_code, unused_variables)]
16826         -
mod server_malformed_integer_test {
16827  11525   
    /// Underflow or overflow should result in SerializationException
16828         -
    /// Test ID: RestJsonBodyIntegerUnderflowOverflow_case0
       11526  +
    /// Test ID: RestJsonPathLongUnderflowOverflow_case0
16829  11527   
    #[::tokio::test]
16830         -
    async fn rest_json_body_integer_underflow_overflow_case0_malformed_request() {
       11528  +
    #[::tracing_test::traced_test]
       11529  +
    async fn rest_json_path_long_underflow_overflow_case0_malformed_request() {
16831  11530   
        {
16832  11531   
            #[allow(unused_mut)]
16833  11532   
            let mut http_request = http::Request::builder()
16834         -
                .uri("/MalformedInteger/1")
       11533  +
                .uri("/MalformedLong/-184467440737095500000")
16835  11534   
                .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         -
                ))
       11535  +
                .body(::aws_smithy_http_server::body::Body::empty())
16842  11536   
                .unwrap();
16843  11537   
            #[allow(unused_mut)]
16844  11538   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
16845  11539   
            let config = crate::service::RestJsonConfig::builder().build();
16846  11540   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
16847         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       11541  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
16848  11542   
                                let sender = sender.clone();
16849  11543   
                                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> };
       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> };
16851  11545   
                                    sender.send(()).await.expect("receiver dropped early");
16852  11546   
                                    result
16853  11547   
                                }
16854  11548   
                            })
16855  11549   
                            .build_unchecked();
16856  11550   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
16857  11551   
                .await
16858  11552   
                .expect("unable to make an HTTP request");
16859  11553   
            ::pretty_assertions::assert_eq!(
16860  11554   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
16861  11555   
                http_response.status()
16862  11556   
            );
16863  11557   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
16864  11558   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
16865  11559   
                http_response.headers(),
16866  11560   
                expected_headers,
16867  11561   
            ));
16868  11562   
        }
16869  11563   
    }
16870  11564   
    /// Underflow or overflow should result in SerializationException
16871         -
    /// Test ID: RestJsonBodyIntegerUnderflowOverflow_case1
       11565  +
    /// Test ID: RestJsonPathLongUnderflowOverflow_case1
16872  11566   
    #[::tokio::test]
16873         -
    async fn rest_json_body_integer_underflow_overflow_case1_malformed_request() {
       11567  +
    #[::tracing_test::traced_test]
       11568  +
    async fn rest_json_path_long_underflow_overflow_case1_malformed_request() {
16874  11569   
        {
16875  11570   
            #[allow(unused_mut)]
16876  11571   
            let mut http_request = http::Request::builder()
16877         -
                .uri("/MalformedInteger/1")
       11572  +
                .uri("/MalformedLong/184467440737095500000")
16878  11573   
                .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         -
                ))
       11574  +
                .body(::aws_smithy_http_server::body::Body::empty())
16885  11575   
                .unwrap();
16886  11576   
            #[allow(unused_mut)]
16887  11577   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
16888  11578   
            let config = crate::service::RestJsonConfig::builder().build();
16889  11579   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
16890         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       11580  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
16891  11581   
                                let sender = sender.clone();
16892  11582   
                                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> };
       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> };
16894  11584   
                                    sender.send(()).await.expect("receiver dropped early");
16895  11585   
                                    result
16896  11586   
                                }
16897  11587   
                            })
16898  11588   
                            .build_unchecked();
16899  11589   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
16900  11590   
                .await
16901  11591   
                .expect("unable to make an HTTP request");
16902  11592   
            ::pretty_assertions::assert_eq!(
16903  11593   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
16904  11594   
                http_response.status()
16905  11595   
            );
16906  11596   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
16907  11597   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
16908  11598   
                http_response.headers(),
16909  11599   
                expected_headers,
16910  11600   
            ));
16911  11601   
        }
16912  11602   
    }
16913  11603   
    /// Underflow or overflow should result in SerializationException
16914         -
    /// Test ID: RestJsonBodyIntegerUnderflowOverflow_case2
       11604  +
    /// Test ID: RestJsonPathLongUnderflowOverflow_case2
16915  11605   
    #[::tokio::test]
16916         -
    async fn rest_json_body_integer_underflow_overflow_case2_malformed_request() {
       11606  +
    #[::tracing_test::traced_test]
       11607  +
    async fn rest_json_path_long_underflow_overflow_case2_malformed_request() {
16917  11608   
        {
16918  11609   
            #[allow(unused_mut)]
16919  11610   
            let mut http_request = http::Request::builder()
16920         -
                .uri("/MalformedInteger/1")
       11611  +
                .uri("/MalformedLong/123000000000000000000000")
16921  11612   
                .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         -
                ))
       11613  +
                .body(::aws_smithy_http_server::body::Body::empty())
16928  11614   
                .unwrap();
16929  11615   
            #[allow(unused_mut)]
16930  11616   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
16931  11617   
            let config = crate::service::RestJsonConfig::builder().build();
16932  11618   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
16933         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       11619  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
16934  11620   
                                let sender = sender.clone();
16935  11621   
                                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> };
       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> };
16937  11623   
                                    sender.send(()).await.expect("receiver dropped early");
16938  11624   
                                    result
16939  11625   
                                }
16940  11626   
                            })
16941  11627   
                            .build_unchecked();
16942  11628   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
16943  11629   
                .await
16944  11630   
                .expect("unable to make an HTTP request");
16945  11631   
            ::pretty_assertions::assert_eq!(
16946  11632   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
16947  11633   
                http_response.status()
16948  11634   
            );
16949  11635   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
16950  11636   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
16951  11637   
                http_response.headers(),
16952  11638   
                expected_headers,
16953  11639   
            ));
16954  11640   
        }
16955  11641   
    }
16956  11642   
    /// Underflow or overflow should result in SerializationException
16957         -
    /// Test ID: RestJsonPathIntegerUnderflowOverflow_case0
       11643  +
    /// Test ID: RestJsonQueryLongUnderflowOverflow_case0
16958  11644   
    #[::tokio::test]
16959         -
    async fn rest_json_path_integer_underflow_overflow_case0_malformed_request() {
       11645  +
    #[::tracing_test::traced_test]
       11646  +
    async fn rest_json_query_long_underflow_overflow_case0_malformed_request() {
16960  11647   
        {
16961  11648   
            #[allow(unused_mut)]
16962  11649   
            let mut http_request = http::Request::builder()
16963         -
                .uri("/MalformedInteger/-9223372000000000000")
       11650  +
                .uri("/MalformedLong/1")
16964  11651   
                .method("POST")
16965  11652   
                .body(::aws_smithy_http_server::body::Body::empty())
16966  11653   
                .unwrap();
       11654  +
            *http_request.uri_mut() = "/MalformedLong/1?longInQuery=-184467440737095500000"
       11655  +
                .parse()
       11656  +
                .unwrap();
16967  11657   
            #[allow(unused_mut)]
16968  11658   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
16969  11659   
            let config = crate::service::RestJsonConfig::builder().build();
16970  11660   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
16971         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       11661  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
16972  11662   
                                let sender = sender.clone();
16973  11663   
                                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> };
       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> };
16975  11665   
                                    sender.send(()).await.expect("receiver dropped early");
16976  11666   
                                    result
16977  11667   
                                }
16978  11668   
                            })
16979  11669   
                            .build_unchecked();
16980  11670   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
16981  11671   
                .await
16982  11672   
                .expect("unable to make an HTTP request");
16983  11673   
            ::pretty_assertions::assert_eq!(
16984  11674   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
16985  11675   
                http_response.status()
16986  11676   
            );
16987  11677   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
16988  11678   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
16989  11679   
                http_response.headers(),
16990  11680   
                expected_headers,
16991  11681   
            ));
16992  11682   
        }
16993  11683   
    }
16994  11684   
    /// Underflow or overflow should result in SerializationException
16995         -
    /// Test ID: RestJsonPathIntegerUnderflowOverflow_case1
       11685  +
    /// Test ID: RestJsonQueryLongUnderflowOverflow_case1
16996  11686   
    #[::tokio::test]
16997         -
    async fn rest_json_path_integer_underflow_overflow_case1_malformed_request() {
       11687  +
    #[::tracing_test::traced_test]
       11688  +
    async fn rest_json_query_long_underflow_overflow_case1_malformed_request() {
16998  11689   
        {
16999  11690   
            #[allow(unused_mut)]
17000  11691   
            let mut http_request = http::Request::builder()
17001         -
                .uri("/MalformedInteger/9223372000000000000")
       11692  +
                .uri("/MalformedLong/1")
17002  11693   
                .method("POST")
17003  11694   
                .body(::aws_smithy_http_server::body::Body::empty())
17004  11695   
                .unwrap();
       11696  +
            *http_request.uri_mut() = "/MalformedLong/1?longInQuery=184467440737095500000"
       11697  +
                .parse()
       11698  +
                .unwrap();
17005  11699   
            #[allow(unused_mut)]
17006  11700   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
17007  11701   
            let config = crate::service::RestJsonConfig::builder().build();
17008  11702   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
17009         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       11703  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
17010  11704   
                                let sender = sender.clone();
17011  11705   
                                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> };
       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> };
17013  11707   
                                    sender.send(()).await.expect("receiver dropped early");
17014  11708   
                                    result
17015  11709   
                                }
17016  11710   
                            })
17017  11711   
                            .build_unchecked();
17018  11712   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
17019  11713   
                .await
17020  11714   
                .expect("unable to make an HTTP request");
17021  11715   
            ::pretty_assertions::assert_eq!(
17022  11716   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
17023  11717   
                http_response.status()
17024  11718   
            );
17025  11719   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
17026  11720   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
17027  11721   
                http_response.headers(),
17028  11722   
                expected_headers,
17029  11723   
            ));
17030  11724   
        }
17031  11725   
    }
17032  11726   
    /// Underflow or overflow should result in SerializationException
17033         -
    /// Test ID: RestJsonPathIntegerUnderflowOverflow_case2
       11727  +
    /// Test ID: RestJsonQueryLongUnderflowOverflow_case2
17034  11728   
    #[::tokio::test]
17035         -
    async fn rest_json_path_integer_underflow_overflow_case2_malformed_request() {
       11729  +
    #[::tracing_test::traced_test]
       11730  +
    async fn rest_json_query_long_underflow_overflow_case2_malformed_request() {
17036  11731   
        {
17037  11732   
            #[allow(unused_mut)]
17038  11733   
            let mut http_request = http::Request::builder()
17039         -
                .uri("/MalformedInteger/123000000000000000000000")
       11734  +
                .uri("/MalformedLong/1")
17040  11735   
                .method("POST")
17041  11736   
                .body(::aws_smithy_http_server::body::Body::empty())
17042  11737   
                .unwrap();
       11738  +
            *http_request.uri_mut() = "/MalformedLong/1?longInQuery=123000000000000000000000"
       11739  +
                .parse()
       11740  +
                .unwrap();
17043  11741   
            #[allow(unused_mut)]
17044  11742   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
17045  11743   
            let config = crate::service::RestJsonConfig::builder().build();
17046  11744   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
17047         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       11745  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
17048  11746   
                                let sender = sender.clone();
17049  11747   
                                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> };
       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> };
17051  11749   
                                    sender.send(()).await.expect("receiver dropped early");
17052  11750   
                                    result
17053  11751   
                                }
17054  11752   
                            })
17055  11753   
                            .build_unchecked();
17056  11754   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
17057  11755   
                .await
17058  11756   
                .expect("unable to make an HTTP request");
17059  11757   
            ::pretty_assertions::assert_eq!(
17060  11758   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
17061  11759   
                http_response.status()
17062  11760   
            );
17063  11761   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
17064  11762   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
17065  11763   
                http_response.headers(),
17066  11764   
                expected_headers,
17067  11765   
            ));
17068  11766   
        }
17069  11767   
    }
17070  11768   
    /// Underflow or overflow should result in SerializationException
17071         -
    /// Test ID: RestJsonQueryIntegerUnderflowOverflow_case0
       11769  +
    /// Test ID: RestJsonHeaderLongUnderflowOverflow_case0
17072  11770   
    #[::tokio::test]
17073         -
    async fn rest_json_query_integer_underflow_overflow_case0_malformed_request() {
       11771  +
    #[::tracing_test::traced_test]
       11772  +
    async fn rest_json_header_long_underflow_overflow_case0_malformed_request() {
17074  11773   
        {
17075  11774   
            #[allow(unused_mut)]
17076  11775   
            let mut http_request = http::Request::builder()
17077         -
                .uri("/MalformedInteger/1")
       11776  +
                .uri("/MalformedLong/1")
17078  11777   
                .method("POST")
       11778  +
                .header("longInHeader", "-184467440737095500000")
17079  11779   
                .body(::aws_smithy_http_server::body::Body::empty())
17080  11780   
                .unwrap();
17081         -
            *http_request.uri_mut() = "/MalformedInteger/1?integerInQuery=-9223372000000000000"
17082         -
                .parse()
17083         -
                .unwrap();
17084  11781   
            #[allow(unused_mut)]
17085  11782   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
17086  11783   
            let config = crate::service::RestJsonConfig::builder().build();
17087  11784   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
17088         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       11785  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
17089  11786   
                                let sender = sender.clone();
17090  11787   
                                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> };
       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> };
17092  11789   
                                    sender.send(()).await.expect("receiver dropped early");
17093  11790   
                                    result
17094  11791   
                                }
17095  11792   
                            })
17096  11793   
                            .build_unchecked();
17097  11794   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
17098  11795   
                .await
17099  11796   
                .expect("unable to make an HTTP request");
17100  11797   
            ::pretty_assertions::assert_eq!(
17101  11798   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
17102  11799   
                http_response.status()
17103  11800   
            );
17104  11801   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
17105  11802   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
17106  11803   
                http_response.headers(),
17107  11804   
                expected_headers,
17108  11805   
            ));
17109  11806   
        }
17110  11807   
    }
17111  11808   
    /// Underflow or overflow should result in SerializationException
17112         -
    /// Test ID: RestJsonQueryIntegerUnderflowOverflow_case1
       11809  +
    /// Test ID: RestJsonHeaderLongUnderflowOverflow_case1
17113  11810   
    #[::tokio::test]
17114         -
    async fn rest_json_query_integer_underflow_overflow_case1_malformed_request() {
       11811  +
    #[::tracing_test::traced_test]
       11812  +
    async fn rest_json_header_long_underflow_overflow_case1_malformed_request() {
17115  11813   
        {
17116  11814   
            #[allow(unused_mut)]
17117  11815   
            let mut http_request = http::Request::builder()
17118         -
                .uri("/MalformedInteger/1")
       11816  +
                .uri("/MalformedLong/1")
17119  11817   
                .method("POST")
       11818  +
                .header("longInHeader", "184467440737095500000")
17120  11819   
                .body(::aws_smithy_http_server::body::Body::empty())
17121  11820   
                .unwrap();
17122         -
            *http_request.uri_mut() = "/MalformedInteger/1?integerInQuery=9223372000000000000"
17123         -
                .parse()
17124         -
                .unwrap();
17125  11821   
            #[allow(unused_mut)]
17126  11822   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
17127  11823   
            let config = crate::service::RestJsonConfig::builder().build();
17128  11824   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
17129         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       11825  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
17130  11826   
                                let sender = sender.clone();
17131  11827   
                                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> };
       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> };
17133  11829   
                                    sender.send(()).await.expect("receiver dropped early");
17134  11830   
                                    result
17135  11831   
                                }
17136  11832   
                            })
17137  11833   
                            .build_unchecked();
17138  11834   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
17139  11835   
                .await
17140  11836   
                .expect("unable to make an HTTP request");
17141  11837   
            ::pretty_assertions::assert_eq!(
17142  11838   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
17143  11839   
                http_response.status()
17144  11840   
            );
17145  11841   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
17146  11842   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
17147  11843   
                http_response.headers(),
17148  11844   
                expected_headers,
17149  11845   
            ));
17150  11846   
        }
17151  11847   
    }
17152  11848   
    /// Underflow or overflow should result in SerializationException
17153         -
    /// Test ID: RestJsonQueryIntegerUnderflowOverflow_case2
       11849  +
    /// Test ID: RestJsonHeaderLongUnderflowOverflow_case2
17154  11850   
    #[::tokio::test]
17155         -
    async fn rest_json_query_integer_underflow_overflow_case2_malformed_request() {
       11851  +
    #[::tracing_test::traced_test]
       11852  +
    async fn rest_json_header_long_underflow_overflow_case2_malformed_request() {
17156  11853   
        {
17157  11854   
            #[allow(unused_mut)]
17158  11855   
            let mut http_request = http::Request::builder()
17159         -
                .uri("/MalformedInteger/1")
       11856  +
                .uri("/MalformedLong/1")
17160  11857   
                .method("POST")
       11858  +
                .header("longInHeader", "123000000000000000000000")
17161  11859   
                .body(::aws_smithy_http_server::body::Body::empty())
17162  11860   
                .unwrap();
17163         -
            *http_request.uri_mut() = "/MalformedInteger/1?integerInQuery=123000000000000000000000"
17164         -
                .parse()
17165         -
                .unwrap();
17166  11861   
            #[allow(unused_mut)]
17167  11862   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
17168  11863   
            let config = crate::service::RestJsonConfig::builder().build();
17169  11864   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
17170         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       11865  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
17171  11866   
                                let sender = sender.clone();
17172  11867   
                                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> };
       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> };
17174  11869   
                                    sender.send(()).await.expect("receiver dropped early");
17175  11870   
                                    result
17176  11871   
                                }
17177  11872   
                            })
17178  11873   
                            .build_unchecked();
17179  11874   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
17180  11875   
                .await
17181  11876   
                .expect("unable to make an HTTP request");
17182  11877   
            ::pretty_assertions::assert_eq!(
17183  11878   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
17184  11879   
                http_response.status()
17185  11880   
            );
17186  11881   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
17187  11882   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
17188  11883   
                http_response.headers(),
17189  11884   
                expected_headers,
17190  11885   
            ));
17191  11886   
        }
17192  11887   
    }
17193         -
    /// Underflow or overflow should result in SerializationException
17194         -
    /// Test ID: RestJsonHeaderIntegerUnderflowOverflow_case0
       11888  +
    /// Malformed values in the body should be rejected
       11889  +
    /// Test ID: RestJsonBodyLongMalformedValueRejected_case0
17195  11890   
    #[::tokio::test]
17196         -
    async fn rest_json_header_integer_underflow_overflow_case0_malformed_request() {
       11891  +
    #[::tracing_test::traced_test]
       11892  +
    async fn rest_json_body_long_malformed_value_rejected_case0_malformed_request() {
17197  11893   
        {
17198  11894   
            #[allow(unused_mut)]
17199  11895   
            let mut http_request = http::Request::builder()
17200         -
                .uri("/MalformedInteger/1")
       11896  +
                .uri("/MalformedLong/1")
17201  11897   
                .method("POST")
17202         -
                .header("integerInHeader", "-9223372000000000000")
17203         -
                .body(::aws_smithy_http_server::body::Body::empty())
       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  +
                ))
17204  11902   
                .unwrap();
17205  11903   
            #[allow(unused_mut)]
17206  11904   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
17207  11905   
            let config = crate::service::RestJsonConfig::builder().build();
17208  11906   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
17209         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       11907  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
17210  11908   
                                let sender = sender.clone();
17211  11909   
                                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> };
       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> };
17213  11911   
                                    sender.send(()).await.expect("receiver dropped early");
17214  11912   
                                    result
17215  11913   
                                }
17216  11914   
                            })
17217  11915   
                            .build_unchecked();
17218  11916   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
17219  11917   
                .await
17220  11918   
                .expect("unable to make an HTTP request");
17221  11919   
            ::pretty_assertions::assert_eq!(
17222  11920   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
17223  11921   
                http_response.status()
17224  11922   
            );
17225  11923   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
17226  11924   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
17227  11925   
                http_response.headers(),
17228  11926   
                expected_headers,
17229  11927   
            ));
17230  11928   
        }
17231  11929   
    }
17232         -
    /// Underflow or overflow should result in SerializationException
17233         -
    /// Test ID: RestJsonHeaderIntegerUnderflowOverflow_case1
       11930  +
    /// Malformed values in the body should be rejected
       11931  +
    /// Test ID: RestJsonBodyLongMalformedValueRejected_case1
17234  11932   
    #[::tokio::test]
17235         -
    async fn rest_json_header_integer_underflow_overflow_case1_malformed_request() {
       11933  +
    #[::tracing_test::traced_test]
       11934  +
    async fn rest_json_body_long_malformed_value_rejected_case1_malformed_request() {
17236  11935   
        {
17237  11936   
            #[allow(unused_mut)]
17238  11937   
            let mut http_request = http::Request::builder()
17239         -
                .uri("/MalformedInteger/1")
       11938  +
                .uri("/MalformedLong/1")
17240  11939   
                .method("POST")
17241         -
                .header("integerInHeader", "9223372000000000000")
17242         -
                .body(::aws_smithy_http_server::body::Body::empty())
       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  +
                ))
17243  11944   
                .unwrap();
17244  11945   
            #[allow(unused_mut)]
17245  11946   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
17246  11947   
            let config = crate::service::RestJsonConfig::builder().build();
17247  11948   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
17248         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       11949  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
17249  11950   
                                let sender = sender.clone();
17250  11951   
                                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> };
       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> };
17252  11953   
                                    sender.send(()).await.expect("receiver dropped early");
17253  11954   
                                    result
17254  11955   
                                }
17255  11956   
                            })
17256  11957   
                            .build_unchecked();
17257  11958   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
17258  11959   
                .await
17259  11960   
                .expect("unable to make an HTTP request");
17260  11961   
            ::pretty_assertions::assert_eq!(
17261  11962   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
17262  11963   
                http_response.status()
17263  11964   
            );
17264  11965   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
17265  11966   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
17266  11967   
                http_response.headers(),
17267  11968   
                expected_headers,
17268  11969   
            ));
17269  11970   
        }
17270  11971   
    }
17271         -
    /// Underflow or overflow should result in SerializationException
17272         -
    /// Test ID: RestJsonHeaderIntegerUnderflowOverflow_case2
       11972  +
    /// Malformed values in the body should be rejected
       11973  +
    /// Test ID: RestJsonBodyLongMalformedValueRejected_case2
17273  11974   
    #[::tokio::test]
17274         -
    async fn rest_json_header_integer_underflow_overflow_case2_malformed_request() {
       11975  +
    #[::tracing_test::traced_test]
       11976  +
    async fn rest_json_body_long_malformed_value_rejected_case2_malformed_request() {
17275  11977   
        {
17276  11978   
            #[allow(unused_mut)]
17277  11979   
            let mut http_request = http::Request::builder()
17278         -
                .uri("/MalformedInteger/1")
       11980  +
                .uri("/MalformedLong/1")
17279  11981   
                .method("POST")
17280         -
                .header("integerInHeader", "123000000000000000000000")
17281         -
                .body(::aws_smithy_http_server::body::Body::empty())
       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  +
                ))
17282  11986   
                .unwrap();
17283  11987   
            #[allow(unused_mut)]
17284  11988   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
17285  11989   
            let config = crate::service::RestJsonConfig::builder().build();
17286  11990   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
17287         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       11991  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
17288  11992   
                                let sender = sender.clone();
17289  11993   
                                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> };
       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> };
17291  11995   
                                    sender.send(()).await.expect("receiver dropped early");
17292  11996   
                                    result
17293  11997   
                                }
17294  11998   
                            })
17295  11999   
                            .build_unchecked();
17296  12000   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
17297  12001   
                .await
17298  12002   
                .expect("unable to make an HTTP request");
17299  12003   
            ::pretty_assertions::assert_eq!(
17300  12004   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
17301  12005   
                http_response.status()
17302  12006   
            );
17303  12007   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
17304  12008   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
17305  12009   
                http_response.headers(),
17306  12010   
                expected_headers,
17307  12011   
            ));
17308  12012   
        }
17309  12013   
    }
17310  12014   
    /// Malformed values in the body should be rejected
17311         -
    /// Test ID: RestJsonBodyIntegerMalformedValueRejected_case0
       12015  +
    /// Test ID: RestJsonBodyLongMalformedValueRejected_case3
17312  12016   
    #[::tokio::test]
17313         -
    async fn rest_json_body_integer_malformed_value_rejected_case0_malformed_request() {
       12017  +
    #[::tracing_test::traced_test]
       12018  +
    async fn rest_json_body_long_malformed_value_rejected_case3_malformed_request() {
17314  12019   
        {
17315  12020   
            #[allow(unused_mut)]
17316  12021   
            let mut http_request = http::Request::builder()
17317         -
                .uri("/MalformedInteger/1")
       12022  +
                .uri("/MalformedLong/1")
17318  12023   
                .method("POST")
17319  12024   
                .header("content-type", "application/json")
17320  12025   
                .body(::aws_smithy_http_server::body::Body::from(
17321         -
                    ::bytes::Bytes::from_static("{ \"integerInBody\" : \"123\" }".as_bytes()),
       12026  +
                    ::bytes::Bytes::from_static("{ \"longInBody\" : 2ABC }".as_bytes()),
17322  12027   
                ))
17323  12028   
                .unwrap();
17324  12029   
            #[allow(unused_mut)]
17325  12030   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
17326  12031   
            let config = crate::service::RestJsonConfig::builder().build();
17327  12032   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
17328         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       12033  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
17329  12034   
                                let sender = sender.clone();
17330  12035   
                                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> };
       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> };
17332  12037   
                                    sender.send(()).await.expect("receiver dropped early");
17333  12038   
                                    result
17334  12039   
                                }
17335  12040   
                            })
17336  12041   
                            .build_unchecked();
17337  12042   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
17338  12043   
                .await
17339  12044   
                .expect("unable to make an HTTP request");
17340  12045   
            ::pretty_assertions::assert_eq!(
17341  12046   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
17342  12047   
                http_response.status()
17343  12048   
            );
17344  12049   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
17345  12050   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
17346  12051   
                http_response.headers(),
17347  12052   
                expected_headers,
17348  12053   
            ));
17349  12054   
        }
17350  12055   
    }
17351  12056   
    /// Malformed values in the body should be rejected
17352         -
    /// Test ID: RestJsonBodyIntegerMalformedValueRejected_case1
       12057  +
    /// Test ID: RestJsonBodyLongMalformedValueRejected_case4
17353  12058   
    #[::tokio::test]
17354         -
    async fn rest_json_body_integer_malformed_value_rejected_case1_malformed_request() {
       12059  +
    #[::tracing_test::traced_test]
       12060  +
    async fn rest_json_body_long_malformed_value_rejected_case4_malformed_request() {
17355  12061   
        {
17356  12062   
            #[allow(unused_mut)]
17357  12063   
            let mut http_request = http::Request::builder()
17358         -
                .uri("/MalformedInteger/1")
       12064  +
                .uri("/MalformedLong/1")
17359  12065   
                .method("POST")
17360  12066   
                .header("content-type", "application/json")
17361  12067   
                .body(::aws_smithy_http_server::body::Body::from(
17362         -
                    ::bytes::Bytes::from_static("{ \"integerInBody\" : true }".as_bytes()),
       12068  +
                    ::bytes::Bytes::from_static("{ \"longInBody\" : 0x42 }".as_bytes()),
17363  12069   
                ))
17364  12070   
                .unwrap();
17365  12071   
            #[allow(unused_mut)]
17366  12072   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
17367  12073   
            let config = crate::service::RestJsonConfig::builder().build();
17368  12074   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
17369         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       12075  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
17370  12076   
                                let sender = sender.clone();
17371  12077   
                                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> };
       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> };
17373  12079   
                                    sender.send(()).await.expect("receiver dropped early");
17374  12080   
                                    result
17375  12081   
                                }
17376  12082   
                            })
17377  12083   
                            .build_unchecked();
17378  12084   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
17379  12085   
                .await
17380  12086   
                .expect("unable to make an HTTP request");
17381  12087   
            ::pretty_assertions::assert_eq!(
17382  12088   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
17383  12089   
                http_response.status()
17384  12090   
            );
17385  12091   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
17386  12092   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
17387  12093   
                http_response.headers(),
17388  12094   
                expected_headers,
17389  12095   
            ));
17390  12096   
        }
17391  12097   
    }
17392  12098   
    /// Malformed values in the body should be rejected
17393         -
    /// Test ID: RestJsonBodyIntegerMalformedValueRejected_case2
       12099  +
    /// Test ID: RestJsonBodyLongMalformedValueRejected_case5
17394  12100   
    #[::tokio::test]
17395         -
    async fn rest_json_body_integer_malformed_value_rejected_case2_malformed_request() {
       12101  +
    #[::tracing_test::traced_test]
       12102  +
    async fn rest_json_body_long_malformed_value_rejected_case5_malformed_request() {
17396  12103   
        {
17397  12104   
            #[allow(unused_mut)]
17398  12105   
            let mut http_request = http::Request::builder()
17399         -
                .uri("/MalformedInteger/1")
       12106  +
                .uri("/MalformedLong/1")
17400  12107   
                .method("POST")
17401  12108   
                .header("content-type", "application/json")
17402  12109   
                .body(::aws_smithy_http_server::body::Body::from(
17403         -
                    ::bytes::Bytes::from_static("{ \"integerInBody\" : 1.001 }".as_bytes()),
       12110  +
                    ::bytes::Bytes::from_static("{ \"longInBody\" : Infinity }".as_bytes()),
17404  12111   
                ))
17405  12112   
                .unwrap();
17406  12113   
            #[allow(unused_mut)]
17407  12114   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
17408  12115   
            let config = crate::service::RestJsonConfig::builder().build();
17409  12116   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
17410         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       12117  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
17411  12118   
                                let sender = sender.clone();
17412  12119   
                                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> };
       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> };
17414  12121   
                                    sender.send(()).await.expect("receiver dropped early");
17415  12122   
                                    result
17416  12123   
                                }
17417  12124   
                            })
17418  12125   
                            .build_unchecked();
17419  12126   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
17420  12127   
                .await
17421  12128   
                .expect("unable to make an HTTP request");
17422  12129   
            ::pretty_assertions::assert_eq!(
17423  12130   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
17424  12131   
                http_response.status()
17425  12132   
            );
17426  12133   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
17427  12134   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
17428  12135   
                http_response.headers(),
17429  12136   
                expected_headers,
17430  12137   
            ));
17431  12138   
        }
17432  12139   
    }
17433  12140   
    /// Malformed values in the body should be rejected
17434         -
    /// Test ID: RestJsonBodyIntegerMalformedValueRejected_case3
       12141  +
    /// Test ID: RestJsonBodyLongMalformedValueRejected_case6
17435  12142   
    #[::tokio::test]
17436         -
    async fn rest_json_body_integer_malformed_value_rejected_case3_malformed_request() {
       12143  +
    #[::tracing_test::traced_test]
       12144  +
    async fn rest_json_body_long_malformed_value_rejected_case6_malformed_request() {
17437  12145   
        {
17438  12146   
            #[allow(unused_mut)]
17439  12147   
            let mut http_request = http::Request::builder()
17440         -
                .uri("/MalformedInteger/1")
       12148  +
                .uri("/MalformedLong/1")
17441  12149   
                .method("POST")
17442  12150   
                .header("content-type", "application/json")
17443  12151   
                .body(::aws_smithy_http_server::body::Body::from(
17444         -
                    ::bytes::Bytes::from_static("{ \"integerInBody\" : 2ABC }".as_bytes()),
       12152  +
                    ::bytes::Bytes::from_static("{ \"longInBody\" : \"Infinity\" }".as_bytes()),
17445  12153   
                ))
17446  12154   
                .unwrap();
17447  12155   
            #[allow(unused_mut)]
17448  12156   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
17449  12157   
            let config = crate::service::RestJsonConfig::builder().build();
17450  12158   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
17451         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       12159  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
17452  12160   
                                let sender = sender.clone();
17453  12161   
                                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> };
       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> };
17455  12163   
                                    sender.send(()).await.expect("receiver dropped early");
17456  12164   
                                    result
17457  12165   
                                }
17458  12166   
                            })
17459  12167   
                            .build_unchecked();
17460  12168   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
17461  12169   
                .await
17462  12170   
                .expect("unable to make an HTTP request");
17463  12171   
            ::pretty_assertions::assert_eq!(
17464  12172   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
17465  12173   
                http_response.status()
17466  12174   
            );
17467  12175   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
17468  12176   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
17469  12177   
                http_response.headers(),
17470  12178   
                expected_headers,
17471  12179   
            ));
17472  12180   
        }
17473  12181   
    }
17474  12182   
    /// Malformed values in the body should be rejected
17475         -
    /// Test ID: RestJsonBodyIntegerMalformedValueRejected_case4
       12183  +
    /// Test ID: RestJsonBodyLongMalformedValueRejected_case7
17476  12184   
    #[::tokio::test]
17477         -
    async fn rest_json_body_integer_malformed_value_rejected_case4_malformed_request() {
       12185  +
    #[::tracing_test::traced_test]
       12186  +
    async fn rest_json_body_long_malformed_value_rejected_case7_malformed_request() {
17478  12187   
        {
17479  12188   
            #[allow(unused_mut)]
17480  12189   
            let mut http_request = http::Request::builder()
17481         -
                .uri("/MalformedInteger/1")
       12190  +
                .uri("/MalformedLong/1")
17482  12191   
                .method("POST")
17483  12192   
                .header("content-type", "application/json")
17484  12193   
                .body(::aws_smithy_http_server::body::Body::from(
17485         -
                    ::bytes::Bytes::from_static("{ \"integerInBody\" : 0x42 }".as_bytes()),
       12194  +
                    ::bytes::Bytes::from_static("{ \"longInBody\" : -Infinity }".as_bytes()),
17486  12195   
                ))
17487  12196   
                .unwrap();
17488  12197   
            #[allow(unused_mut)]
17489  12198   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
17490  12199   
            let config = crate::service::RestJsonConfig::builder().build();
17491  12200   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
17492         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       12201  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
17493  12202   
                                let sender = sender.clone();
17494  12203   
                                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> };
       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> };
17496  12205   
                                    sender.send(()).await.expect("receiver dropped early");
17497  12206   
                                    result
17498  12207   
                                }
17499  12208   
                            })
17500  12209   
                            .build_unchecked();
17501  12210   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
17502  12211   
                .await
17503  12212   
                .expect("unable to make an HTTP request");
17504  12213   
            ::pretty_assertions::assert_eq!(
17505  12214   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
17506  12215   
                http_response.status()
17507  12216   
            );
17508  12217   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
17509  12218   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
17510  12219   
                http_response.headers(),
17511  12220   
                expected_headers,
17512  12221   
            ));
17513  12222   
        }
17514  12223   
    }
17515  12224   
    /// Malformed values in the body should be rejected
17516         -
    /// Test ID: RestJsonBodyIntegerMalformedValueRejected_case5
       12225  +
    /// Test ID: RestJsonBodyLongMalformedValueRejected_case8
17517  12226   
    #[::tokio::test]
17518         -
    async fn rest_json_body_integer_malformed_value_rejected_case5_malformed_request() {
       12227  +
    #[::tracing_test::traced_test]
       12228  +
    async fn rest_json_body_long_malformed_value_rejected_case8_malformed_request() {
17519  12229   
        {
17520  12230   
            #[allow(unused_mut)]
17521  12231   
            let mut http_request = http::Request::builder()
17522         -
                .uri("/MalformedInteger/1")
       12232  +
                .uri("/MalformedLong/1")
17523  12233   
                .method("POST")
17524  12234   
                .header("content-type", "application/json")
17525  12235   
                .body(::aws_smithy_http_server::body::Body::from(
17526         -
                    ::bytes::Bytes::from_static("{ \"integerInBody\" : Infinity }".as_bytes()),
       12236  +
                    ::bytes::Bytes::from_static("{ \"longInBody\" : \"-Infinity\" }".as_bytes()),
17527  12237   
                ))
17528  12238   
                .unwrap();
17529  12239   
            #[allow(unused_mut)]
17530  12240   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
17531  12241   
            let config = crate::service::RestJsonConfig::builder().build();
17532  12242   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
17533         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       12243  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
17534  12244   
                                let sender = sender.clone();
17535  12245   
                                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> };
       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> };
17537  12247   
                                    sender.send(()).await.expect("receiver dropped early");
17538  12248   
                                    result
17539  12249   
                                }
17540  12250   
                            })
17541  12251   
                            .build_unchecked();
17542  12252   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
17543  12253   
                .await
17544  12254   
                .expect("unable to make an HTTP request");
17545  12255   
            ::pretty_assertions::assert_eq!(
17546  12256   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
17547  12257   
                http_response.status()
17548  12258   
            );
17549  12259   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
17550  12260   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
17551  12261   
                http_response.headers(),
17552  12262   
                expected_headers,
17553  12263   
            ));
17554  12264   
        }
17555  12265   
    }
17556  12266   
    /// Malformed values in the body should be rejected
17557         -
    /// Test ID: RestJsonBodyIntegerMalformedValueRejected_case6
       12267  +
    /// Test ID: RestJsonBodyLongMalformedValueRejected_case9
17558  12268   
    #[::tokio::test]
17559         -
    async fn rest_json_body_integer_malformed_value_rejected_case6_malformed_request() {
       12269  +
    #[::tracing_test::traced_test]
       12270  +
    async fn rest_json_body_long_malformed_value_rejected_case9_malformed_request() {
17560  12271   
        {
17561  12272   
            #[allow(unused_mut)]
17562  12273   
            let mut http_request = http::Request::builder()
17563         -
                .uri("/MalformedInteger/1")
       12274  +
                .uri("/MalformedLong/1")
17564  12275   
                .method("POST")
17565  12276   
                .header("content-type", "application/json")
17566  12277   
                .body(::aws_smithy_http_server::body::Body::from(
17567         -
                    ::bytes::Bytes::from_static("{ \"integerInBody\" : \"Infinity\" }".as_bytes()),
       12278  +
                    ::bytes::Bytes::from_static("{ \"longInBody\" : NaN }".as_bytes()),
17568  12279   
                ))
17569  12280   
                .unwrap();
17570  12281   
            #[allow(unused_mut)]
17571  12282   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
17572  12283   
            let config = crate::service::RestJsonConfig::builder().build();
17573  12284   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
17574         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       12285  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
17575  12286   
                                let sender = sender.clone();
17576  12287   
                                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> };
       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> };
17578  12289   
                                    sender.send(()).await.expect("receiver dropped early");
17579  12290   
                                    result
17580  12291   
                                }
17581  12292   
                            })
17582  12293   
                            .build_unchecked();
17583  12294   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
17584  12295   
                .await
17585  12296   
                .expect("unable to make an HTTP request");
17586  12297   
            ::pretty_assertions::assert_eq!(
17587  12298   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
17588  12299   
                http_response.status()
17589  12300   
            );
17590  12301   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
17591  12302   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
17592  12303   
                http_response.headers(),
17593  12304   
                expected_headers,
17594  12305   
            ));
17595  12306   
        }
17596  12307   
    }
17597  12308   
    /// Malformed values in the body should be rejected
17598         -
    /// Test ID: RestJsonBodyIntegerMalformedValueRejected_case7
       12309  +
    /// Test ID: RestJsonBodyLongMalformedValueRejected_case10
17599  12310   
    #[::tokio::test]
17600         -
    async fn rest_json_body_integer_malformed_value_rejected_case7_malformed_request() {
       12311  +
    #[::tracing_test::traced_test]
       12312  +
    async fn rest_json_body_long_malformed_value_rejected_case10_malformed_request() {
17601  12313   
        {
17602  12314   
            #[allow(unused_mut)]
17603  12315   
            let mut http_request = http::Request::builder()
17604         -
                .uri("/MalformedInteger/1")
       12316  +
                .uri("/MalformedLong/1")
17605  12317   
                .method("POST")
17606  12318   
                .header("content-type", "application/json")
17607  12319   
                .body(::aws_smithy_http_server::body::Body::from(
17608         -
                    ::bytes::Bytes::from_static("{ \"integerInBody\" : -Infinity }".as_bytes()),
       12320  +
                    ::bytes::Bytes::from_static("{ \"longInBody\" : \"NaN\" }".as_bytes()),
17609  12321   
                ))
17610  12322   
                .unwrap();
17611  12323   
            #[allow(unused_mut)]
17612  12324   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
17613  12325   
            let config = crate::service::RestJsonConfig::builder().build();
17614  12326   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
17615         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       12327  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
17616  12328   
                                let sender = sender.clone();
17617  12329   
                                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> };
       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> };
17619  12331   
                                    sender.send(()).await.expect("receiver dropped early");
17620  12332   
                                    result
17621  12333   
                                }
17622  12334   
                            })
17623  12335   
                            .build_unchecked();
17624  12336   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
17625  12337   
                .await
17626  12338   
                .expect("unable to make an HTTP request");
17627  12339   
            ::pretty_assertions::assert_eq!(
17628  12340   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
17629  12341   
                http_response.status()
17630  12342   
            );
17631  12343   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
17632  12344   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
17633  12345   
                http_response.headers(),
17634  12346   
                expected_headers,
17635  12347   
            ));
17636  12348   
        }
17637  12349   
    }
17638         -
    /// Malformed values in the body should be rejected
17639         -
    /// Test ID: RestJsonBodyIntegerMalformedValueRejected_case8
       12350  +
    /// Malformed values in the path should be rejected
       12351  +
    /// Test ID: RestJsonPathLongMalformedValueRejected_case0
17640  12352   
    #[::tokio::test]
17641         -
    async fn rest_json_body_integer_malformed_value_rejected_case8_malformed_request() {
       12353  +
    #[::tracing_test::traced_test]
       12354  +
    async fn rest_json_path_long_malformed_value_rejected_case0_malformed_request() {
17642  12355   
        {
17643  12356   
            #[allow(unused_mut)]
17644  12357   
            let mut http_request = http::Request::builder()
17645         -
                .uri("/MalformedInteger/1")
       12358  +
                .uri("/MalformedLong/true")
17646  12359   
                .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         -
                ))
       12360  +
                .body(::aws_smithy_http_server::body::Body::empty())
17651  12361   
                .unwrap();
17652  12362   
            #[allow(unused_mut)]
17653  12363   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
17654  12364   
            let config = crate::service::RestJsonConfig::builder().build();
17655  12365   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
17656         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       12366  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
17657  12367   
                                let sender = sender.clone();
17658  12368   
                                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> };
       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> };
17660  12370   
                                    sender.send(()).await.expect("receiver dropped early");
17661  12371   
                                    result
17662  12372   
                                }
17663  12373   
                            })
17664  12374   
                            .build_unchecked();
17665  12375   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
17666  12376   
                .await
17667  12377   
                .expect("unable to make an HTTP request");
17668  12378   
            ::pretty_assertions::assert_eq!(
17669  12379   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
17670  12380   
                http_response.status()
17671  12381   
            );
17672  12382   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
17673  12383   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
17674  12384   
                http_response.headers(),
17675  12385   
                expected_headers,
17676  12386   
            ));
17677  12387   
        }
17678  12388   
    }
17679         -
    /// Malformed values in the body should be rejected
17680         -
    /// Test ID: RestJsonBodyIntegerMalformedValueRejected_case9
       12389  +
    /// Malformed values in the path should be rejected
       12390  +
    /// Test ID: RestJsonPathLongMalformedValueRejected_case1
17681  12391   
    #[::tokio::test]
17682         -
    async fn rest_json_body_integer_malformed_value_rejected_case9_malformed_request() {
       12392  +
    #[::tracing_test::traced_test]
       12393  +
    async fn rest_json_path_long_malformed_value_rejected_case1_malformed_request() {
17683  12394   
        {
17684  12395   
            #[allow(unused_mut)]
17685  12396   
            let mut http_request = http::Request::builder()
17686         -
                .uri("/MalformedInteger/1")
       12397  +
                .uri("/MalformedLong/1.001")
17687  12398   
                .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         -
                ))
       12399  +
                .body(::aws_smithy_http_server::body::Body::empty())
17692  12400   
                .unwrap();
17693  12401   
            #[allow(unused_mut)]
17694  12402   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
17695  12403   
            let config = crate::service::RestJsonConfig::builder().build();
17696  12404   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
17697         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       12405  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
17698  12406   
                                let sender = sender.clone();
17699  12407   
                                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> };
       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> };
17701  12409   
                                    sender.send(()).await.expect("receiver dropped early");
17702  12410   
                                    result
17703  12411   
                                }
17704  12412   
                            })
17705  12413   
                            .build_unchecked();
17706  12414   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
17707  12415   
                .await
17708  12416   
                .expect("unable to make an HTTP request");
17709  12417   
            ::pretty_assertions::assert_eq!(
17710  12418   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
17711  12419   
                http_response.status()
17712  12420   
            );
17713  12421   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
17714  12422   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
17715  12423   
                http_response.headers(),
17716  12424   
                expected_headers,
17717  12425   
            ));
17718  12426   
        }
17719  12427   
    }
17720         -
    /// Malformed values in the body should be rejected
17721         -
    /// Test ID: RestJsonBodyIntegerMalformedValueRejected_case10
       12428  +
    /// Malformed values in the path should be rejected
       12429  +
    /// Test ID: RestJsonPathLongMalformedValueRejected_case2
17722  12430   
    #[::tokio::test]
17723         -
    async fn rest_json_body_integer_malformed_value_rejected_case10_malformed_request() {
       12431  +
    #[::tracing_test::traced_test]
       12432  +
    async fn rest_json_path_long_malformed_value_rejected_case2_malformed_request() {
17724  12433   
        {
17725  12434   
            #[allow(unused_mut)]
17726  12435   
            let mut http_request = http::Request::builder()
17727         -
                .uri("/MalformedInteger/1")
       12436  +
                .uri("/MalformedLong/2ABC")
17728  12437   
                .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         -
                ))
       12438  +
                .body(::aws_smithy_http_server::body::Body::empty())
17733  12439   
                .unwrap();
17734  12440   
            #[allow(unused_mut)]
17735  12441   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
17736  12442   
            let config = crate::service::RestJsonConfig::builder().build();
17737  12443   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
17738         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       12444  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
17739  12445   
                                let sender = sender.clone();
17740  12446   
                                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> };
       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> };
17742  12448   
                                    sender.send(()).await.expect("receiver dropped early");
17743  12449   
                                    result
17744  12450   
                                }
17745  12451   
                            })
17746  12452   
                            .build_unchecked();
17747  12453   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
17748  12454   
                .await
17749  12455   
                .expect("unable to make an HTTP request");
17750  12456   
            ::pretty_assertions::assert_eq!(
17751  12457   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
17752  12458   
                http_response.status()
17753  12459   
            );
17754  12460   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
17755  12461   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
17756  12462   
                http_response.headers(),
17757  12463   
                expected_headers,
17758  12464   
            ));
17759  12465   
        }
17760  12466   
    }
17761  12467   
    /// Malformed values in the path should be rejected
17762         -
    /// Test ID: RestJsonPathIntegerMalformedValueRejected_case0
       12468  +
    /// Test ID: RestJsonPathLongMalformedValueRejected_case3
17763  12469   
    #[::tokio::test]
17764         -
    async fn rest_json_path_integer_malformed_value_rejected_case0_malformed_request() {
       12470  +
    #[::tracing_test::traced_test]
       12471  +
    async fn rest_json_path_long_malformed_value_rejected_case3_malformed_request() {
17765  12472   
        {
17766  12473   
            #[allow(unused_mut)]
17767  12474   
            let mut http_request = http::Request::builder()
17768         -
                .uri("/MalformedInteger/true")
       12475  +
                .uri("/MalformedLong/0x42")
17769  12476   
                .method("POST")
17770  12477   
                .body(::aws_smithy_http_server::body::Body::empty())
17771  12478   
                .unwrap();
17772  12479   
            #[allow(unused_mut)]
17773  12480   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
17774  12481   
            let config = crate::service::RestJsonConfig::builder().build();
17775  12482   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
17776         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       12483  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
17777  12484   
                                let sender = sender.clone();
17778  12485   
                                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> };
       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> };
17780  12487   
                                    sender.send(()).await.expect("receiver dropped early");
17781  12488   
                                    result
17782  12489   
                                }
17783  12490   
                            })
17784  12491   
                            .build_unchecked();
17785  12492   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
17786  12493   
                .await
17787  12494   
                .expect("unable to make an HTTP request");
17788  12495   
            ::pretty_assertions::assert_eq!(
17789  12496   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
17790  12497   
                http_response.status()
17791  12498   
            );
17792  12499   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
17793  12500   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
17794  12501   
                http_response.headers(),
17795  12502   
                expected_headers,
17796  12503   
            ));
17797  12504   
        }
17798  12505   
    }
17799  12506   
    /// Malformed values in the path should be rejected
17800         -
    /// Test ID: RestJsonPathIntegerMalformedValueRejected_case1
       12507  +
    /// Test ID: RestJsonPathLongMalformedValueRejected_case4
17801  12508   
    #[::tokio::test]
17802         -
    async fn rest_json_path_integer_malformed_value_rejected_case1_malformed_request() {
       12509  +
    #[::tracing_test::traced_test]
       12510  +
    async fn rest_json_path_long_malformed_value_rejected_case4_malformed_request() {
17803  12511   
        {
17804  12512   
            #[allow(unused_mut)]
17805  12513   
            let mut http_request = http::Request::builder()
17806         -
                .uri("/MalformedInteger/1.001")
       12514  +
                .uri("/MalformedLong/Infinity")
17807  12515   
                .method("POST")
17808  12516   
                .body(::aws_smithy_http_server::body::Body::empty())
17809  12517   
                .unwrap();
17810  12518   
            #[allow(unused_mut)]
17811  12519   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
17812  12520   
            let config = crate::service::RestJsonConfig::builder().build();
17813  12521   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
17814         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       12522  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
17815  12523   
                                let sender = sender.clone();
17816  12524   
                                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> };
       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> };
17818  12526   
                                    sender.send(()).await.expect("receiver dropped early");
17819  12527   
                                    result
17820  12528   
                                }
17821  12529   
                            })
17822  12530   
                            .build_unchecked();
17823  12531   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
17824  12532   
                .await
17825  12533   
                .expect("unable to make an HTTP request");
17826  12534   
            ::pretty_assertions::assert_eq!(
17827  12535   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
17828  12536   
                http_response.status()
17829  12537   
            );
17830  12538   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
17831  12539   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
17832  12540   
                http_response.headers(),
17833  12541   
                expected_headers,
17834  12542   
            ));
17835  12543   
        }
17836  12544   
    }
17837  12545   
    /// Malformed values in the path should be rejected
17838         -
    /// Test ID: RestJsonPathIntegerMalformedValueRejected_case2
       12546  +
    /// Test ID: RestJsonPathLongMalformedValueRejected_case5
17839  12547   
    #[::tokio::test]
17840         -
    async fn rest_json_path_integer_malformed_value_rejected_case2_malformed_request() {
       12548  +
    #[::tracing_test::traced_test]
       12549  +
    async fn rest_json_path_long_malformed_value_rejected_case5_malformed_request() {
17841  12550   
        {
17842  12551   
            #[allow(unused_mut)]
17843  12552   
            let mut http_request = http::Request::builder()
17844         -
                .uri("/MalformedInteger/2ABC")
       12553  +
                .uri("/MalformedLong/-Infinity")
17845  12554   
                .method("POST")
17846  12555   
                .body(::aws_smithy_http_server::body::Body::empty())
17847  12556   
                .unwrap();
17848  12557   
            #[allow(unused_mut)]
17849  12558   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
17850  12559   
            let config = crate::service::RestJsonConfig::builder().build();
17851  12560   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
17852         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       12561  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
17853  12562   
                                let sender = sender.clone();
17854  12563   
                                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> };
       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> };
17856  12565   
                                    sender.send(()).await.expect("receiver dropped early");
17857  12566   
                                    result
17858  12567   
                                }
17859  12568   
                            })
17860  12569   
                            .build_unchecked();
17861  12570   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
17862  12571   
                .await
17863  12572   
                .expect("unable to make an HTTP request");
17864  12573   
            ::pretty_assertions::assert_eq!(
17865  12574   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
17866  12575   
                http_response.status()
17867  12576   
            );
17868  12577   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
17869  12578   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
17870  12579   
                http_response.headers(),
17871  12580   
                expected_headers,
17872  12581   
            ));
17873  12582   
        }
17874  12583   
    }
17875  12584   
    /// Malformed values in the path should be rejected
17876         -
    /// Test ID: RestJsonPathIntegerMalformedValueRejected_case3
       12585  +
    /// Test ID: RestJsonPathLongMalformedValueRejected_case6
17877  12586   
    #[::tokio::test]
17878         -
    async fn rest_json_path_integer_malformed_value_rejected_case3_malformed_request() {
       12587  +
    #[::tracing_test::traced_test]
       12588  +
    async fn rest_json_path_long_malformed_value_rejected_case6_malformed_request() {
17879  12589   
        {
17880  12590   
            #[allow(unused_mut)]
17881  12591   
            let mut http_request = http::Request::builder()
17882         -
                .uri("/MalformedInteger/0x42")
       12592  +
                .uri("/MalformedLong/NaN")
17883  12593   
                .method("POST")
17884  12594   
                .body(::aws_smithy_http_server::body::Body::empty())
17885  12595   
                .unwrap();
17886  12596   
            #[allow(unused_mut)]
17887  12597   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
17888  12598   
            let config = crate::service::RestJsonConfig::builder().build();
17889  12599   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
17890         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       12600  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
17891  12601   
                                let sender = sender.clone();
17892  12602   
                                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> };
       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> };
17894  12604   
                                    sender.send(()).await.expect("receiver dropped early");
17895  12605   
                                    result
17896  12606   
                                }
17897  12607   
                            })
17898  12608   
                            .build_unchecked();
17899  12609   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
17900  12610   
                .await
17901  12611   
                .expect("unable to make an HTTP request");
17902  12612   
            ::pretty_assertions::assert_eq!(
17903  12613   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
17904  12614   
                http_response.status()
17905  12615   
            );
17906  12616   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
17907  12617   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
17908  12618   
                http_response.headers(),
17909  12619   
                expected_headers,
17910  12620   
            ));
17911  12621   
        }
17912  12622   
    }
17913         -
    /// Malformed values in the path should be rejected
17914         -
    /// Test ID: RestJsonPathIntegerMalformedValueRejected_case4
       12623  +
    /// Malformed values in query parameters should be rejected
       12624  +
    /// Test ID: RestJsonQueryLongMalformedValueRejected_case0
17915  12625   
    #[::tokio::test]
17916         -
    async fn rest_json_path_integer_malformed_value_rejected_case4_malformed_request() {
       12626  +
    #[::tracing_test::traced_test]
       12627  +
    async fn rest_json_query_long_malformed_value_rejected_case0_malformed_request() {
17917  12628   
        {
17918  12629   
            #[allow(unused_mut)]
17919  12630   
            let mut http_request = http::Request::builder()
17920         -
                .uri("/MalformedInteger/Infinity")
       12631  +
                .uri("/MalformedLong/1")
17921  12632   
                .method("POST")
17922  12633   
                .body(::aws_smithy_http_server::body::Body::empty())
17923  12634   
                .unwrap();
       12635  +
            *http_request.uri_mut() = "/MalformedLong/1?longInQuery=true".parse().unwrap();
17924  12636   
            #[allow(unused_mut)]
17925  12637   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
17926  12638   
            let config = crate::service::RestJsonConfig::builder().build();
17927  12639   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
17928         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       12640  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
17929  12641   
                                let sender = sender.clone();
17930  12642   
                                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> };
       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> };
17932  12644   
                                    sender.send(()).await.expect("receiver dropped early");
17933  12645   
                                    result
17934  12646   
                                }
17935  12647   
                            })
17936  12648   
                            .build_unchecked();
17937  12649   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
17938  12650   
                .await
17939  12651   
                .expect("unable to make an HTTP request");
17940  12652   
            ::pretty_assertions::assert_eq!(
17941  12653   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
17942  12654   
                http_response.status()
17943  12655   
            );
17944  12656   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
17945  12657   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
17946  12658   
                http_response.headers(),
17947  12659   
                expected_headers,
17948  12660   
            ));
17949  12661   
        }
17950  12662   
    }
17951         -
    /// Malformed values in the path should be rejected
17952         -
    /// Test ID: RestJsonPathIntegerMalformedValueRejected_case5
       12663  +
    /// Malformed values in query parameters should be rejected
       12664  +
    /// Test ID: RestJsonQueryLongMalformedValueRejected_case1
17953  12665   
    #[::tokio::test]
17954         -
    async fn rest_json_path_integer_malformed_value_rejected_case5_malformed_request() {
       12666  +
    #[::tracing_test::traced_test]
       12667  +
    async fn rest_json_query_long_malformed_value_rejected_case1_malformed_request() {
17955  12668   
        {
17956  12669   
            #[allow(unused_mut)]
17957  12670   
            let mut http_request = http::Request::builder()
17958         -
                .uri("/MalformedInteger/-Infinity")
       12671  +
                .uri("/MalformedLong/1")
17959  12672   
                .method("POST")
17960  12673   
                .body(::aws_smithy_http_server::body::Body::empty())
17961  12674   
                .unwrap();
       12675  +
            *http_request.uri_mut() = "/MalformedLong/1?longInQuery=1.001".parse().unwrap();
17962  12676   
            #[allow(unused_mut)]
17963  12677   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
17964  12678   
            let config = crate::service::RestJsonConfig::builder().build();
17965  12679   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
17966         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       12680  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
17967  12681   
                                let sender = sender.clone();
17968  12682   
                                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> };
       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> };
17970  12684   
                                    sender.send(()).await.expect("receiver dropped early");
17971  12685   
                                    result
17972  12686   
                                }
17973  12687   
                            })
17974  12688   
                            .build_unchecked();
17975  12689   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
17976  12690   
                .await
17977  12691   
                .expect("unable to make an HTTP request");
17978  12692   
            ::pretty_assertions::assert_eq!(
17979  12693   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
17980  12694   
                http_response.status()
17981  12695   
            );
17982  12696   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
17983  12697   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
17984  12698   
                http_response.headers(),
17985  12699   
                expected_headers,
17986  12700   
            ));
17987  12701   
        }
17988  12702   
    }
17989         -
    /// Malformed values in the path should be rejected
17990         -
    /// Test ID: RestJsonPathIntegerMalformedValueRejected_case6
       12703  +
    /// Malformed values in query parameters should be rejected
       12704  +
    /// Test ID: RestJsonQueryLongMalformedValueRejected_case2
17991  12705   
    #[::tokio::test]
17992         -
    async fn rest_json_path_integer_malformed_value_rejected_case6_malformed_request() {
       12706  +
    #[::tracing_test::traced_test]
       12707  +
    async fn rest_json_query_long_malformed_value_rejected_case2_malformed_request() {
17993  12708   
        {
17994  12709   
            #[allow(unused_mut)]
17995  12710   
            let mut http_request = http::Request::builder()
17996         -
                .uri("/MalformedInteger/NaN")
       12711  +
                .uri("/MalformedLong/1")
17997  12712   
                .method("POST")
17998  12713   
                .body(::aws_smithy_http_server::body::Body::empty())
17999  12714   
                .unwrap();
       12715  +
            *http_request.uri_mut() = "/MalformedLong/1?longInQuery=2ABC".parse().unwrap();
18000  12716   
            #[allow(unused_mut)]
18001  12717   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
18002  12718   
            let config = crate::service::RestJsonConfig::builder().build();
18003  12719   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
18004         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       12720  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
18005  12721   
                                let sender = sender.clone();
18006  12722   
                                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> };
       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> };
18008  12724   
                                    sender.send(()).await.expect("receiver dropped early");
18009  12725   
                                    result
18010  12726   
                                }
18011  12727   
                            })
18012  12728   
                            .build_unchecked();
18013  12729   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
18014  12730   
                .await
18015  12731   
                .expect("unable to make an HTTP request");
18016  12732   
            ::pretty_assertions::assert_eq!(
18017  12733   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
18018  12734   
                http_response.status()
18019  12735   
            );
18020  12736   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
18021  12737   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
18022  12738   
                http_response.headers(),
18023  12739   
                expected_headers,
18024  12740   
            ));
18025  12741   
        }
18026  12742   
    }
18027  12743   
    /// Malformed values in query parameters should be rejected
18028         -
    /// Test ID: RestJsonQueryIntegerMalformedValueRejected_case0
       12744  +
    /// Test ID: RestJsonQueryLongMalformedValueRejected_case3
18029  12745   
    #[::tokio::test]
18030         -
    async fn rest_json_query_integer_malformed_value_rejected_case0_malformed_request() {
       12746  +
    #[::tracing_test::traced_test]
       12747  +
    async fn rest_json_query_long_malformed_value_rejected_case3_malformed_request() {
18031  12748   
        {
18032  12749   
            #[allow(unused_mut)]
18033  12750   
            let mut http_request = http::Request::builder()
18034         -
                .uri("/MalformedInteger/1")
       12751  +
                .uri("/MalformedLong/1")
18035  12752   
                .method("POST")
18036  12753   
                .body(::aws_smithy_http_server::body::Body::empty())
18037  12754   
                .unwrap();
18038         -
            *http_request.uri_mut() = "/MalformedInteger/1?integerInQuery=true".parse().unwrap();
       12755  +
            *http_request.uri_mut() = "/MalformedLong/1?longInQuery=0x42".parse().unwrap();
18039  12756   
            #[allow(unused_mut)]
18040  12757   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
18041  12758   
            let config = crate::service::RestJsonConfig::builder().build();
18042  12759   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
18043         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       12760  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
18044  12761   
                                let sender = sender.clone();
18045  12762   
                                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> };
       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> };
18047  12764   
                                    sender.send(()).await.expect("receiver dropped early");
18048  12765   
                                    result
18049  12766   
                                }
18050  12767   
                            })
18051  12768   
                            .build_unchecked();
18052  12769   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
18053  12770   
                .await
18054  12771   
                .expect("unable to make an HTTP request");
18055  12772   
            ::pretty_assertions::assert_eq!(
18056  12773   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
18057  12774   
                http_response.status()
18058  12775   
            );
18059  12776   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
18060  12777   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
18061  12778   
                http_response.headers(),
18062  12779   
                expected_headers,
18063  12780   
            ));
18064  12781   
        }
18065  12782   
    }
18066  12783   
    /// Malformed values in query parameters should be rejected
18067         -
    /// Test ID: RestJsonQueryIntegerMalformedValueRejected_case1
       12784  +
    /// Test ID: RestJsonQueryLongMalformedValueRejected_case4
18068  12785   
    #[::tokio::test]
18069         -
    async fn rest_json_query_integer_malformed_value_rejected_case1_malformed_request() {
       12786  +
    #[::tracing_test::traced_test]
       12787  +
    async fn rest_json_query_long_malformed_value_rejected_case4_malformed_request() {
18070  12788   
        {
18071  12789   
            #[allow(unused_mut)]
18072  12790   
            let mut http_request = http::Request::builder()
18073         -
                .uri("/MalformedInteger/1")
       12791  +
                .uri("/MalformedLong/1")
18074  12792   
                .method("POST")
18075  12793   
                .body(::aws_smithy_http_server::body::Body::empty())
18076  12794   
                .unwrap();
18077         -
            *http_request.uri_mut() = "/MalformedInteger/1?integerInQuery=1.001".parse().unwrap();
       12795  +
            *http_request.uri_mut() = "/MalformedLong/1?longInQuery=Infinity".parse().unwrap();
18078  12796   
            #[allow(unused_mut)]
18079  12797   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
18080  12798   
            let config = crate::service::RestJsonConfig::builder().build();
18081  12799   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
18082         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       12800  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
18083  12801   
                                let sender = sender.clone();
18084  12802   
                                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> };
       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> };
18086  12804   
                                    sender.send(()).await.expect("receiver dropped early");
18087  12805   
                                    result
18088  12806   
                                }
18089  12807   
                            })
18090  12808   
                            .build_unchecked();
18091  12809   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
18092  12810   
                .await
18093  12811   
                .expect("unable to make an HTTP request");
18094  12812   
            ::pretty_assertions::assert_eq!(
18095  12813   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
18096  12814   
                http_response.status()
18097  12815   
            );
18098  12816   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
18099  12817   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
18100  12818   
                http_response.headers(),
18101  12819   
                expected_headers,
18102  12820   
            ));
18103  12821   
        }
18104  12822   
    }
18105  12823   
    /// Malformed values in query parameters should be rejected
18106         -
    /// Test ID: RestJsonQueryIntegerMalformedValueRejected_case2
       12824  +
    /// Test ID: RestJsonQueryLongMalformedValueRejected_case5
18107  12825   
    #[::tokio::test]
18108         -
    async fn rest_json_query_integer_malformed_value_rejected_case2_malformed_request() {
       12826  +
    #[::tracing_test::traced_test]
       12827  +
    async fn rest_json_query_long_malformed_value_rejected_case5_malformed_request() {
18109  12828   
        {
18110  12829   
            #[allow(unused_mut)]
18111  12830   
            let mut http_request = http::Request::builder()
18112         -
                .uri("/MalformedInteger/1")
       12831  +
                .uri("/MalformedLong/1")
18113  12832   
                .method("POST")
18114  12833   
                .body(::aws_smithy_http_server::body::Body::empty())
18115  12834   
                .unwrap();
18116         -
            *http_request.uri_mut() = "/MalformedInteger/1?integerInQuery=2ABC".parse().unwrap();
       12835  +
            *http_request.uri_mut() = "/MalformedLong/1?longInQuery=-Infinity".parse().unwrap();
18117  12836   
            #[allow(unused_mut)]
18118  12837   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
18119  12838   
            let config = crate::service::RestJsonConfig::builder().build();
18120  12839   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
18121         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       12840  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
18122  12841   
                                let sender = sender.clone();
18123  12842   
                                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> };
       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> };
18125  12844   
                                    sender.send(()).await.expect("receiver dropped early");
18126  12845   
                                    result
18127  12846   
                                }
18128  12847   
                            })
18129  12848   
                            .build_unchecked();
18130  12849   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
18131  12850   
                .await
18132  12851   
                .expect("unable to make an HTTP request");
18133  12852   
            ::pretty_assertions::assert_eq!(
18134  12853   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
18135  12854   
                http_response.status()
18136  12855   
            );
18137  12856   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
18138  12857   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
18139  12858   
                http_response.headers(),
18140  12859   
                expected_headers,
18141  12860   
            ));
18142  12861   
        }
18143  12862   
    }
18144  12863   
    /// Malformed values in query parameters should be rejected
18145         -
    /// Test ID: RestJsonQueryIntegerMalformedValueRejected_case3
       12864  +
    /// Test ID: RestJsonQueryLongMalformedValueRejected_case6
18146  12865   
    #[::tokio::test]
18147         -
    async fn rest_json_query_integer_malformed_value_rejected_case3_malformed_request() {
       12866  +
    #[::tracing_test::traced_test]
       12867  +
    async fn rest_json_query_long_malformed_value_rejected_case6_malformed_request() {
18148  12868   
        {
18149  12869   
            #[allow(unused_mut)]
18150  12870   
            let mut http_request = http::Request::builder()
18151         -
                .uri("/MalformedInteger/1")
       12871  +
                .uri("/MalformedLong/1")
18152  12872   
                .method("POST")
18153  12873   
                .body(::aws_smithy_http_server::body::Body::empty())
18154  12874   
                .unwrap();
18155         -
            *http_request.uri_mut() = "/MalformedInteger/1?integerInQuery=0x42".parse().unwrap();
       12875  +
            *http_request.uri_mut() = "/MalformedLong/1?longInQuery=NaN".parse().unwrap();
18156  12876   
            #[allow(unused_mut)]
18157  12877   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
18158  12878   
            let config = crate::service::RestJsonConfig::builder().build();
18159  12879   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
18160         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       12880  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
18161  12881   
                                let sender = sender.clone();
18162  12882   
                                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> };
       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> };
18164  12884   
                                    sender.send(()).await.expect("receiver dropped early");
18165  12885   
                                    result
18166  12886   
                                }
18167  12887   
                            })
18168  12888   
                            .build_unchecked();
18169  12889   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
18170  12890   
                .await
18171  12891   
                .expect("unable to make an HTTP request");
18172  12892   
            ::pretty_assertions::assert_eq!(
18173  12893   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
18174  12894   
                http_response.status()
18175  12895   
            );
18176  12896   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
18177  12897   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
18178  12898   
                http_response.headers(),
18179  12899   
                expected_headers,
18180  12900   
            ));
18181  12901   
        }
18182  12902   
    }
18183         -
    /// Malformed values in query parameters should be rejected
18184         -
    /// Test ID: RestJsonQueryIntegerMalformedValueRejected_case4
       12903  +
    /// Malformed values in headers should be rejected
       12904  +
    /// Test ID: RestJsonHeaderLongMalformedValueRejected_case0
18185  12905   
    #[::tokio::test]
18186         -
    async fn rest_json_query_integer_malformed_value_rejected_case4_malformed_request() {
       12906  +
    #[::tracing_test::traced_test]
       12907  +
    async fn rest_json_header_long_malformed_value_rejected_case0_malformed_request() {
18187  12908   
        {
18188  12909   
            #[allow(unused_mut)]
18189  12910   
            let mut http_request = http::Request::builder()
18190         -
                .uri("/MalformedInteger/1")
       12911  +
                .uri("/MalformedLong/1")
18191  12912   
                .method("POST")
       12913  +
                .header("longInHeader", "true")
18192  12914   
                .body(::aws_smithy_http_server::body::Body::empty())
18193  12915   
                .unwrap();
18194         -
            *http_request.uri_mut() = "/MalformedInteger/1?integerInQuery=Infinity"
18195         -
                .parse()
18196         -
                .unwrap();
18197  12916   
            #[allow(unused_mut)]
18198  12917   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
18199  12918   
            let config = crate::service::RestJsonConfig::builder().build();
18200  12919   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
18201         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       12920  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
18202  12921   
                                let sender = sender.clone();
18203  12922   
                                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> };
       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> };
18205  12924   
                                    sender.send(()).await.expect("receiver dropped early");
18206  12925   
                                    result
18207  12926   
                                }
18208  12927   
                            })
18209  12928   
                            .build_unchecked();
18210  12929   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
18211  12930   
                .await
18212  12931   
                .expect("unable to make an HTTP request");
18213  12932   
            ::pretty_assertions::assert_eq!(
18214  12933   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
18215  12934   
                http_response.status()
18216  12935   
            );
18217  12936   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
18218  12937   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
18219  12938   
                http_response.headers(),
18220  12939   
                expected_headers,
18221  12940   
            ));
18222  12941   
        }
18223  12942   
    }
18224         -
    /// Malformed values in query parameters should be rejected
18225         -
    /// Test ID: RestJsonQueryIntegerMalformedValueRejected_case5
       12943  +
    /// Malformed values in headers should be rejected
       12944  +
    /// Test ID: RestJsonHeaderLongMalformedValueRejected_case1
18226  12945   
    #[::tokio::test]
18227         -
    async fn rest_json_query_integer_malformed_value_rejected_case5_malformed_request() {
       12946  +
    #[::tracing_test::traced_test]
       12947  +
    async fn rest_json_header_long_malformed_value_rejected_case1_malformed_request() {
18228  12948   
        {
18229  12949   
            #[allow(unused_mut)]
18230  12950   
            let mut http_request = http::Request::builder()
18231         -
                .uri("/MalformedInteger/1")
       12951  +
                .uri("/MalformedLong/1")
18232  12952   
                .method("POST")
       12953  +
                .header("longInHeader", "1.001")
18233  12954   
                .body(::aws_smithy_http_server::body::Body::empty())
18234  12955   
                .unwrap();
18235         -
            *http_request.uri_mut() = "/MalformedInteger/1?integerInQuery=-Infinity"
18236         -
                .parse()
18237         -
                .unwrap();
18238  12956   
            #[allow(unused_mut)]
18239  12957   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
18240  12958   
            let config = crate::service::RestJsonConfig::builder().build();
18241  12959   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
18242         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       12960  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
18243  12961   
                                let sender = sender.clone();
18244  12962   
                                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> };
       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> };
18246  12964   
                                    sender.send(()).await.expect("receiver dropped early");
18247  12965   
                                    result
18248  12966   
                                }
18249  12967   
                            })
18250  12968   
                            .build_unchecked();
18251  12969   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
18252  12970   
                .await
18253  12971   
                .expect("unable to make an HTTP request");
18254  12972   
            ::pretty_assertions::assert_eq!(
18255  12973   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
18256  12974   
                http_response.status()
18257  12975   
            );
18258  12976   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
18259  12977   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
18260  12978   
                http_response.headers(),
18261  12979   
                expected_headers,
18262  12980   
            ));
18263  12981   
        }
18264  12982   
    }
18265         -
    /// Malformed values in query parameters should be rejected
18266         -
    /// Test ID: RestJsonQueryIntegerMalformedValueRejected_case6
       12983  +
    /// Malformed values in headers should be rejected
       12984  +
    /// Test ID: RestJsonHeaderLongMalformedValueRejected_case2
18267  12985   
    #[::tokio::test]
18268         -
    async fn rest_json_query_integer_malformed_value_rejected_case6_malformed_request() {
       12986  +
    #[::tracing_test::traced_test]
       12987  +
    async fn rest_json_header_long_malformed_value_rejected_case2_malformed_request() {
18269  12988   
        {
18270  12989   
            #[allow(unused_mut)]
18271  12990   
            let mut http_request = http::Request::builder()
18272         -
                .uri("/MalformedInteger/1")
       12991  +
                .uri("/MalformedLong/1")
18273  12992   
                .method("POST")
       12993  +
                .header("longInHeader", "2ABC")
18274  12994   
                .body(::aws_smithy_http_server::body::Body::empty())
18275  12995   
                .unwrap();
18276         -
            *http_request.uri_mut() = "/MalformedInteger/1?integerInQuery=NaN".parse().unwrap();
18277  12996   
            #[allow(unused_mut)]
18278  12997   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
18279  12998   
            let config = crate::service::RestJsonConfig::builder().build();
18280  12999   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
18281         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       13000  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
18282  13001   
                                let sender = sender.clone();
18283  13002   
                                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> };
       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> };
18285  13004   
                                    sender.send(()).await.expect("receiver dropped early");
18286  13005   
                                    result
18287  13006   
                                }
18288  13007   
                            })
18289  13008   
                            .build_unchecked();
18290  13009   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
18291  13010   
                .await
18292  13011   
                .expect("unable to make an HTTP request");
18293  13012   
            ::pretty_assertions::assert_eq!(
18294  13013   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
18295  13014   
                http_response.status()
18296  13015   
            );
18297  13016   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
18298  13017   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
18299  13018   
                http_response.headers(),
18300  13019   
                expected_headers,
18301  13020   
            ));
18302  13021   
        }
18303  13022   
    }
18304  13023   
    /// Malformed values in headers should be rejected
18305         -
    /// Test ID: RestJsonHeaderIntegerMalformedValueRejected_case0
       13024  +
    /// Test ID: RestJsonHeaderLongMalformedValueRejected_case3
18306  13025   
    #[::tokio::test]
18307         -
    async fn rest_json_header_integer_malformed_value_rejected_case0_malformed_request() {
       13026  +
    #[::tracing_test::traced_test]
       13027  +
    async fn rest_json_header_long_malformed_value_rejected_case3_malformed_request() {
18308  13028   
        {
18309  13029   
            #[allow(unused_mut)]
18310  13030   
            let mut http_request = http::Request::builder()
18311         -
                .uri("/MalformedInteger/1")
       13031  +
                .uri("/MalformedLong/1")
18312  13032   
                .method("POST")
18313         -
                .header("integerInHeader", "true")
       13033  +
                .header("longInHeader", "0x42")
18314  13034   
                .body(::aws_smithy_http_server::body::Body::empty())
18315  13035   
                .unwrap();
18316  13036   
            #[allow(unused_mut)]
18317  13037   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
18318  13038   
            let config = crate::service::RestJsonConfig::builder().build();
18319  13039   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
18320         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       13040  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
18321  13041   
                                let sender = sender.clone();
18322  13042   
                                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> };
       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> };
18324  13044   
                                    sender.send(()).await.expect("receiver dropped early");
18325  13045   
                                    result
18326  13046   
                                }
18327  13047   
                            })
18328  13048   
                            .build_unchecked();
18329  13049   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
18330  13050   
                .await
18331  13051   
                .expect("unable to make an HTTP request");
18332  13052   
            ::pretty_assertions::assert_eq!(
18333  13053   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
18334  13054   
                http_response.status()
18335  13055   
            );
18336  13056   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
18337  13057   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
18338  13058   
                http_response.headers(),
18339  13059   
                expected_headers,
18340  13060   
            ));
18341  13061   
        }
18342  13062   
    }
18343  13063   
    /// Malformed values in headers should be rejected
18344         -
    /// Test ID: RestJsonHeaderIntegerMalformedValueRejected_case1
       13064  +
    /// Test ID: RestJsonHeaderLongMalformedValueRejected_case4
18345  13065   
    #[::tokio::test]
18346         -
    async fn rest_json_header_integer_malformed_value_rejected_case1_malformed_request() {
       13066  +
    #[::tracing_test::traced_test]
       13067  +
    async fn rest_json_header_long_malformed_value_rejected_case4_malformed_request() {
18347  13068   
        {
18348  13069   
            #[allow(unused_mut)]
18349  13070   
            let mut http_request = http::Request::builder()
18350         -
                .uri("/MalformedInteger/1")
       13071  +
                .uri("/MalformedLong/1")
18351  13072   
                .method("POST")
18352         -
                .header("integerInHeader", "1.001")
       13073  +
                .header("longInHeader", "Infinity")
18353  13074   
                .body(::aws_smithy_http_server::body::Body::empty())
18354  13075   
                .unwrap();
18355  13076   
            #[allow(unused_mut)]
18356  13077   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
18357  13078   
            let config = crate::service::RestJsonConfig::builder().build();
18358  13079   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
18359         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       13080  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
18360  13081   
                                let sender = sender.clone();
18361  13082   
                                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> };
       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> };
18363  13084   
                                    sender.send(()).await.expect("receiver dropped early");
18364  13085   
                                    result
18365  13086   
                                }
18366  13087   
                            })
18367  13088   
                            .build_unchecked();
18368  13089   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
18369  13090   
                .await
18370  13091   
                .expect("unable to make an HTTP request");
18371  13092   
            ::pretty_assertions::assert_eq!(
18372  13093   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
18373  13094   
                http_response.status()
18374  13095   
            );
18375  13096   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
18376  13097   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
18377  13098   
                http_response.headers(),
18378  13099   
                expected_headers,
18379  13100   
            ));
18380  13101   
        }
18381  13102   
    }
18382  13103   
    /// Malformed values in headers should be rejected
18383         -
    /// Test ID: RestJsonHeaderIntegerMalformedValueRejected_case2
       13104  +
    /// Test ID: RestJsonHeaderLongMalformedValueRejected_case5
18384  13105   
    #[::tokio::test]
18385         -
    async fn rest_json_header_integer_malformed_value_rejected_case2_malformed_request() {
       13106  +
    #[::tracing_test::traced_test]
       13107  +
    async fn rest_json_header_long_malformed_value_rejected_case5_malformed_request() {
18386  13108   
        {
18387  13109   
            #[allow(unused_mut)]
18388  13110   
            let mut http_request = http::Request::builder()
18389         -
                .uri("/MalformedInteger/1")
       13111  +
                .uri("/MalformedLong/1")
18390  13112   
                .method("POST")
18391         -
                .header("integerInHeader", "2ABC")
       13113  +
                .header("longInHeader", "-Infinity")
18392  13114   
                .body(::aws_smithy_http_server::body::Body::empty())
18393  13115   
                .unwrap();
18394  13116   
            #[allow(unused_mut)]
18395  13117   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
18396  13118   
            let config = crate::service::RestJsonConfig::builder().build();
18397  13119   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
18398         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       13120  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
18399  13121   
                                let sender = sender.clone();
18400  13122   
                                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> };
       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> };
18402  13124   
                                    sender.send(()).await.expect("receiver dropped early");
18403  13125   
                                    result
18404  13126   
                                }
18405  13127   
                            })
18406  13128   
                            .build_unchecked();
18407  13129   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
18408  13130   
                .await
18409  13131   
                .expect("unable to make an HTTP request");
18410  13132   
            ::pretty_assertions::assert_eq!(
18411  13133   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
18412  13134   
                http_response.status()
18413  13135   
            );
18414  13136   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
18415  13137   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
18416  13138   
                http_response.headers(),
18417  13139   
                expected_headers,
18418  13140   
            ));
18419  13141   
        }
18420  13142   
    }
18421  13143   
    /// Malformed values in headers should be rejected
18422         -
    /// Test ID: RestJsonHeaderIntegerMalformedValueRejected_case3
       13144  +
    /// Test ID: RestJsonHeaderLongMalformedValueRejected_case6
18423  13145   
    #[::tokio::test]
18424         -
    async fn rest_json_header_integer_malformed_value_rejected_case3_malformed_request() {
       13146  +
    #[::tracing_test::traced_test]
       13147  +
    async fn rest_json_header_long_malformed_value_rejected_case6_malformed_request() {
18425  13148   
        {
18426  13149   
            #[allow(unused_mut)]
18427  13150   
            let mut http_request = http::Request::builder()
18428         -
                .uri("/MalformedInteger/1")
       13151  +
                .uri("/MalformedLong/1")
18429  13152   
                .method("POST")
18430         -
                .header("integerInHeader", "0x42")
       13153  +
                .header("longInHeader", "NaN")
18431  13154   
                .body(::aws_smithy_http_server::body::Body::empty())
18432  13155   
                .unwrap();
18433  13156   
            #[allow(unused_mut)]
18434  13157   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
18435  13158   
            let config = crate::service::RestJsonConfig::builder().build();
18436  13159   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
18437         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       13160  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
18438  13161   
                                let sender = sender.clone();
18439  13162   
                                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> };
       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> };
18441  13164   
                                    sender.send(()).await.expect("receiver dropped early");
18442  13165   
                                    result
18443  13166   
                                }
18444  13167   
                            })
18445  13168   
                            .build_unchecked();
18446  13169   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
18447  13170   
                .await
18448  13171   
                .expect("unable to make an HTTP request");
18449  13172   
            ::pretty_assertions::assert_eq!(
18450  13173   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
18451  13174   
                http_response.status()
18452  13175   
            );
18453  13176   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
18454  13177   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
18455  13178   
                http_response.headers(),
18456  13179   
                expected_headers,
18457  13180   
            ));
18458  13181   
        }
18459  13182   
    }
18460         -
    /// Malformed values in headers should be rejected
18461         -
    /// Test ID: RestJsonHeaderIntegerMalformedValueRejected_case4
       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
18462  13294   
    #[::tokio::test]
18463         -
    async fn rest_json_header_integer_malformed_value_rejected_case4_malformed_request() {
       13295  +
    #[::tracing_test::traced_test]
       13296  +
    async fn rest_json_body_short_underflow_overflow_case0_malformed_request() {
18464  13297   
        {
18465  13298   
            #[allow(unused_mut)]
18466  13299   
            let mut http_request = http::Request::builder()
18467         -
                .uri("/MalformedInteger/1")
       13300  +
                .uri("/MalformedShort/1")
18468  13301   
                .method("POST")
18469         -
                .header("integerInHeader", "Infinity")
18470         -
                .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  +
                ))
18471  13306   
                .unwrap();
18472  13307   
            #[allow(unused_mut)]
18473  13308   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
18474  13309   
            let config = crate::service::RestJsonConfig::builder().build();
18475  13310   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
18476         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       13311  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
18477  13312   
                                let sender = sender.clone();
18478  13313   
                                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> };
       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> };
18480  13315   
                                    sender.send(()).await.expect("receiver dropped early");
18481  13316   
                                    result
18482  13317   
                                }
18483  13318   
                            })
18484  13319   
                            .build_unchecked();
18485  13320   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
18486  13321   
                .await
18487  13322   
                .expect("unable to make an HTTP request");
18488  13323   
            ::pretty_assertions::assert_eq!(
18489  13324   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
18490  13325   
                http_response.status()
18491  13326   
            );
18492  13327   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
18493  13328   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
18494  13329   
                http_response.headers(),
18495  13330   
                expected_headers,
18496  13331   
            ));
18497  13332   
        }
18498  13333   
    }
18499         -
    /// Malformed values in headers should be rejected
18500         -
    /// Test ID: RestJsonHeaderIntegerMalformedValueRejected_case5
       13334  +
    /// Underflow or overflow should result in SerializationException
       13335  +
    /// Test ID: RestJsonBodyShortUnderflowOverflow_case1
18501  13336   
    #[::tokio::test]
18502         -
    async fn rest_json_header_integer_malformed_value_rejected_case5_malformed_request() {
       13337  +
    #[::tracing_test::traced_test]
       13338  +
    async fn rest_json_body_short_underflow_overflow_case1_malformed_request() {
18503  13339   
        {
18504  13340   
            #[allow(unused_mut)]
18505  13341   
            let mut http_request = http::Request::builder()
18506         -
                .uri("/MalformedInteger/1")
       13342  +
                .uri("/MalformedShort/1")
18507  13343   
                .method("POST")
18508         -
                .header("integerInHeader", "-Infinity")
18509         -
                .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  +
                ))
18510  13348   
                .unwrap();
18511  13349   
            #[allow(unused_mut)]
18512  13350   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
18513  13351   
            let config = crate::service::RestJsonConfig::builder().build();
18514  13352   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
18515         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       13353  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
18516  13354   
                                let sender = sender.clone();
18517  13355   
                                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> };
       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> };
18519  13357   
                                    sender.send(()).await.expect("receiver dropped early");
18520  13358   
                                    result
18521  13359   
                                }
18522  13360   
                            })
18523  13361   
                            .build_unchecked();
18524  13362   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
18525  13363   
                .await
18526  13364   
                .expect("unable to make an HTTP request");
18527  13365   
            ::pretty_assertions::assert_eq!(
18528  13366   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
18529  13367   
                http_response.status()
18530  13368   
            );
18531  13369   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
18532  13370   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
18533  13371   
                http_response.headers(),
18534  13372   
                expected_headers,
18535  13373   
            ));
18536  13374   
        }
18537  13375   
    }
18538         -
    /// Malformed values in headers should be rejected
18539         -
    /// Test ID: RestJsonHeaderIntegerMalformedValueRejected_case6
       13376  +
    /// Underflow or overflow should result in SerializationException
       13377  +
    /// Test ID: RestJsonBodyShortUnderflowOverflow_case2
18540  13378   
    #[::tokio::test]
18541         -
    async fn rest_json_header_integer_malformed_value_rejected_case6_malformed_request() {
       13379  +
    #[::tracing_test::traced_test]
       13380  +
    async fn rest_json_body_short_underflow_overflow_case2_malformed_request() {
18542  13381   
        {
18543  13382   
            #[allow(unused_mut)]
18544  13383   
            let mut http_request = http::Request::builder()
18545         -
                .uri("/MalformedInteger/1")
       13384  +
                .uri("/MalformedShort/1")
18546  13385   
                .method("POST")
18547         -
                .header("integerInHeader", "NaN")
18548         -
                .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  +
                ))
18549  13392   
                .unwrap();
18550  13393   
            #[allow(unused_mut)]
18551  13394   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
18552  13395   
            let config = crate::service::RestJsonConfig::builder().build();
18553  13396   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
18554         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       13397  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
18555  13398   
                                let sender = sender.clone();
18556  13399   
                                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> };
       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> };
18558  13401   
                                    sender.send(()).await.expect("receiver dropped early");
18559  13402   
                                    result
18560  13403   
                                }
18561  13404   
                            })
18562  13405   
                            .build_unchecked();
18563  13406   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
18564  13407   
                .await
18565  13408   
                .expect("unable to make an HTTP request");
18566  13409   
            ::pretty_assertions::assert_eq!(
18567  13410   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
18568  13411   
                http_response.status()
18569  13412   
            );
18570  13413   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
18571  13414   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
18572  13415   
                http_response.headers(),
18573  13416   
                expected_headers,
18574  13417   
            ));
18575  13418   
        }
18576  13419   
    }
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
       13420  +
    /// Underflow or overflow should result in SerializationException
       13421  +
    /// Test ID: RestJsonBodyShortUnderflowOverflow_case3
18584  13422   
    #[::tokio::test]
18585         -
    async fn rest_json_body_malformed_list_null_item_malformed_request() {
       13423  +
    #[::tracing_test::traced_test]
       13424  +
    async fn rest_json_body_short_underflow_overflow_case3_malformed_request() {
18586  13425   
        {
18587  13426   
            #[allow(unused_mut)]
18588  13427   
            let mut http_request = http::Request::builder()
18589         -
                .uri("/MalformedList")
       13428  +
                .uri("/MalformedShort/1")
18590  13429   
                .method("POST")
18591  13430   
                .header("content-type", "application/json")
18592  13431   
                .body(::aws_smithy_http_server::body::Body::from(
18593  13432   
                    ::bytes::Bytes::from_static(
18594         -
                        "{ \"bodyList\" : [\"a\", null, \"b\", \"c\"] }".as_bytes(),
       13433  +
                        "{ \"shortInBody\" : 9223372000000000000 }".as_bytes(),
18595  13434   
                    ),
18596  13435   
                ))
18597  13436   
                .unwrap();
18598  13437   
            #[allow(unused_mut)]
18599  13438   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
18600  13439   
            let config = crate::service::RestJsonConfig::builder().build();
18601  13440   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
18602         -
                            .malformed_list(move |input: crate::input::MalformedListInput| {
       13441  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
18603  13442   
                                let sender = sender.clone();
18604  13443   
                                async move {
18605         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedListOutput };
       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> };
18606  13445   
                                    sender.send(()).await.expect("receiver dropped early");
18607  13446   
                                    result
18608  13447   
                                }
18609  13448   
                            })
18610  13449   
                            .build_unchecked();
18611  13450   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
18612  13451   
                .await
18613  13452   
                .expect("unable to make an HTTP request");
18614  13453   
            ::pretty_assertions::assert_eq!(
18615  13454   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
18616  13455   
                http_response.status()
18617  13456   
            );
18618  13457   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
18619  13458   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
18620  13459   
                http_response.headers(),
18621  13460   
                expected_headers,
18622  13461   
            ));
18623  13462   
        }
18624  13463   
    }
18625         -
    /// When a list does not have a closing bracket, the response should be
18626         -
    /// a 400 SerializationException.
18627         -
    /// Test ID: RestJsonBodyMalformedListUnclosed
       13464  +
    /// Underflow or overflow should result in SerializationException
       13465  +
    /// Test ID: RestJsonBodyShortUnderflowOverflow_case4
18628  13466   
    #[::tokio::test]
18629         -
    async fn rest_json_body_malformed_list_unclosed_malformed_request() {
       13467  +
    #[::tracing_test::traced_test]
       13468  +
    async fn rest_json_body_short_underflow_overflow_case4_malformed_request() {
18630  13469   
        {
18631  13470   
            #[allow(unused_mut)]
18632  13471   
            let mut http_request = http::Request::builder()
18633         -
                .uri("/MalformedList")
       13472  +
                .uri("/MalformedShort/1")
18634  13473   
                .method("POST")
18635  13474   
                .header("content-type", "application/json")
18636  13475   
                .body(::aws_smithy_http_server::body::Body::from(
18637  13476   
                    ::bytes::Bytes::from_static(
18638         -
                        "{ \"bodyList\" : [\"a\", \"b\", \"c\" }".as_bytes(),
       13477  +
                        "{ \"shortInBody\" : 123000000000000000000000 }".as_bytes(),
18639  13478   
                    ),
18640  13479   
                ))
18641  13480   
                .unwrap();
18642  13481   
            #[allow(unused_mut)]
18643  13482   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
18644  13483   
            let config = crate::service::RestJsonConfig::builder().build();
18645  13484   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
18646         -
                            .malformed_list(move |input: crate::input::MalformedListInput| {
       13485  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
18647  13486   
                                let sender = sender.clone();
18648  13487   
                                async move {
18649         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedListOutput };
       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> };
18650  13489   
                                    sender.send(()).await.expect("receiver dropped early");
18651  13490   
                                    result
18652  13491   
                                }
18653  13492   
                            })
18654  13493   
                            .build_unchecked();
18655  13494   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
18656  13495   
                .await
18657  13496   
                .expect("unable to make an HTTP request");
18658  13497   
            ::pretty_assertions::assert_eq!(
18659  13498   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
18660  13499   
                http_response.status()
18661  13500   
            );
18662  13501   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
18663  13502   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
18664  13503   
                http_response.headers(),
18665  13504   
                expected_headers,
18666  13505   
            ));
18667  13506   
        }
18668  13507   
    }
18669         -
}
18670         -
#[cfg(test)]
18671         -
#[allow(unreachable_code, unused_variables)]
18672         -
mod server_malformed_long_test {
18673  13508   
    /// Underflow or overflow should result in SerializationException
18674         -
    /// Test ID: RestJsonBodyLongUnderflowOverflow_case0
       13509  +
    /// Test ID: RestJsonPathShortUnderflowOverflow_case0
18675  13510   
    #[::tokio::test]
18676         -
    async fn rest_json_body_long_underflow_overflow_case0_malformed_request() {
       13511  +
    #[::tracing_test::traced_test]
       13512  +
    async fn rest_json_path_short_underflow_overflow_case0_malformed_request() {
18677  13513   
        {
18678  13514   
            #[allow(unused_mut)]
18679  13515   
            let mut http_request = http::Request::builder()
18680         -
                .uri("/MalformedLong/1")
       13516  +
                .uri("/MalformedShort/40000")
18681  13517   
                .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         -
                ))
       13518  +
                .body(::aws_smithy_http_server::body::Body::empty())
18688  13519   
                .unwrap();
18689  13520   
            #[allow(unused_mut)]
18690  13521   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
18691  13522   
            let config = crate::service::RestJsonConfig::builder().build();
18692  13523   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
18693         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       13524  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
18694  13525   
                                let sender = sender.clone();
18695  13526   
                                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> };
       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> };
18697  13528   
                                    sender.send(()).await.expect("receiver dropped early");
18698  13529   
                                    result
18699  13530   
                                }
18700  13531   
                            })
18701  13532   
                            .build_unchecked();
18702  13533   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
18703  13534   
                .await
18704  13535   
                .expect("unable to make an HTTP request");
18705  13536   
            ::pretty_assertions::assert_eq!(
18706  13537   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
18707  13538   
                http_response.status()
18708  13539   
            );
18709  13540   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
18710  13541   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
18711  13542   
                http_response.headers(),
18712  13543   
                expected_headers,
18713  13544   
            ));
18714  13545   
        }
18715  13546   
    }
18716  13547   
    /// Underflow or overflow should result in SerializationException
18717         -
    /// Test ID: RestJsonBodyLongUnderflowOverflow_case1
       13548  +
    /// Test ID: RestJsonPathShortUnderflowOverflow_case1
18718  13549   
    #[::tokio::test]
18719         -
    async fn rest_json_body_long_underflow_overflow_case1_malformed_request() {
       13550  +
    #[::tracing_test::traced_test]
       13551  +
    async fn rest_json_path_short_underflow_overflow_case1_malformed_request() {
18720  13552   
        {
18721  13553   
            #[allow(unused_mut)]
18722  13554   
            let mut http_request = http::Request::builder()
18723         -
                .uri("/MalformedLong/1")
       13555  +
                .uri("/MalformedShort/-40000")
18724  13556   
                .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         -
                ))
       13557  +
                .body(::aws_smithy_http_server::body::Body::empty())
18731  13558   
                .unwrap();
18732  13559   
            #[allow(unused_mut)]
18733  13560   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
18734  13561   
            let config = crate::service::RestJsonConfig::builder().build();
18735  13562   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
18736         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       13563  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
18737  13564   
                                let sender = sender.clone();
18738  13565   
                                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> };
       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> };
18740  13567   
                                    sender.send(()).await.expect("receiver dropped early");
18741  13568   
                                    result
18742  13569   
                                }
18743  13570   
                            })
18744  13571   
                            .build_unchecked();
18745  13572   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
18746  13573   
                .await
18747  13574   
                .expect("unable to make an HTTP request");
18748  13575   
            ::pretty_assertions::assert_eq!(
18749  13576   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
18750  13577   
                http_response.status()
18751  13578   
            );
18752  13579   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
18753  13580   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
18754  13581   
                http_response.headers(),
18755  13582   
                expected_headers,
18756  13583   
            ));
18757  13584   
        }
18758  13585   
    }
18759  13586   
    /// Underflow or overflow should result in SerializationException
18760         -
    /// Test ID: RestJsonBodyLongUnderflowOverflow_case2
       13587  +
    /// Test ID: RestJsonPathShortUnderflowOverflow_case2
18761  13588   
    #[::tokio::test]
18762         -
    async fn rest_json_body_long_underflow_overflow_case2_malformed_request() {
       13589  +
    #[::tracing_test::traced_test]
       13590  +
    async fn rest_json_path_short_underflow_overflow_case2_malformed_request() {
18763  13591   
        {
18764  13592   
            #[allow(unused_mut)]
18765  13593   
            let mut http_request = http::Request::builder()
18766         -
                .uri("/MalformedLong/1")
       13594  +
                .uri("/MalformedShort/-9223372000000000000")
18767  13595   
                .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         -
                ))
       13596  +
                .body(::aws_smithy_http_server::body::Body::empty())
18774  13597   
                .unwrap();
18775  13598   
            #[allow(unused_mut)]
18776  13599   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
18777  13600   
            let config = crate::service::RestJsonConfig::builder().build();
18778  13601   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
18779         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       13602  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
18780  13603   
                                let sender = sender.clone();
18781  13604   
                                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> };
       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> };
18783  13606   
                                    sender.send(()).await.expect("receiver dropped early");
18784  13607   
                                    result
18785  13608   
                                }
18786  13609   
                            })
18787  13610   
                            .build_unchecked();
18788  13611   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
18789  13612   
                .await
18790  13613   
                .expect("unable to make an HTTP request");
18791  13614   
            ::pretty_assertions::assert_eq!(
18792  13615   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
18793  13616   
                http_response.status()
18794  13617   
            );
18795  13618   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
18796  13619   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
18797  13620   
                http_response.headers(),
18798  13621   
                expected_headers,
18799  13622   
            ));
18800  13623   
        }
18801  13624   
    }
18802  13625   
    /// Underflow or overflow should result in SerializationException
18803         -
    /// Test ID: RestJsonPathLongUnderflowOverflow_case0
       13626  +
    /// Test ID: RestJsonPathShortUnderflowOverflow_case3
18804  13627   
    #[::tokio::test]
18805         -
    async fn rest_json_path_long_underflow_overflow_case0_malformed_request() {
       13628  +
    #[::tracing_test::traced_test]
       13629  +
    async fn rest_json_path_short_underflow_overflow_case3_malformed_request() {
18806  13630   
        {
18807  13631   
            #[allow(unused_mut)]
18808  13632   
            let mut http_request = http::Request::builder()
18809         -
                .uri("/MalformedLong/-184467440737095500000")
       13633  +
                .uri("/MalformedShort/9223372000000000000")
18810  13634   
                .method("POST")
18811  13635   
                .body(::aws_smithy_http_server::body::Body::empty())
18812  13636   
                .unwrap();
18813  13637   
            #[allow(unused_mut)]
18814  13638   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
18815  13639   
            let config = crate::service::RestJsonConfig::builder().build();
18816  13640   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
18817         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       13641  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
18818  13642   
                                let sender = sender.clone();
18819  13643   
                                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> };
       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> };
18821  13645   
                                    sender.send(()).await.expect("receiver dropped early");
18822  13646   
                                    result
18823  13647   
                                }
18824  13648   
                            })
18825  13649   
                            .build_unchecked();
18826  13650   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
18827  13651   
                .await
18828  13652   
                .expect("unable to make an HTTP request");
18829  13653   
            ::pretty_assertions::assert_eq!(
18830  13654   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
18831  13655   
                http_response.status()
18832  13656   
            );
18833  13657   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
18834  13658   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
18835  13659   
                http_response.headers(),
18836  13660   
                expected_headers,
18837  13661   
            ));
18838  13662   
        }
18839  13663   
    }
18840  13664   
    /// Underflow or overflow should result in SerializationException
18841         -
    /// Test ID: RestJsonPathLongUnderflowOverflow_case1
       13665  +
    /// Test ID: RestJsonPathShortUnderflowOverflow_case4
18842  13666   
    #[::tokio::test]
18843         -
    async fn rest_json_path_long_underflow_overflow_case1_malformed_request() {
       13667  +
    #[::tracing_test::traced_test]
       13668  +
    async fn rest_json_path_short_underflow_overflow_case4_malformed_request() {
18844  13669   
        {
18845  13670   
            #[allow(unused_mut)]
18846  13671   
            let mut http_request = http::Request::builder()
18847         -
                .uri("/MalformedLong/184467440737095500000")
       13672  +
                .uri("/MalformedShort/123000000000000000000000")
18848  13673   
                .method("POST")
18849  13674   
                .body(::aws_smithy_http_server::body::Body::empty())
18850  13675   
                .unwrap();
18851  13676   
            #[allow(unused_mut)]
18852  13677   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
18853  13678   
            let config = crate::service::RestJsonConfig::builder().build();
18854  13679   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
18855         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       13680  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
18856  13681   
                                let sender = sender.clone();
18857  13682   
                                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> };
       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> };
18859  13684   
                                    sender.send(()).await.expect("receiver dropped early");
18860  13685   
                                    result
18861  13686   
                                }
18862  13687   
                            })
18863  13688   
                            .build_unchecked();
18864  13689   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
18865  13690   
                .await
18866  13691   
                .expect("unable to make an HTTP request");
18867  13692   
            ::pretty_assertions::assert_eq!(
18868  13693   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
18869  13694   
                http_response.status()
18870  13695   
            );
18871  13696   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
18872  13697   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
18873  13698   
                http_response.headers(),
18874  13699   
                expected_headers,
18875  13700   
            ));
18876  13701   
        }
18877  13702   
    }
18878  13703   
    /// Underflow or overflow should result in SerializationException
18879         -
    /// Test ID: RestJsonPathLongUnderflowOverflow_case2
       13704  +
    /// Test ID: RestJsonQueryShortUnderflowOverflow_case0
18880  13705   
    #[::tokio::test]
18881         -
    async fn rest_json_path_long_underflow_overflow_case2_malformed_request() {
       13706  +
    #[::tracing_test::traced_test]
       13707  +
    async fn rest_json_query_short_underflow_overflow_case0_malformed_request() {
18882  13708   
        {
18883  13709   
            #[allow(unused_mut)]
18884  13710   
            let mut http_request = http::Request::builder()
18885         -
                .uri("/MalformedLong/123000000000000000000000")
       13711  +
                .uri("/MalformedShort/1")
18886  13712   
                .method("POST")
18887  13713   
                .body(::aws_smithy_http_server::body::Body::empty())
18888  13714   
                .unwrap();
       13715  +
            *http_request.uri_mut() = "/MalformedShort/1?shortInQuery=40000".parse().unwrap();
18889  13716   
            #[allow(unused_mut)]
18890  13717   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
18891  13718   
            let config = crate::service::RestJsonConfig::builder().build();
18892  13719   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
18893         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       13720  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
18894  13721   
                                let sender = sender.clone();
18895  13722   
                                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> };
       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> };
18897  13724   
                                    sender.send(()).await.expect("receiver dropped early");
18898  13725   
                                    result
18899  13726   
                                }
18900  13727   
                            })
18901  13728   
                            .build_unchecked();
18902  13729   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
18903  13730   
                .await
18904  13731   
                .expect("unable to make an HTTP request");
18905  13732   
            ::pretty_assertions::assert_eq!(
18906  13733   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
18907  13734   
                http_response.status()
18908  13735   
            );
18909  13736   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
18910  13737   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
18911  13738   
                http_response.headers(),
18912  13739   
                expected_headers,
18913  13740   
            ));
18914  13741   
        }
18915  13742   
    }
18916  13743   
    /// Underflow or overflow should result in SerializationException
18917         -
    /// Test ID: RestJsonQueryLongUnderflowOverflow_case0
       13744  +
    /// Test ID: RestJsonQueryShortUnderflowOverflow_case1
18918  13745   
    #[::tokio::test]
18919         -
    async fn rest_json_query_long_underflow_overflow_case0_malformed_request() {
       13746  +
    #[::tracing_test::traced_test]
       13747  +
    async fn rest_json_query_short_underflow_overflow_case1_malformed_request() {
18920  13748   
        {
18921  13749   
            #[allow(unused_mut)]
18922  13750   
            let mut http_request = http::Request::builder()
18923         -
                .uri("/MalformedLong/1")
       13751  +
                .uri("/MalformedShort/1")
18924  13752   
                .method("POST")
18925  13753   
                .body(::aws_smithy_http_server::body::Body::empty())
18926  13754   
                .unwrap();
18927         -
            *http_request.uri_mut() = "/MalformedLong/1?longInQuery=-184467440737095500000"
18928         -
                .parse()
18929         -
                .unwrap();
       13755  +
            *http_request.uri_mut() = "/MalformedShort/1?shortInQuery=-40000".parse().unwrap();
18930  13756   
            #[allow(unused_mut)]
18931  13757   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
18932  13758   
            let config = crate::service::RestJsonConfig::builder().build();
18933  13759   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
18934         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       13760  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
18935  13761   
                                let sender = sender.clone();
18936  13762   
                                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> };
       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> };
18938  13764   
                                    sender.send(()).await.expect("receiver dropped early");
18939  13765   
                                    result
18940  13766   
                                }
18941  13767   
                            })
18942  13768   
                            .build_unchecked();
18943  13769   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
18944  13770   
                .await
18945  13771   
                .expect("unable to make an HTTP request");
18946  13772   
            ::pretty_assertions::assert_eq!(
18947  13773   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
18948  13774   
                http_response.status()
18949  13775   
            );
18950  13776   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
18951  13777   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
18952  13778   
                http_response.headers(),
18953  13779   
                expected_headers,
18954  13780   
            ));
18955  13781   
        }
18956  13782   
    }
18957  13783   
    /// Underflow or overflow should result in SerializationException
18958         -
    /// Test ID: RestJsonQueryLongUnderflowOverflow_case1
       13784  +
    /// Test ID: RestJsonQueryShortUnderflowOverflow_case2
18959  13785   
    #[::tokio::test]
18960         -
    async fn rest_json_query_long_underflow_overflow_case1_malformed_request() {
       13786  +
    #[::tracing_test::traced_test]
       13787  +
    async fn rest_json_query_short_underflow_overflow_case2_malformed_request() {
18961  13788   
        {
18962  13789   
            #[allow(unused_mut)]
18963  13790   
            let mut http_request = http::Request::builder()
18964         -
                .uri("/MalformedLong/1")
       13791  +
                .uri("/MalformedShort/1")
18965  13792   
                .method("POST")
18966  13793   
                .body(::aws_smithy_http_server::body::Body::empty())
18967  13794   
                .unwrap();
18968         -
            *http_request.uri_mut() = "/MalformedLong/1?longInQuery=184467440737095500000"
       13795  +
            *http_request.uri_mut() = "/MalformedShort/1?shortInQuery=-9223372000000000000"
18969  13796   
                .parse()
18970  13797   
                .unwrap();
18971  13798   
            #[allow(unused_mut)]
18972  13799   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
18973  13800   
            let config = crate::service::RestJsonConfig::builder().build();
18974  13801   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
18975         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       13802  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
18976  13803   
                                let sender = sender.clone();
18977  13804   
                                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> };
       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> };
18979  13806   
                                    sender.send(()).await.expect("receiver dropped early");
18980  13807   
                                    result
18981  13808   
                                }
18982  13809   
                            })
18983  13810   
                            .build_unchecked();
18984  13811   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
18985  13812   
                .await
18986  13813   
                .expect("unable to make an HTTP request");
18987  13814   
            ::pretty_assertions::assert_eq!(
18988  13815   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
18989  13816   
                http_response.status()
18990  13817   
            );
18991  13818   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
18992  13819   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
18993  13820   
                http_response.headers(),
18994  13821   
                expected_headers,
18995  13822   
            ));
18996  13823   
        }
18997  13824   
    }
18998  13825   
    /// Underflow or overflow should result in SerializationException
18999         -
    /// Test ID: RestJsonQueryLongUnderflowOverflow_case2
       13826  +
    /// Test ID: RestJsonQueryShortUnderflowOverflow_case3
19000  13827   
    #[::tokio::test]
19001         -
    async fn rest_json_query_long_underflow_overflow_case2_malformed_request() {
       13828  +
    #[::tracing_test::traced_test]
       13829  +
    async fn rest_json_query_short_underflow_overflow_case3_malformed_request() {
19002  13830   
        {
19003  13831   
            #[allow(unused_mut)]
19004  13832   
            let mut http_request = http::Request::builder()
19005         -
                .uri("/MalformedLong/1")
       13833  +
                .uri("/MalformedShort/1")
19006  13834   
                .method("POST")
19007  13835   
                .body(::aws_smithy_http_server::body::Body::empty())
19008  13836   
                .unwrap();
19009         -
            *http_request.uri_mut() = "/MalformedLong/1?longInQuery=123000000000000000000000"
       13837  +
            *http_request.uri_mut() = "/MalformedShort/1?shortInQuery=9223372000000000000"
19010  13838   
                .parse()
19011  13839   
                .unwrap();
19012  13840   
            #[allow(unused_mut)]
19013  13841   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
19014  13842   
            let config = crate::service::RestJsonConfig::builder().build();
19015  13843   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
19016         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       13844  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
19017  13845   
                                let sender = sender.clone();
19018  13846   
                                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> };
       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> };
19020  13848   
                                    sender.send(()).await.expect("receiver dropped early");
19021  13849   
                                    result
19022  13850   
                                }
19023  13851   
                            })
19024  13852   
                            .build_unchecked();
19025  13853   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
19026  13854   
                .await
19027  13855   
                .expect("unable to make an HTTP request");
19028  13856   
            ::pretty_assertions::assert_eq!(
19029  13857   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
19030  13858   
                http_response.status()
19031  13859   
            );
19032  13860   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
19033  13861   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
19034  13862   
                http_response.headers(),
19035  13863   
                expected_headers,
19036  13864   
            ));
19037  13865   
        }
19038  13866   
    }
19039  13867   
    /// Underflow or overflow should result in SerializationException
19040         -
    /// Test ID: RestJsonHeaderLongUnderflowOverflow_case0
       13868  +
    /// Test ID: RestJsonQueryShortUnderflowOverflow_case4
19041  13869   
    #[::tokio::test]
19042         -
    async fn rest_json_header_long_underflow_overflow_case0_malformed_request() {
       13870  +
    #[::tracing_test::traced_test]
       13871  +
    async fn rest_json_query_short_underflow_overflow_case4_malformed_request() {
19043  13872   
        {
19044  13873   
            #[allow(unused_mut)]
19045  13874   
            let mut http_request = http::Request::builder()
19046         -
                .uri("/MalformedLong/1")
       13875  +
                .uri("/MalformedShort/1")
19047  13876   
                .method("POST")
19048         -
                .header("longInHeader", "-184467440737095500000")
19049  13877   
                .body(::aws_smithy_http_server::body::Body::empty())
19050  13878   
                .unwrap();
       13879  +
            *http_request.uri_mut() = "/MalformedShort/1?shortInQuery=123000000000000000000000"
       13880  +
                .parse()
       13881  +
                .unwrap();
19051  13882   
            #[allow(unused_mut)]
19052  13883   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
19053  13884   
            let config = crate::service::RestJsonConfig::builder().build();
19054  13885   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
19055         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       13886  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
19056  13887   
                                let sender = sender.clone();
19057  13888   
                                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> };
       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> };
19059  13890   
                                    sender.send(()).await.expect("receiver dropped early");
19060  13891   
                                    result
19061  13892   
                                }
19062  13893   
                            })
19063  13894   
                            .build_unchecked();
19064  13895   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
19065  13896   
                .await
19066  13897   
                .expect("unable to make an HTTP request");
19067  13898   
            ::pretty_assertions::assert_eq!(
19068  13899   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
19069  13900   
                http_response.status()
19070  13901   
            );
19071  13902   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
19072  13903   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
19073  13904   
                http_response.headers(),
19074  13905   
                expected_headers,
19075  13906   
            ));
19076  13907   
        }
19077  13908   
    }
19078  13909   
    /// Underflow or overflow should result in SerializationException
19079         -
    /// Test ID: RestJsonHeaderLongUnderflowOverflow_case1
       13910  +
    /// Test ID: RestJsonHeaderShortUnderflowOverflow_case0
19080  13911   
    #[::tokio::test]
19081         -
    async fn rest_json_header_long_underflow_overflow_case1_malformed_request() {
       13912  +
    #[::tracing_test::traced_test]
       13913  +
    async fn rest_json_header_short_underflow_overflow_case0_malformed_request() {
19082  13914   
        {
19083  13915   
            #[allow(unused_mut)]
19084  13916   
            let mut http_request = http::Request::builder()
19085         -
                .uri("/MalformedLong/1")
       13917  +
                .uri("/MalformedShort/1")
19086  13918   
                .method("POST")
19087         -
                .header("longInHeader", "184467440737095500000")
       13919  +
                .header("shortInHeader", "40000")
19088  13920   
                .body(::aws_smithy_http_server::body::Body::empty())
19089  13921   
                .unwrap();
19090  13922   
            #[allow(unused_mut)]
19091  13923   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
19092  13924   
            let config = crate::service::RestJsonConfig::builder().build();
19093  13925   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
19094         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       13926  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
19095  13927   
                                let sender = sender.clone();
19096  13928   
                                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> };
       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> };
19098  13930   
                                    sender.send(()).await.expect("receiver dropped early");
19099  13931   
                                    result
19100  13932   
                                }
19101  13933   
                            })
19102  13934   
                            .build_unchecked();
19103  13935   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
19104  13936   
                .await
19105  13937   
                .expect("unable to make an HTTP request");
19106  13938   
            ::pretty_assertions::assert_eq!(
19107  13939   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
19108  13940   
                http_response.status()
19109  13941   
            );
19110  13942   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
19111  13943   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
19112  13944   
                http_response.headers(),
19113  13945   
                expected_headers,
19114  13946   
            ));
19115  13947   
        }
19116  13948   
    }
19117  13949   
    /// Underflow or overflow should result in SerializationException
19118         -
    /// Test ID: RestJsonHeaderLongUnderflowOverflow_case2
       13950  +
    /// Test ID: RestJsonHeaderShortUnderflowOverflow_case1
19119  13951   
    #[::tokio::test]
19120         -
    async fn rest_json_header_long_underflow_overflow_case2_malformed_request() {
       13952  +
    #[::tracing_test::traced_test]
       13953  +
    async fn rest_json_header_short_underflow_overflow_case1_malformed_request() {
19121  13954   
        {
19122  13955   
            #[allow(unused_mut)]
19123  13956   
            let mut http_request = http::Request::builder()
19124         -
                .uri("/MalformedLong/1")
       13957  +
                .uri("/MalformedShort/1")
19125  13958   
                .method("POST")
19126         -
                .header("longInHeader", "123000000000000000000000")
       13959  +
                .header("shortInHeader", "-40000")
19127  13960   
                .body(::aws_smithy_http_server::body::Body::empty())
19128  13961   
                .unwrap();
19129  13962   
            #[allow(unused_mut)]
19130  13963   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
19131  13964   
            let config = crate::service::RestJsonConfig::builder().build();
19132  13965   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
19133         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       13966  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
19134  13967   
                                let sender = sender.clone();
19135  13968   
                                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> };
       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> };
19137  13970   
                                    sender.send(()).await.expect("receiver dropped early");
19138  13971   
                                    result
19139  13972   
                                }
19140  13973   
                            })
19141  13974   
                            .build_unchecked();
19142  13975   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
19143  13976   
                .await
19144  13977   
                .expect("unable to make an HTTP request");
19145  13978   
            ::pretty_assertions::assert_eq!(
19146  13979   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
19147  13980   
                http_response.status()
19148  13981   
            );
19149  13982   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
19150  13983   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
19151  13984   
                http_response.headers(),
19152  13985   
                expected_headers,
19153  13986   
            ));
19154  13987   
        }
19155  13988   
    }
19156         -
    /// Malformed values in the body should be rejected
19157         -
    /// Test ID: RestJsonBodyLongMalformedValueRejected_case0
       13989  +
    /// Underflow or overflow should result in SerializationException
       13990  +
    /// Test ID: RestJsonHeaderShortUnderflowOverflow_case2
19158  13991   
    #[::tokio::test]
19159         -
    async fn rest_json_body_long_malformed_value_rejected_case0_malformed_request() {
       13992  +
    #[::tracing_test::traced_test]
       13993  +
    async fn rest_json_header_short_underflow_overflow_case2_malformed_request() {
19160  13994   
        {
19161  13995   
            #[allow(unused_mut)]
19162  13996   
            let mut http_request = http::Request::builder()
19163         -
                .uri("/MalformedLong/1")
       13997  +
                .uri("/MalformedShort/1")
19164  13998   
                .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         -
                ))
       13999  +
                .header("shortInHeader", "-9223372000000000000")
       14000  +
                .body(::aws_smithy_http_server::body::Body::empty())
19169  14001   
                .unwrap();
19170  14002   
            #[allow(unused_mut)]
19171  14003   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
19172  14004   
            let config = crate::service::RestJsonConfig::builder().build();
19173  14005   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
19174         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       14006  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
19175  14007   
                                let sender = sender.clone();
19176  14008   
                                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> };
       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> };
19178  14010   
                                    sender.send(()).await.expect("receiver dropped early");
19179  14011   
                                    result
19180  14012   
                                }
19181  14013   
                            })
19182  14014   
                            .build_unchecked();
19183  14015   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
19184  14016   
                .await
19185  14017   
                .expect("unable to make an HTTP request");
19186  14018   
            ::pretty_assertions::assert_eq!(
19187  14019   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
19188  14020   
                http_response.status()
19189  14021   
            );
19190  14022   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
19191  14023   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
19192  14024   
                http_response.headers(),
19193  14025   
                expected_headers,
19194  14026   
            ));
19195  14027   
        }
19196  14028   
    }
19197         -
    /// Malformed values in the body should be rejected
19198         -
    /// Test ID: RestJsonBodyLongMalformedValueRejected_case1
       14029  +
    /// Underflow or overflow should result in SerializationException
       14030  +
    /// Test ID: RestJsonHeaderShortUnderflowOverflow_case3
19199  14031   
    #[::tokio::test]
19200         -
    async fn rest_json_body_long_malformed_value_rejected_case1_malformed_request() {
       14032  +
    #[::tracing_test::traced_test]
       14033  +
    async fn rest_json_header_short_underflow_overflow_case3_malformed_request() {
19201  14034   
        {
19202  14035   
            #[allow(unused_mut)]
19203  14036   
            let mut http_request = http::Request::builder()
19204         -
                .uri("/MalformedLong/1")
       14037  +
                .uri("/MalformedShort/1")
19205  14038   
                .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         -
                ))
       14039  +
                .header("shortInHeader", "9223372000000000000")
       14040  +
                .body(::aws_smithy_http_server::body::Body::empty())
19210  14041   
                .unwrap();
19211  14042   
            #[allow(unused_mut)]
19212  14043   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
19213  14044   
            let config = crate::service::RestJsonConfig::builder().build();
19214  14045   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
19215         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       14046  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
19216  14047   
                                let sender = sender.clone();
19217  14048   
                                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> };
       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> };
19219  14050   
                                    sender.send(()).await.expect("receiver dropped early");
19220  14051   
                                    result
19221  14052   
                                }
19222  14053   
                            })
19223  14054   
                            .build_unchecked();
19224  14055   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
19225  14056   
                .await
19226  14057   
                .expect("unable to make an HTTP request");
19227  14058   
            ::pretty_assertions::assert_eq!(
19228  14059   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
19229  14060   
                http_response.status()
19230  14061   
            );
19231  14062   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
19232  14063   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
19233  14064   
                http_response.headers(),
19234  14065   
                expected_headers,
19235  14066   
            ));
19236  14067   
        }
19237  14068   
    }
19238         -
    /// Malformed values in the body should be rejected
19239         -
    /// Test ID: RestJsonBodyLongMalformedValueRejected_case2
       14069  +
    /// Underflow or overflow should result in SerializationException
       14070  +
    /// Test ID: RestJsonHeaderShortUnderflowOverflow_case4
19240  14071   
    #[::tokio::test]
19241         -
    async fn rest_json_body_long_malformed_value_rejected_case2_malformed_request() {
       14072  +
    #[::tracing_test::traced_test]
       14073  +
    async fn rest_json_header_short_underflow_overflow_case4_malformed_request() {
19242  14074   
        {
19243  14075   
            #[allow(unused_mut)]
19244  14076   
            let mut http_request = http::Request::builder()
19245         -
                .uri("/MalformedLong/1")
       14077  +
                .uri("/MalformedShort/1")
19246  14078   
                .method("POST")
19247         -
                .header("content-type", "application/json")
19248         -
                .body(::aws_smithy_http_server::body::Body::from(
19249         -
                    ::bytes::Bytes::from_static("{ \"longInBody\" : 1.001 }".as_bytes()),
19250         -
                ))
       14079  +
                .header("shortInHeader", "123000000000000000000000")
       14080  +
                .body(::aws_smithy_http_server::body::Body::empty())
19251  14081   
                .unwrap();
19252  14082   
            #[allow(unused_mut)]
19253  14083   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
19254  14084   
            let config = crate::service::RestJsonConfig::builder().build();
19255  14085   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
19256         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       14086  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
19257  14087   
                                let sender = sender.clone();
19258  14088   
                                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> };
       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> };
19260  14090   
                                    sender.send(()).await.expect("receiver dropped early");
19261  14091   
                                    result
19262  14092   
                                }
19263  14093   
                            })
19264  14094   
                            .build_unchecked();
19265  14095   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
19266  14096   
                .await
19267  14097   
                .expect("unable to make an HTTP request");
19268  14098   
            ::pretty_assertions::assert_eq!(
19269  14099   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
19270  14100   
                http_response.status()
19271  14101   
            );
19272  14102   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
19273  14103   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
19274  14104   
                http_response.headers(),
19275  14105   
                expected_headers,
19276  14106   
            ));
19277  14107   
        }
19278  14108   
    }
19279  14109   
    /// Malformed values in the body should be rejected
19280         -
    /// Test ID: RestJsonBodyLongMalformedValueRejected_case3
       14110  +
    /// Test ID: RestJsonBodyShortMalformedValueRejected_case0
19281  14111   
    #[::tokio::test]
19282         -
    async fn rest_json_body_long_malformed_value_rejected_case3_malformed_request() {
       14112  +
    #[::tracing_test::traced_test]
       14113  +
    async fn rest_json_body_short_malformed_value_rejected_case0_malformed_request() {
19283  14114   
        {
19284  14115   
            #[allow(unused_mut)]
19285  14116   
            let mut http_request = http::Request::builder()
19286         -
                .uri("/MalformedLong/1")
       14117  +
                .uri("/MalformedShort/1")
19287  14118   
                .method("POST")
19288  14119   
                .header("content-type", "application/json")
19289  14120   
                .body(::aws_smithy_http_server::body::Body::from(
19290         -
                    ::bytes::Bytes::from_static("{ \"longInBody\" : 2ABC }".as_bytes()),
       14121  +
                    ::bytes::Bytes::from_static("{ \"shortInBody\" : \"123\" }".as_bytes()),
19291  14122   
                ))
19292  14123   
                .unwrap();
19293  14124   
            #[allow(unused_mut)]
19294  14125   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
19295  14126   
            let config = crate::service::RestJsonConfig::builder().build();
19296  14127   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
19297         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       14128  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
19298  14129   
                                let sender = sender.clone();
19299  14130   
                                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> };
       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> };
19301  14132   
                                    sender.send(()).await.expect("receiver dropped early");
19302  14133   
                                    result
19303  14134   
                                }
19304  14135   
                            })
19305  14136   
                            .build_unchecked();
19306  14137   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
19307  14138   
                .await
19308  14139   
                .expect("unable to make an HTTP request");
19309  14140   
            ::pretty_assertions::assert_eq!(
19310  14141   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
19311  14142   
                http_response.status()
19312  14143   
            );
19313  14144   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
19314  14145   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
19315  14146   
                http_response.headers(),
19316  14147   
                expected_headers,
19317  14148   
            ));
19318  14149   
        }
19319  14150   
    }
19320  14151   
    /// Malformed values in the body should be rejected
19321         -
    /// Test ID: RestJsonBodyLongMalformedValueRejected_case4
       14152  +
    /// Test ID: RestJsonBodyShortMalformedValueRejected_case1
19322  14153   
    #[::tokio::test]
19323         -
    async fn rest_json_body_long_malformed_value_rejected_case4_malformed_request() {
       14154  +
    #[::tracing_test::traced_test]
       14155  +
    async fn rest_json_body_short_malformed_value_rejected_case1_malformed_request() {
19324  14156   
        {
19325  14157   
            #[allow(unused_mut)]
19326  14158   
            let mut http_request = http::Request::builder()
19327         -
                .uri("/MalformedLong/1")
       14159  +
                .uri("/MalformedShort/1")
19328  14160   
                .method("POST")
19329  14161   
                .header("content-type", "application/json")
19330  14162   
                .body(::aws_smithy_http_server::body::Body::from(
19331         -
                    ::bytes::Bytes::from_static("{ \"longInBody\" : 0x42 }".as_bytes()),
       14163  +
                    ::bytes::Bytes::from_static("{ \"shortInBody\" : true }".as_bytes()),
19332  14164   
                ))
19333  14165   
                .unwrap();
19334  14166   
            #[allow(unused_mut)]
19335  14167   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
19336  14168   
            let config = crate::service::RestJsonConfig::builder().build();
19337  14169   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
19338         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       14170  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
19339  14171   
                                let sender = sender.clone();
19340  14172   
                                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> };
       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> };
19342  14174   
                                    sender.send(()).await.expect("receiver dropped early");
19343  14175   
                                    result
19344  14176   
                                }
19345  14177   
                            })
19346  14178   
                            .build_unchecked();
19347  14179   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
19348  14180   
                .await
19349  14181   
                .expect("unable to make an HTTP request");
19350  14182   
            ::pretty_assertions::assert_eq!(
19351  14183   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
19352  14184   
                http_response.status()
19353  14185   
            );
19354  14186   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
19355  14187   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
19356  14188   
                http_response.headers(),
19357  14189   
                expected_headers,
19358  14190   
            ));
19359  14191   
        }
19360  14192   
    }
19361  14193   
    /// Malformed values in the body should be rejected
19362         -
    /// Test ID: RestJsonBodyLongMalformedValueRejected_case5
       14194  +
    /// Test ID: RestJsonBodyShortMalformedValueRejected_case2
19363  14195   
    #[::tokio::test]
19364         -
    async fn rest_json_body_long_malformed_value_rejected_case5_malformed_request() {
       14196  +
    #[::tracing_test::traced_test]
       14197  +
    async fn rest_json_body_short_malformed_value_rejected_case2_malformed_request() {
19365  14198   
        {
19366  14199   
            #[allow(unused_mut)]
19367  14200   
            let mut http_request = http::Request::builder()
19368         -
                .uri("/MalformedLong/1")
       14201  +
                .uri("/MalformedShort/1")
19369  14202   
                .method("POST")
19370  14203   
                .header("content-type", "application/json")
19371  14204   
                .body(::aws_smithy_http_server::body::Body::from(
19372         -
                    ::bytes::Bytes::from_static("{ \"longInBody\" : Infinity }".as_bytes()),
       14205  +
                    ::bytes::Bytes::from_static("{ \"shortInBody\" : 1.001 }".as_bytes()),
19373  14206   
                ))
19374  14207   
                .unwrap();
19375  14208   
            #[allow(unused_mut)]
19376  14209   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
19377  14210   
            let config = crate::service::RestJsonConfig::builder().build();
19378  14211   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
19379         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       14212  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
19380  14213   
                                let sender = sender.clone();
19381  14214   
                                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> };
       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> };
19383  14216   
                                    sender.send(()).await.expect("receiver dropped early");
19384  14217   
                                    result
19385  14218   
                                }
19386  14219   
                            })
19387  14220   
                            .build_unchecked();
19388  14221   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
19389  14222   
                .await
19390  14223   
                .expect("unable to make an HTTP request");
19391  14224   
            ::pretty_assertions::assert_eq!(
19392  14225   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
19393  14226   
                http_response.status()
19394  14227   
            );
19395  14228   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
19396  14229   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
19397  14230   
                http_response.headers(),
19398  14231   
                expected_headers,
19399  14232   
            ));
19400  14233   
        }
19401  14234   
    }
19402  14235   
    /// Malformed values in the body should be rejected
19403         -
    /// Test ID: RestJsonBodyLongMalformedValueRejected_case6
       14236  +
    /// Test ID: RestJsonBodyShortMalformedValueRejected_case3
19404  14237   
    #[::tokio::test]
19405         -
    async fn rest_json_body_long_malformed_value_rejected_case6_malformed_request() {
       14238  +
    #[::tracing_test::traced_test]
       14239  +
    async fn rest_json_body_short_malformed_value_rejected_case3_malformed_request() {
19406  14240   
        {
19407  14241   
            #[allow(unused_mut)]
19408  14242   
            let mut http_request = http::Request::builder()
19409         -
                .uri("/MalformedLong/1")
       14243  +
                .uri("/MalformedShort/1")
19410  14244   
                .method("POST")
19411  14245   
                .header("content-type", "application/json")
19412  14246   
                .body(::aws_smithy_http_server::body::Body::from(
19413         -
                    ::bytes::Bytes::from_static("{ \"longInBody\" : \"Infinity\" }".as_bytes()),
       14247  +
                    ::bytes::Bytes::from_static("{ \"shortInBody\" : 2ABC }".as_bytes()),
19414  14248   
                ))
19415  14249   
                .unwrap();
19416  14250   
            #[allow(unused_mut)]
19417  14251   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
19418  14252   
            let config = crate::service::RestJsonConfig::builder().build();
19419  14253   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
19420         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       14254  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
19421  14255   
                                let sender = sender.clone();
19422  14256   
                                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> };
       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> };
19424  14258   
                                    sender.send(()).await.expect("receiver dropped early");
19425  14259   
                                    result
19426  14260   
                                }
19427  14261   
                            })
19428  14262   
                            .build_unchecked();
19429  14263   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
19430  14264   
                .await
19431  14265   
                .expect("unable to make an HTTP request");
19432  14266   
            ::pretty_assertions::assert_eq!(
19433  14267   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
19434  14268   
                http_response.status()
19435  14269   
            );
19436  14270   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
19437  14271   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
19438  14272   
                http_response.headers(),
19439  14273   
                expected_headers,
19440  14274   
            ));
19441  14275   
        }
19442  14276   
    }
19443  14277   
    /// Malformed values in the body should be rejected
19444         -
    /// Test ID: RestJsonBodyLongMalformedValueRejected_case7
       14278  +
    /// Test ID: RestJsonBodyShortMalformedValueRejected_case4
19445  14279   
    #[::tokio::test]
19446         -
    async fn rest_json_body_long_malformed_value_rejected_case7_malformed_request() {
       14280  +
    #[::tracing_test::traced_test]
       14281  +
    async fn rest_json_body_short_malformed_value_rejected_case4_malformed_request() {
19447  14282   
        {
19448  14283   
            #[allow(unused_mut)]
19449  14284   
            let mut http_request = http::Request::builder()
19450         -
                .uri("/MalformedLong/1")
       14285  +
                .uri("/MalformedShort/1")
19451  14286   
                .method("POST")
19452  14287   
                .header("content-type", "application/json")
19453  14288   
                .body(::aws_smithy_http_server::body::Body::from(
19454         -
                    ::bytes::Bytes::from_static("{ \"longInBody\" : -Infinity }".as_bytes()),
       14289  +
                    ::bytes::Bytes::from_static("{ \"shortInBody\" : 0x42 }".as_bytes()),
19455  14290   
                ))
19456  14291   
                .unwrap();
19457  14292   
            #[allow(unused_mut)]
19458  14293   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
19459  14294   
            let config = crate::service::RestJsonConfig::builder().build();
19460  14295   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
19461         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       14296  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
19462  14297   
                                let sender = sender.clone();
19463  14298   
                                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> };
       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> };
19465  14300   
                                    sender.send(()).await.expect("receiver dropped early");
19466  14301   
                                    result
19467  14302   
                                }
19468  14303   
                            })
19469  14304   
                            .build_unchecked();
19470  14305   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
19471  14306   
                .await
19472  14307   
                .expect("unable to make an HTTP request");
19473  14308   
            ::pretty_assertions::assert_eq!(
19474  14309   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
19475  14310   
                http_response.status()
19476  14311   
            );
19477  14312   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
19478  14313   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
19479  14314   
                http_response.headers(),
19480  14315   
                expected_headers,
19481  14316   
            ));
19482  14317   
        }
19483  14318   
    }
19484  14319   
    /// Malformed values in the body should be rejected
19485         -
    /// Test ID: RestJsonBodyLongMalformedValueRejected_case8
       14320  +
    /// Test ID: RestJsonBodyShortMalformedValueRejected_case5
19486  14321   
    #[::tokio::test]
19487         -
    async fn rest_json_body_long_malformed_value_rejected_case8_malformed_request() {
       14322  +
    #[::tracing_test::traced_test]
       14323  +
    async fn rest_json_body_short_malformed_value_rejected_case5_malformed_request() {
19488  14324   
        {
19489  14325   
            #[allow(unused_mut)]
19490  14326   
            let mut http_request = http::Request::builder()
19491         -
                .uri("/MalformedLong/1")
       14327  +
                .uri("/MalformedShort/1")
19492  14328   
                .method("POST")
19493  14329   
                .header("content-type", "application/json")
19494  14330   
                .body(::aws_smithy_http_server::body::Body::from(
19495         -
                    ::bytes::Bytes::from_static("{ \"longInBody\" : \"-Infinity\" }".as_bytes()),
       14331  +
                    ::bytes::Bytes::from_static("{ \"shortInBody\" : Infinity }".as_bytes()),
19496  14332   
                ))
19497  14333   
                .unwrap();
19498  14334   
            #[allow(unused_mut)]
19499  14335   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
19500  14336   
            let config = crate::service::RestJsonConfig::builder().build();
19501  14337   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
19502         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       14338  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
19503  14339   
                                let sender = sender.clone();
19504  14340   
                                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> };
       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> };
19506  14342   
                                    sender.send(()).await.expect("receiver dropped early");
19507  14343   
                                    result
19508  14344   
                                }
19509  14345   
                            })
19510  14346   
                            .build_unchecked();
19511  14347   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
19512  14348   
                .await
19513  14349   
                .expect("unable to make an HTTP request");
19514  14350   
            ::pretty_assertions::assert_eq!(
19515  14351   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
19516  14352   
                http_response.status()
19517  14353   
            );
19518  14354   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
19519  14355   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
19520  14356   
                http_response.headers(),
19521  14357   
                expected_headers,
19522  14358   
            ));
19523  14359   
        }
19524  14360   
    }
19525  14361   
    /// Malformed values in the body should be rejected
19526         -
    /// Test ID: RestJsonBodyLongMalformedValueRejected_case9
       14362  +
    /// Test ID: RestJsonBodyShortMalformedValueRejected_case6
19527  14363   
    #[::tokio::test]
19528         -
    async fn rest_json_body_long_malformed_value_rejected_case9_malformed_request() {
       14364  +
    #[::tracing_test::traced_test]
       14365  +
    async fn rest_json_body_short_malformed_value_rejected_case6_malformed_request() {
19529  14366   
        {
19530  14367   
            #[allow(unused_mut)]
19531  14368   
            let mut http_request = http::Request::builder()
19532         -
                .uri("/MalformedLong/1")
       14369  +
                .uri("/MalformedShort/1")
19533  14370   
                .method("POST")
19534  14371   
                .header("content-type", "application/json")
19535  14372   
                .body(::aws_smithy_http_server::body::Body::from(
19536         -
                    ::bytes::Bytes::from_static("{ \"longInBody\" : NaN }".as_bytes()),
       14373  +
                    ::bytes::Bytes::from_static("{ \"shortInBody\" : \"Infinity\" }".as_bytes()),
19537  14374   
                ))
19538  14375   
                .unwrap();
19539  14376   
            #[allow(unused_mut)]
19540  14377   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
19541  14378   
            let config = crate::service::RestJsonConfig::builder().build();
19542  14379   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
19543         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       14380  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
19544  14381   
                                let sender = sender.clone();
19545  14382   
                                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> };
       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> };
19547  14384   
                                    sender.send(()).await.expect("receiver dropped early");
19548  14385   
                                    result
19549  14386   
                                }
19550  14387   
                            })
19551  14388   
                            .build_unchecked();
19552  14389   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
19553  14390   
                .await
19554  14391   
                .expect("unable to make an HTTP request");
19555  14392   
            ::pretty_assertions::assert_eq!(
19556  14393   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
19557  14394   
                http_response.status()
19558  14395   
            );
19559  14396   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
19560  14397   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
19561  14398   
                http_response.headers(),
19562  14399   
                expected_headers,
19563  14400   
            ));
19564  14401   
        }
19565  14402   
    }
19566  14403   
    /// Malformed values in the body should be rejected
19567         -
    /// Test ID: RestJsonBodyLongMalformedValueRejected_case10
       14404  +
    /// Test ID: RestJsonBodyShortMalformedValueRejected_case7
19568  14405   
    #[::tokio::test]
19569         -
    async fn rest_json_body_long_malformed_value_rejected_case10_malformed_request() {
       14406  +
    #[::tracing_test::traced_test]
       14407  +
    async fn rest_json_body_short_malformed_value_rejected_case7_malformed_request() {
19570  14408   
        {
19571  14409   
            #[allow(unused_mut)]
19572  14410   
            let mut http_request = http::Request::builder()
19573         -
                .uri("/MalformedLong/1")
       14411  +
                .uri("/MalformedShort/1")
19574  14412   
                .method("POST")
19575  14413   
                .header("content-type", "application/json")
19576  14414   
                .body(::aws_smithy_http_server::body::Body::from(
19577         -
                    ::bytes::Bytes::from_static("{ \"longInBody\" : \"NaN\" }".as_bytes()),
       14415  +
                    ::bytes::Bytes::from_static("{ \"shortInBody\" : -Infinity }".as_bytes()),
19578  14416   
                ))
19579  14417   
                .unwrap();
19580  14418   
            #[allow(unused_mut)]
19581  14419   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
19582  14420   
            let config = crate::service::RestJsonConfig::builder().build();
19583  14421   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
19584         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       14422  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
19585  14423   
                                let sender = sender.clone();
19586  14424   
                                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> };
       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> };
19588  14426   
                                    sender.send(()).await.expect("receiver dropped early");
19589  14427   
                                    result
19590  14428   
                                }
19591  14429   
                            })
19592  14430   
                            .build_unchecked();
19593  14431   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
19594  14432   
                .await
19595  14433   
                .expect("unable to make an HTTP request");
19596  14434   
            ::pretty_assertions::assert_eq!(
19597  14435   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
19598  14436   
                http_response.status()
19599  14437   
            );
19600  14438   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
19601  14439   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
19602  14440   
                http_response.headers(),
19603  14441   
                expected_headers,
19604  14442   
            ));
19605  14443   
        }
19606  14444   
    }
19607         -
    /// Malformed values in the path should be rejected
19608         -
    /// Test ID: RestJsonPathLongMalformedValueRejected_case0
       14445  +
    /// Malformed values in the body should be rejected
       14446  +
    /// Test ID: RestJsonBodyShortMalformedValueRejected_case8
19609  14447   
    #[::tokio::test]
19610         -
    async fn rest_json_path_long_malformed_value_rejected_case0_malformed_request() {
       14448  +
    #[::tracing_test::traced_test]
       14449  +
    async fn rest_json_body_short_malformed_value_rejected_case8_malformed_request() {
19611  14450   
        {
19612  14451   
            #[allow(unused_mut)]
19613  14452   
            let mut http_request = http::Request::builder()
19614         -
                .uri("/MalformedLong/true")
       14453  +
                .uri("/MalformedShort/1")
19615  14454   
                .method("POST")
19616         -
                .body(::aws_smithy_http_server::body::Body::empty())
       14455  +
                .header("content-type", "application/json")
       14456  +
                .body(::aws_smithy_http_server::body::Body::from(
       14457  +
                    ::bytes::Bytes::from_static("{ \"shortInBody\" : \"-Infinity\" }".as_bytes()),
       14458  +
                ))
19617  14459   
                .unwrap();
19618  14460   
            #[allow(unused_mut)]
19619  14461   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
19620  14462   
            let config = crate::service::RestJsonConfig::builder().build();
19621  14463   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
19622         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       14464  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
19623  14465   
                                let sender = sender.clone();
19624  14466   
                                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> };
       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> };
19626  14468   
                                    sender.send(()).await.expect("receiver dropped early");
19627  14469   
                                    result
19628  14470   
                                }
19629  14471   
                            })
19630  14472   
                            .build_unchecked();
19631  14473   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
19632  14474   
                .await
19633  14475   
                .expect("unable to make an HTTP request");
19634  14476   
            ::pretty_assertions::assert_eq!(
19635  14477   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
19636  14478   
                http_response.status()
19637  14479   
            );
19638  14480   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
19639  14481   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
19640  14482   
                http_response.headers(),
19641  14483   
                expected_headers,
19642  14484   
            ));
19643  14485   
        }
19644  14486   
    }
19645         -
    /// Malformed values in the path should be rejected
19646         -
    /// Test ID: RestJsonPathLongMalformedValueRejected_case1
       14487  +
    /// Malformed values in the body should be rejected
       14488  +
    /// Test ID: RestJsonBodyShortMalformedValueRejected_case9
19647  14489   
    #[::tokio::test]
19648         -
    async fn rest_json_path_long_malformed_value_rejected_case1_malformed_request() {
       14490  +
    #[::tracing_test::traced_test]
       14491  +
    async fn rest_json_body_short_malformed_value_rejected_case9_malformed_request() {
19649  14492   
        {
19650  14493   
            #[allow(unused_mut)]
19651  14494   
            let mut http_request = http::Request::builder()
19652         -
                .uri("/MalformedLong/1.001")
       14495  +
                .uri("/MalformedShort/1")
19653  14496   
                .method("POST")
19654         -
                .body(::aws_smithy_http_server::body::Body::empty())
       14497  +
                .header("content-type", "application/json")
       14498  +
                .body(::aws_smithy_http_server::body::Body::from(
       14499  +
                    ::bytes::Bytes::from_static("{ \"shortInBody\" : NaN }".as_bytes()),
       14500  +
                ))
19655  14501   
                .unwrap();
19656  14502   
            #[allow(unused_mut)]
19657  14503   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
19658  14504   
            let config = crate::service::RestJsonConfig::builder().build();
19659  14505   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
19660         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       14506  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
19661  14507   
                                let sender = sender.clone();
19662  14508   
                                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> };
       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> };
19664  14510   
                                    sender.send(()).await.expect("receiver dropped early");
19665  14511   
                                    result
19666  14512   
                                }
19667  14513   
                            })
19668  14514   
                            .build_unchecked();
19669  14515   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
19670  14516   
                .await
19671  14517   
                .expect("unable to make an HTTP request");
19672  14518   
            ::pretty_assertions::assert_eq!(
19673  14519   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
19674  14520   
                http_response.status()
19675  14521   
            );
19676  14522   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
19677  14523   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
19678  14524   
                http_response.headers(),
19679  14525   
                expected_headers,
19680  14526   
            ));
19681  14527   
        }
19682  14528   
    }
19683         -
    /// Malformed values in the path should be rejected
19684         -
    /// Test ID: RestJsonPathLongMalformedValueRejected_case2
       14529  +
    /// Malformed values in the body should be rejected
       14530  +
    /// Test ID: RestJsonBodyShortMalformedValueRejected_case10
19685  14531   
    #[::tokio::test]
19686         -
    async fn rest_json_path_long_malformed_value_rejected_case2_malformed_request() {
       14532  +
    #[::tracing_test::traced_test]
       14533  +
    async fn rest_json_body_short_malformed_value_rejected_case10_malformed_request() {
19687  14534   
        {
19688  14535   
            #[allow(unused_mut)]
19689  14536   
            let mut http_request = http::Request::builder()
19690         -
                .uri("/MalformedLong/2ABC")
       14537  +
                .uri("/MalformedShort/1")
19691  14538   
                .method("POST")
19692         -
                .body(::aws_smithy_http_server::body::Body::empty())
       14539  +
                .header("content-type", "application/json")
       14540  +
                .body(::aws_smithy_http_server::body::Body::from(
       14541  +
                    ::bytes::Bytes::from_static("{ \"shortInBody\" : \"NaN\" }".as_bytes()),
       14542  +
                ))
19693  14543   
                .unwrap();
19694  14544   
            #[allow(unused_mut)]
19695  14545   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
19696  14546   
            let config = crate::service::RestJsonConfig::builder().build();
19697  14547   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
19698         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       14548  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
19699  14549   
                                let sender = sender.clone();
19700  14550   
                                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> };
       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> };
19702  14552   
                                    sender.send(()).await.expect("receiver dropped early");
19703  14553   
                                    result
19704  14554   
                                }
19705  14555   
                            })
19706  14556   
                            .build_unchecked();
19707  14557   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
19708  14558   
                .await
19709  14559   
                .expect("unable to make an HTTP request");
19710  14560   
            ::pretty_assertions::assert_eq!(
19711  14561   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
19712  14562   
                http_response.status()
19713  14563   
            );
19714  14564   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
19715  14565   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
19716  14566   
                http_response.headers(),
19717  14567   
                expected_headers,
19718  14568   
            ));
19719  14569   
        }
19720  14570   
    }
19721  14571   
    /// Malformed values in the path should be rejected
19722         -
    /// Test ID: RestJsonPathLongMalformedValueRejected_case3
       14572  +
    /// Test ID: RestJsonPathShortMalformedValueRejected_case0
19723  14573   
    #[::tokio::test]
19724         -
    async fn rest_json_path_long_malformed_value_rejected_case3_malformed_request() {
       14574  +
    #[::tracing_test::traced_test]
       14575  +
    async fn rest_json_path_short_malformed_value_rejected_case0_malformed_request() {
19725  14576   
        {
19726  14577   
            #[allow(unused_mut)]
19727  14578   
            let mut http_request = http::Request::builder()
19728         -
                .uri("/MalformedLong/0x42")
       14579  +
                .uri("/MalformedShort/true")
19729  14580   
                .method("POST")
19730  14581   
                .body(::aws_smithy_http_server::body::Body::empty())
19731  14582   
                .unwrap();
19732  14583   
            #[allow(unused_mut)]
19733  14584   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
19734  14585   
            let config = crate::service::RestJsonConfig::builder().build();
19735  14586   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
19736         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       14587  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
19737  14588   
                                let sender = sender.clone();
19738  14589   
                                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> };
       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> };
19740  14591   
                                    sender.send(()).await.expect("receiver dropped early");
19741  14592   
                                    result
19742  14593   
                                }
19743  14594   
                            })
19744  14595   
                            .build_unchecked();
19745  14596   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
19746  14597   
                .await
19747  14598   
                .expect("unable to make an HTTP request");
19748  14599   
            ::pretty_assertions::assert_eq!(
19749  14600   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
19750  14601   
                http_response.status()
19751  14602   
            );
19752  14603   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
19753  14604   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
19754  14605   
                http_response.headers(),
19755  14606   
                expected_headers,
19756  14607   
            ));
19757  14608   
        }
19758  14609   
    }
19759  14610   
    /// Malformed values in the path should be rejected
19760         -
    /// Test ID: RestJsonPathLongMalformedValueRejected_case4
       14611  +
    /// Test ID: RestJsonPathShortMalformedValueRejected_case1
19761  14612   
    #[::tokio::test]
19762         -
    async fn rest_json_path_long_malformed_value_rejected_case4_malformed_request() {
       14613  +
    #[::tracing_test::traced_test]
       14614  +
    async fn rest_json_path_short_malformed_value_rejected_case1_malformed_request() {
19763  14615   
        {
19764  14616   
            #[allow(unused_mut)]
19765  14617   
            let mut http_request = http::Request::builder()
19766         -
                .uri("/MalformedLong/Infinity")
       14618  +
                .uri("/MalformedShort/1.001")
19767  14619   
                .method("POST")
19768  14620   
                .body(::aws_smithy_http_server::body::Body::empty())
19769  14621   
                .unwrap();
19770  14622   
            #[allow(unused_mut)]
19771  14623   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
19772  14624   
            let config = crate::service::RestJsonConfig::builder().build();
19773  14625   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
19774         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       14626  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
19775  14627   
                                let sender = sender.clone();
19776  14628   
                                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> };
       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> };
19778  14630   
                                    sender.send(()).await.expect("receiver dropped early");
19779  14631   
                                    result
19780  14632   
                                }
19781  14633   
                            })
19782  14634   
                            .build_unchecked();
19783  14635   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
19784  14636   
                .await
19785  14637   
                .expect("unable to make an HTTP request");
19786  14638   
            ::pretty_assertions::assert_eq!(
19787  14639   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
19788  14640   
                http_response.status()
19789  14641   
            );
19790  14642   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
19791  14643   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
19792  14644   
                http_response.headers(),
19793  14645   
                expected_headers,
19794  14646   
            ));
19795  14647   
        }
19796  14648   
    }
19797  14649   
    /// Malformed values in the path should be rejected
19798         -
    /// Test ID: RestJsonPathLongMalformedValueRejected_case5
       14650  +
    /// Test ID: RestJsonPathShortMalformedValueRejected_case2
19799  14651   
    #[::tokio::test]
19800         -
    async fn rest_json_path_long_malformed_value_rejected_case5_malformed_request() {
       14652  +
    #[::tracing_test::traced_test]
       14653  +
    async fn rest_json_path_short_malformed_value_rejected_case2_malformed_request() {
19801  14654   
        {
19802  14655   
            #[allow(unused_mut)]
19803  14656   
            let mut http_request = http::Request::builder()
19804         -
                .uri("/MalformedLong/-Infinity")
       14657  +
                .uri("/MalformedShort/2ABC")
19805  14658   
                .method("POST")
19806  14659   
                .body(::aws_smithy_http_server::body::Body::empty())
19807  14660   
                .unwrap();
19808  14661   
            #[allow(unused_mut)]
19809  14662   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
19810  14663   
            let config = crate::service::RestJsonConfig::builder().build();
19811  14664   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
19812         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       14665  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
19813  14666   
                                let sender = sender.clone();
19814  14667   
                                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> };
       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> };
19816  14669   
                                    sender.send(()).await.expect("receiver dropped early");
19817  14670   
                                    result
19818  14671   
                                }
19819  14672   
                            })
19820  14673   
                            .build_unchecked();
19821  14674   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
19822  14675   
                .await
19823  14676   
                .expect("unable to make an HTTP request");
19824  14677   
            ::pretty_assertions::assert_eq!(
19825  14678   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
19826  14679   
                http_response.status()
19827  14680   
            );
19828  14681   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
19829  14682   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
19830  14683   
                http_response.headers(),
19831  14684   
                expected_headers,
19832  14685   
            ));
19833  14686   
        }
19834  14687   
    }
19835  14688   
    /// Malformed values in the path should be rejected
19836         -
    /// Test ID: RestJsonPathLongMalformedValueRejected_case6
       14689  +
    /// Test ID: RestJsonPathShortMalformedValueRejected_case3
19837  14690   
    #[::tokio::test]
19838         -
    async fn rest_json_path_long_malformed_value_rejected_case6_malformed_request() {
       14691  +
    #[::tracing_test::traced_test]
       14692  +
    async fn rest_json_path_short_malformed_value_rejected_case3_malformed_request() {
19839  14693   
        {
19840  14694   
            #[allow(unused_mut)]
19841  14695   
            let mut http_request = http::Request::builder()
19842         -
                .uri("/MalformedLong/NaN")
       14696  +
                .uri("/MalformedShort/0x42")
19843  14697   
                .method("POST")
19844  14698   
                .body(::aws_smithy_http_server::body::Body::empty())
19845  14699   
                .unwrap();
19846  14700   
            #[allow(unused_mut)]
19847  14701   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
19848  14702   
            let config = crate::service::RestJsonConfig::builder().build();
19849  14703   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
19850         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       14704  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
19851  14705   
                                let sender = sender.clone();
19852  14706   
                                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> };
       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> };
19854  14708   
                                    sender.send(()).await.expect("receiver dropped early");
19855  14709   
                                    result
19856  14710   
                                }
19857  14711   
                            })
19858  14712   
                            .build_unchecked();
19859  14713   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
19860  14714   
                .await
19861  14715   
                .expect("unable to make an HTTP request");
19862  14716   
            ::pretty_assertions::assert_eq!(
19863  14717   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
19864  14718   
                http_response.status()
19865  14719   
            );
19866  14720   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
19867  14721   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
19868  14722   
                http_response.headers(),
19869  14723   
                expected_headers,
19870  14724   
            ));
19871  14725   
        }
19872  14726   
    }
19873         -
    /// Malformed values in query parameters should be rejected
19874         -
    /// Test ID: RestJsonQueryLongMalformedValueRejected_case0
       14727  +
    /// Malformed values in the path should be rejected
       14728  +
    /// Test ID: RestJsonPathShortMalformedValueRejected_case4
19875  14729   
    #[::tokio::test]
19876         -
    async fn rest_json_query_long_malformed_value_rejected_case0_malformed_request() {
       14730  +
    #[::tracing_test::traced_test]
       14731  +
    async fn rest_json_path_short_malformed_value_rejected_case4_malformed_request() {
19877  14732   
        {
19878  14733   
            #[allow(unused_mut)]
19879  14734   
            let mut http_request = http::Request::builder()
19880         -
                .uri("/MalformedLong/1")
       14735  +
                .uri("/MalformedShort/Infinity")
19881  14736   
                .method("POST")
19882  14737   
                .body(::aws_smithy_http_server::body::Body::empty())
19883  14738   
                .unwrap();
19884         -
            *http_request.uri_mut() = "/MalformedLong/1?longInQuery=true".parse().unwrap();
19885  14739   
            #[allow(unused_mut)]
19886  14740   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
19887  14741   
            let config = crate::service::RestJsonConfig::builder().build();
19888  14742   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
19889         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       14743  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
19890  14744   
                                let sender = sender.clone();
19891  14745   
                                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> };
       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> };
19893  14747   
                                    sender.send(()).await.expect("receiver dropped early");
19894  14748   
                                    result
19895  14749   
                                }
19896  14750   
                            })
19897  14751   
                            .build_unchecked();
19898  14752   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
19899  14753   
                .await
19900  14754   
                .expect("unable to make an HTTP request");
19901  14755   
            ::pretty_assertions::assert_eq!(
19902  14756   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
19903  14757   
                http_response.status()
19904  14758   
            );
19905  14759   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
19906  14760   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
19907  14761   
                http_response.headers(),
19908  14762   
                expected_headers,
19909  14763   
            ));
19910  14764   
        }
19911  14765   
    }
19912         -
    /// Malformed values in query parameters should be rejected
19913         -
    /// Test ID: RestJsonQueryLongMalformedValueRejected_case1
       14766  +
    /// Malformed values in the path should be rejected
       14767  +
    /// Test ID: RestJsonPathShortMalformedValueRejected_case5
19914  14768   
    #[::tokio::test]
19915         -
    async fn rest_json_query_long_malformed_value_rejected_case1_malformed_request() {
       14769  +
    #[::tracing_test::traced_test]
       14770  +
    async fn rest_json_path_short_malformed_value_rejected_case5_malformed_request() {
19916  14771   
        {
19917  14772   
            #[allow(unused_mut)]
19918  14773   
            let mut http_request = http::Request::builder()
19919         -
                .uri("/MalformedLong/1")
       14774  +
                .uri("/MalformedShort/-Infinity")
19920  14775   
                .method("POST")
19921  14776   
                .body(::aws_smithy_http_server::body::Body::empty())
19922  14777   
                .unwrap();
19923         -
            *http_request.uri_mut() = "/MalformedLong/1?longInQuery=1.001".parse().unwrap();
19924  14778   
            #[allow(unused_mut)]
19925  14779   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
19926  14780   
            let config = crate::service::RestJsonConfig::builder().build();
19927  14781   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
19928         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       14782  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
19929  14783   
                                let sender = sender.clone();
19930  14784   
                                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> };
       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> };
19932  14786   
                                    sender.send(()).await.expect("receiver dropped early");
19933  14787   
                                    result
19934  14788   
                                }
19935  14789   
                            })
19936  14790   
                            .build_unchecked();
19937  14791   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
19938  14792   
                .await
19939  14793   
                .expect("unable to make an HTTP request");
19940  14794   
            ::pretty_assertions::assert_eq!(
19941  14795   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
19942  14796   
                http_response.status()
19943  14797   
            );
19944  14798   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
19945  14799   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
19946  14800   
                http_response.headers(),
19947  14801   
                expected_headers,
19948  14802   
            ));
19949  14803   
        }
19950  14804   
    }
19951         -
    /// Malformed values in query parameters should be rejected
19952         -
    /// Test ID: RestJsonQueryLongMalformedValueRejected_case2
       14805  +
    /// Malformed values in the path should be rejected
       14806  +
    /// Test ID: RestJsonPathShortMalformedValueRejected_case6
19953  14807   
    #[::tokio::test]
19954         -
    async fn rest_json_query_long_malformed_value_rejected_case2_malformed_request() {
       14808  +
    #[::tracing_test::traced_test]
       14809  +
    async fn rest_json_path_short_malformed_value_rejected_case6_malformed_request() {
19955  14810   
        {
19956  14811   
            #[allow(unused_mut)]
19957  14812   
            let mut http_request = http::Request::builder()
19958         -
                .uri("/MalformedLong/1")
       14813  +
                .uri("/MalformedShort/NaN")
19959  14814   
                .method("POST")
19960  14815   
                .body(::aws_smithy_http_server::body::Body::empty())
19961  14816   
                .unwrap();
19962         -
            *http_request.uri_mut() = "/MalformedLong/1?longInQuery=2ABC".parse().unwrap();
19963  14817   
            #[allow(unused_mut)]
19964  14818   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
19965  14819   
            let config = crate::service::RestJsonConfig::builder().build();
19966  14820   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
19967         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       14821  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
19968  14822   
                                let sender = sender.clone();
19969  14823   
                                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> };
       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> };
19971  14825   
                                    sender.send(()).await.expect("receiver dropped early");
19972  14826   
                                    result
19973  14827   
                                }
19974  14828   
                            })
19975  14829   
                            .build_unchecked();
19976  14830   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
19977  14831   
                .await
19978  14832   
                .expect("unable to make an HTTP request");
19979  14833   
            ::pretty_assertions::assert_eq!(
19980  14834   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
19981  14835   
                http_response.status()
19982  14836   
            );
19983  14837   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
19984  14838   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
19985  14839   
                http_response.headers(),
19986  14840   
                expected_headers,
19987  14841   
            ));
19988  14842   
        }
19989  14843   
    }
19990  14844   
    /// Malformed values in query parameters should be rejected
19991         -
    /// Test ID: RestJsonQueryLongMalformedValueRejected_case3
       14845  +
    /// Test ID: RestJsonQueryShortMalformedValueRejected_case0
19992  14846   
    #[::tokio::test]
19993         -
    async fn rest_json_query_long_malformed_value_rejected_case3_malformed_request() {
       14847  +
    #[::tracing_test::traced_test]
       14848  +
    async fn rest_json_query_short_malformed_value_rejected_case0_malformed_request() {
19994  14849   
        {
19995  14850   
            #[allow(unused_mut)]
19996  14851   
            let mut http_request = http::Request::builder()
19997         -
                .uri("/MalformedLong/1")
       14852  +
                .uri("/MalformedShort/1")
19998  14853   
                .method("POST")
19999  14854   
                .body(::aws_smithy_http_server::body::Body::empty())
20000  14855   
                .unwrap();
20001         -
            *http_request.uri_mut() = "/MalformedLong/1?longInQuery=0x42".parse().unwrap();
       14856  +
            *http_request.uri_mut() = "/MalformedShort/1?shortInQuery=true".parse().unwrap();
20002  14857   
            #[allow(unused_mut)]
20003  14858   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
20004  14859   
            let config = crate::service::RestJsonConfig::builder().build();
20005  14860   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
20006         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       14861  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
20007  14862   
                                let sender = sender.clone();
20008  14863   
                                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> };
       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> };
20010  14865   
                                    sender.send(()).await.expect("receiver dropped early");
20011  14866   
                                    result
20012  14867   
                                }
20013  14868   
                            })
20014  14869   
                            .build_unchecked();
20015  14870   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
20016  14871   
                .await
20017  14872   
                .expect("unable to make an HTTP request");
20018  14873   
            ::pretty_assertions::assert_eq!(
20019  14874   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
20020  14875   
                http_response.status()
20021  14876   
            );
20022  14877   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
20023  14878   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
20024  14879   
                http_response.headers(),
20025  14880   
                expected_headers,
20026  14881   
            ));
20027  14882   
        }
20028  14883   
    }
20029  14884   
    /// Malformed values in query parameters should be rejected
20030         -
    /// Test ID: RestJsonQueryLongMalformedValueRejected_case4
       14885  +
    /// Test ID: RestJsonQueryShortMalformedValueRejected_case1
20031  14886   
    #[::tokio::test]
20032         -
    async fn rest_json_query_long_malformed_value_rejected_case4_malformed_request() {
       14887  +
    #[::tracing_test::traced_test]
       14888  +
    async fn rest_json_query_short_malformed_value_rejected_case1_malformed_request() {
20033  14889   
        {
20034  14890   
            #[allow(unused_mut)]
20035  14891   
            let mut http_request = http::Request::builder()
20036         -
                .uri("/MalformedLong/1")
       14892  +
                .uri("/MalformedShort/1")
20037  14893   
                .method("POST")
20038  14894   
                .body(::aws_smithy_http_server::body::Body::empty())
20039  14895   
                .unwrap();
20040         -
            *http_request.uri_mut() = "/MalformedLong/1?longInQuery=Infinity".parse().unwrap();
       14896  +
            *http_request.uri_mut() = "/MalformedShort/1?shortInQuery=1.001".parse().unwrap();
20041  14897   
            #[allow(unused_mut)]
20042  14898   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
20043  14899   
            let config = crate::service::RestJsonConfig::builder().build();
20044  14900   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
20045         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       14901  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
20046  14902   
                                let sender = sender.clone();
20047  14903   
                                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> };
       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> };
20049  14905   
                                    sender.send(()).await.expect("receiver dropped early");
20050  14906   
                                    result
20051  14907   
                                }
20052  14908   
                            })
20053  14909   
                            .build_unchecked();
20054  14910   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
20055  14911   
                .await
20056  14912   
                .expect("unable to make an HTTP request");
20057  14913   
            ::pretty_assertions::assert_eq!(
20058  14914   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
20059  14915   
                http_response.status()
20060  14916   
            );
20061  14917   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
20062  14918   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
20063  14919   
                http_response.headers(),
20064  14920   
                expected_headers,
20065  14921   
            ));
20066  14922   
        }
20067  14923   
    }
20068  14924   
    /// Malformed values in query parameters should be rejected
20069         -
    /// Test ID: RestJsonQueryLongMalformedValueRejected_case5
       14925  +
    /// Test ID: RestJsonQueryShortMalformedValueRejected_case2
20070  14926   
    #[::tokio::test]
20071         -
    async fn rest_json_query_long_malformed_value_rejected_case5_malformed_request() {
       14927  +
    #[::tracing_test::traced_test]
       14928  +
    async fn rest_json_query_short_malformed_value_rejected_case2_malformed_request() {
20072  14929   
        {
20073  14930   
            #[allow(unused_mut)]
20074  14931   
            let mut http_request = http::Request::builder()
20075         -
                .uri("/MalformedLong/1")
       14932  +
                .uri("/MalformedShort/1")
20076  14933   
                .method("POST")
20077  14934   
                .body(::aws_smithy_http_server::body::Body::empty())
20078  14935   
                .unwrap();
20079         -
            *http_request.uri_mut() = "/MalformedLong/1?longInQuery=-Infinity".parse().unwrap();
       14936  +
            *http_request.uri_mut() = "/MalformedShort/1?shortInQuery=2ABC".parse().unwrap();
20080  14937   
            #[allow(unused_mut)]
20081  14938   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
20082  14939   
            let config = crate::service::RestJsonConfig::builder().build();
20083  14940   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
20084         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       14941  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
20085  14942   
                                let sender = sender.clone();
20086  14943   
                                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> };
       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> };
20088  14945   
                                    sender.send(()).await.expect("receiver dropped early");
20089  14946   
                                    result
20090  14947   
                                }
20091  14948   
                            })
20092  14949   
                            .build_unchecked();
20093  14950   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
20094  14951   
                .await
20095  14952   
                .expect("unable to make an HTTP request");
20096  14953   
            ::pretty_assertions::assert_eq!(
20097  14954   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
20098  14955   
                http_response.status()
20099  14956   
            );
20100  14957   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
20101  14958   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
20102  14959   
                http_response.headers(),
20103  14960   
                expected_headers,
20104  14961   
            ));
20105  14962   
        }
20106  14963   
    }
20107  14964   
    /// Malformed values in query parameters should be rejected
20108         -
    /// Test ID: RestJsonQueryLongMalformedValueRejected_case6
       14965  +
    /// Test ID: RestJsonQueryShortMalformedValueRejected_case3
20109  14966   
    #[::tokio::test]
20110         -
    async fn rest_json_query_long_malformed_value_rejected_case6_malformed_request() {
       14967  +
    #[::tracing_test::traced_test]
       14968  +
    async fn rest_json_query_short_malformed_value_rejected_case3_malformed_request() {
20111  14969   
        {
20112  14970   
            #[allow(unused_mut)]
20113  14971   
            let mut http_request = http::Request::builder()
20114         -
                .uri("/MalformedLong/1")
       14972  +
                .uri("/MalformedShort/1")
20115  14973   
                .method("POST")
20116  14974   
                .body(::aws_smithy_http_server::body::Body::empty())
20117  14975   
                .unwrap();
20118         -
            *http_request.uri_mut() = "/MalformedLong/1?longInQuery=NaN".parse().unwrap();
       14976  +
            *http_request.uri_mut() = "/MalformedShort/1?shortInQuery=0x42".parse().unwrap();
20119  14977   
            #[allow(unused_mut)]
20120  14978   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
20121  14979   
            let config = crate::service::RestJsonConfig::builder().build();
20122  14980   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
20123         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       14981  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
20124  14982   
                                let sender = sender.clone();
20125  14983   
                                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> };
       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> };
20127  14985   
                                    sender.send(()).await.expect("receiver dropped early");
20128  14986   
                                    result
20129  14987   
                                }
20130  14988   
                            })
20131  14989   
                            .build_unchecked();
20132  14990   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
20133  14991   
                .await
20134  14992   
                .expect("unable to make an HTTP request");
20135  14993   
            ::pretty_assertions::assert_eq!(
20136  14994   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
20137  14995   
                http_response.status()
20138  14996   
            );
20139  14997   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
20140  14998   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
20141  14999   
                http_response.headers(),
20142  15000   
                expected_headers,
20143  15001   
            ));
20144  15002   
        }
20145  15003   
    }
20146         -
    /// Malformed values in headers should be rejected
20147         -
    /// Test ID: RestJsonHeaderLongMalformedValueRejected_case0
       15004  +
    /// Malformed values in query parameters should be rejected
       15005  +
    /// Test ID: RestJsonQueryShortMalformedValueRejected_case4
20148  15006   
    #[::tokio::test]
20149         -
    async fn rest_json_header_long_malformed_value_rejected_case0_malformed_request() {
       15007  +
    #[::tracing_test::traced_test]
       15008  +
    async fn rest_json_query_short_malformed_value_rejected_case4_malformed_request() {
20150  15009   
        {
20151  15010   
            #[allow(unused_mut)]
20152  15011   
            let mut http_request = http::Request::builder()
20153         -
                .uri("/MalformedLong/1")
       15012  +
                .uri("/MalformedShort/1")
20154  15013   
                .method("POST")
20155         -
                .header("longInHeader", "true")
20156  15014   
                .body(::aws_smithy_http_server::body::Body::empty())
20157  15015   
                .unwrap();
       15016  +
            *http_request.uri_mut() = "/MalformedShort/1?shortInQuery=Infinity".parse().unwrap();
20158  15017   
            #[allow(unused_mut)]
20159  15018   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
20160  15019   
            let config = crate::service::RestJsonConfig::builder().build();
20161  15020   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
20162         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       15021  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
20163  15022   
                                let sender = sender.clone();
20164  15023   
                                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> };
       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> };
20166  15025   
                                    sender.send(()).await.expect("receiver dropped early");
20167  15026   
                                    result
20168  15027   
                                }
20169  15028   
                            })
20170  15029   
                            .build_unchecked();
20171  15030   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
20172  15031   
                .await
20173  15032   
                .expect("unable to make an HTTP request");
20174  15033   
            ::pretty_assertions::assert_eq!(
20175  15034   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
20176  15035   
                http_response.status()
20177  15036   
            );
20178  15037   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
20179  15038   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
20180  15039   
                http_response.headers(),
20181  15040   
                expected_headers,
20182  15041   
            ));
20183  15042   
        }
20184  15043   
    }
20185         -
    /// Malformed values in headers should be rejected
20186         -
    /// Test ID: RestJsonHeaderLongMalformedValueRejected_case1
       15044  +
    /// Malformed values in query parameters should be rejected
       15045  +
    /// Test ID: RestJsonQueryShortMalformedValueRejected_case5
20187  15046   
    #[::tokio::test]
20188         -
    async fn rest_json_header_long_malformed_value_rejected_case1_malformed_request() {
       15047  +
    #[::tracing_test::traced_test]
       15048  +
    async fn rest_json_query_short_malformed_value_rejected_case5_malformed_request() {
20189  15049   
        {
20190  15050   
            #[allow(unused_mut)]
20191  15051   
            let mut http_request = http::Request::builder()
20192         -
                .uri("/MalformedLong/1")
       15052  +
                .uri("/MalformedShort/1")
20193  15053   
                .method("POST")
20194         -
                .header("longInHeader", "1.001")
20195  15054   
                .body(::aws_smithy_http_server::body::Body::empty())
20196  15055   
                .unwrap();
       15056  +
            *http_request.uri_mut() = "/MalformedShort/1?shortInQuery=-Infinity".parse().unwrap();
20197  15057   
            #[allow(unused_mut)]
20198  15058   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
20199  15059   
            let config = crate::service::RestJsonConfig::builder().build();
20200  15060   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
20201         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       15061  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
20202  15062   
                                let sender = sender.clone();
20203  15063   
                                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> };
       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> };
20205  15065   
                                    sender.send(()).await.expect("receiver dropped early");
20206  15066   
                                    result
20207  15067   
                                }
20208  15068   
                            })
20209  15069   
                            .build_unchecked();
20210  15070   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
20211  15071   
                .await
20212  15072   
                .expect("unable to make an HTTP request");
20213  15073   
            ::pretty_assertions::assert_eq!(
20214  15074   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
20215  15075   
                http_response.status()
20216  15076   
            );
20217  15077   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
20218  15078   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
20219  15079   
                http_response.headers(),
20220  15080   
                expected_headers,
20221  15081   
            ));
20222  15082   
        }
20223  15083   
    }
20224         -
    /// Malformed values in headers should be rejected
20225         -
    /// Test ID: RestJsonHeaderLongMalformedValueRejected_case2
       15084  +
    /// Malformed values in query parameters should be rejected
       15085  +
    /// Test ID: RestJsonQueryShortMalformedValueRejected_case6
20226  15086   
    #[::tokio::test]
20227         -
    async fn rest_json_header_long_malformed_value_rejected_case2_malformed_request() {
       15087  +
    #[::tracing_test::traced_test]
       15088  +
    async fn rest_json_query_short_malformed_value_rejected_case6_malformed_request() {
20228  15089   
        {
20229  15090   
            #[allow(unused_mut)]
20230  15091   
            let mut http_request = http::Request::builder()
20231         -
                .uri("/MalformedLong/1")
       15092  +
                .uri("/MalformedShort/1")
20232  15093   
                .method("POST")
20233         -
                .header("longInHeader", "2ABC")
20234  15094   
                .body(::aws_smithy_http_server::body::Body::empty())
20235  15095   
                .unwrap();
       15096  +
            *http_request.uri_mut() = "/MalformedShort/1?shortInQuery=NaN".parse().unwrap();
20236  15097   
            #[allow(unused_mut)]
20237  15098   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
20238  15099   
            let config = crate::service::RestJsonConfig::builder().build();
20239  15100   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
20240         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       15101  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
20241  15102   
                                let sender = sender.clone();
20242  15103   
                                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> };
       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> };
20244  15105   
                                    sender.send(()).await.expect("receiver dropped early");
20245  15106   
                                    result
20246  15107   
                                }
20247  15108   
                            })
20248  15109   
                            .build_unchecked();
20249  15110   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
20250  15111   
                .await
20251  15112   
                .expect("unable to make an HTTP request");
20252  15113   
            ::pretty_assertions::assert_eq!(
20253  15114   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
20254  15115   
                http_response.status()
20255  15116   
            );
20256  15117   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
20257  15118   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
20258  15119   
                http_response.headers(),
20259  15120   
                expected_headers,
20260  15121   
            ));
20261  15122   
        }
20262  15123   
    }
20263  15124   
    /// Malformed values in headers should be rejected
20264         -
    /// Test ID: RestJsonHeaderLongMalformedValueRejected_case3
       15125  +
    /// Test ID: RestJsonHeaderShortMalformedValueRejected_case0
20265  15126   
    #[::tokio::test]
20266         -
    async fn rest_json_header_long_malformed_value_rejected_case3_malformed_request() {
       15127  +
    #[::tracing_test::traced_test]
       15128  +
    async fn rest_json_header_short_malformed_value_rejected_case0_malformed_request() {
20267  15129   
        {
20268  15130   
            #[allow(unused_mut)]
20269  15131   
            let mut http_request = http::Request::builder()
20270         -
                .uri("/MalformedLong/1")
       15132  +
                .uri("/MalformedShort/1")
20271  15133   
                .method("POST")
20272         -
                .header("longInHeader", "0x42")
       15134  +
                .header("shortInHeader", "true")
20273  15135   
                .body(::aws_smithy_http_server::body::Body::empty())
20274  15136   
                .unwrap();
20275  15137   
            #[allow(unused_mut)]
20276  15138   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
20277  15139   
            let config = crate::service::RestJsonConfig::builder().build();
20278  15140   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
20279         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       15141  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
20280  15142   
                                let sender = sender.clone();
20281  15143   
                                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> };
       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> };
20283  15145   
                                    sender.send(()).await.expect("receiver dropped early");
20284  15146   
                                    result
20285  15147   
                                }
20286  15148   
                            })
20287  15149   
                            .build_unchecked();
20288  15150   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
20289  15151   
                .await
20290  15152   
                .expect("unable to make an HTTP request");
20291  15153   
            ::pretty_assertions::assert_eq!(
20292  15154   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
20293  15155   
                http_response.status()
20294  15156   
            );
20295  15157   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
20296  15158   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
20297  15159   
                http_response.headers(),
20298  15160   
                expected_headers,
20299  15161   
            ));
20300  15162   
        }
20301  15163   
    }
20302  15164   
    /// Malformed values in headers should be rejected
20303         -
    /// Test ID: RestJsonHeaderLongMalformedValueRejected_case4
       15165  +
    /// Test ID: RestJsonHeaderShortMalformedValueRejected_case1
20304  15166   
    #[::tokio::test]
20305         -
    async fn rest_json_header_long_malformed_value_rejected_case4_malformed_request() {
       15167  +
    #[::tracing_test::traced_test]
       15168  +
    async fn rest_json_header_short_malformed_value_rejected_case1_malformed_request() {
20306  15169   
        {
20307  15170   
            #[allow(unused_mut)]
20308  15171   
            let mut http_request = http::Request::builder()
20309         -
                .uri("/MalformedLong/1")
       15172  +
                .uri("/MalformedShort/1")
20310  15173   
                .method("POST")
20311         -
                .header("longInHeader", "Infinity")
       15174  +
                .header("shortInHeader", "1.001")
20312  15175   
                .body(::aws_smithy_http_server::body::Body::empty())
20313  15176   
                .unwrap();
20314  15177   
            #[allow(unused_mut)]
20315  15178   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
20316  15179   
            let config = crate::service::RestJsonConfig::builder().build();
20317  15180   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
20318         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       15181  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
20319  15182   
                                let sender = sender.clone();
20320  15183   
                                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> };
       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> };
20322  15185   
                                    sender.send(()).await.expect("receiver dropped early");
20323  15186   
                                    result
20324  15187   
                                }
20325  15188   
                            })
20326  15189   
                            .build_unchecked();
20327  15190   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
20328  15191   
                .await
20329  15192   
                .expect("unable to make an HTTP request");
20330  15193   
            ::pretty_assertions::assert_eq!(
20331  15194   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
20332  15195   
                http_response.status()
20333  15196   
            );
20334  15197   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
20335  15198   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
20336  15199   
                http_response.headers(),
20337  15200   
                expected_headers,
20338  15201   
            ));
20339  15202   
        }
20340  15203   
    }
20341  15204   
    /// Malformed values in headers should be rejected
20342         -
    /// Test ID: RestJsonHeaderLongMalformedValueRejected_case5
       15205  +
    /// Test ID: RestJsonHeaderShortMalformedValueRejected_case2
20343  15206   
    #[::tokio::test]
20344         -
    async fn rest_json_header_long_malformed_value_rejected_case5_malformed_request() {
       15207  +
    #[::tracing_test::traced_test]
       15208  +
    async fn rest_json_header_short_malformed_value_rejected_case2_malformed_request() {
20345  15209   
        {
20346  15210   
            #[allow(unused_mut)]
20347  15211   
            let mut http_request = http::Request::builder()
20348         -
                .uri("/MalformedLong/1")
       15212  +
                .uri("/MalformedShort/1")
20349  15213   
                .method("POST")
20350         -
                .header("longInHeader", "-Infinity")
       15214  +
                .header("shortInHeader", "2ABC")
20351  15215   
                .body(::aws_smithy_http_server::body::Body::empty())
20352  15216   
                .unwrap();
20353  15217   
            #[allow(unused_mut)]
20354  15218   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
20355  15219   
            let config = crate::service::RestJsonConfig::builder().build();
20356  15220   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
20357         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       15221  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
20358  15222   
                                let sender = sender.clone();
20359  15223   
                                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> };
       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> };
20361  15225   
                                    sender.send(()).await.expect("receiver dropped early");
20362  15226   
                                    result
20363  15227   
                                }
20364  15228   
                            })
20365  15229   
                            .build_unchecked();
20366  15230   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
20367  15231   
                .await
20368  15232   
                .expect("unable to make an HTTP request");
20369  15233   
            ::pretty_assertions::assert_eq!(
20370  15234   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
20371  15235   
                http_response.status()
20372  15236   
            );
20373  15237   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
20374  15238   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
20375  15239   
                http_response.headers(),
20376  15240   
                expected_headers,
20377  15241   
            ));
20378  15242   
        }
20379  15243   
    }
20380  15244   
    /// Malformed values in headers should be rejected
20381         -
    /// Test ID: RestJsonHeaderLongMalformedValueRejected_case6
       15245  +
    /// Test ID: RestJsonHeaderShortMalformedValueRejected_case3
20382  15246   
    #[::tokio::test]
20383         -
    async fn rest_json_header_long_malformed_value_rejected_case6_malformed_request() {
       15247  +
    #[::tracing_test::traced_test]
       15248  +
    async fn rest_json_header_short_malformed_value_rejected_case3_malformed_request() {
20384  15249   
        {
20385  15250   
            #[allow(unused_mut)]
20386  15251   
            let mut http_request = http::Request::builder()
20387         -
                .uri("/MalformedLong/1")
       15252  +
                .uri("/MalformedShort/1")
20388  15253   
                .method("POST")
20389         -
                .header("longInHeader", "NaN")
       15254  +
                .header("shortInHeader", "0x42")
20390  15255   
                .body(::aws_smithy_http_server::body::Body::empty())
20391  15256   
                .unwrap();
20392  15257   
            #[allow(unused_mut)]
20393  15258   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
20394  15259   
            let config = crate::service::RestJsonConfig::builder().build();
20395  15260   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
20396         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       15261  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
20397  15262   
                                let sender = sender.clone();
20398  15263   
                                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> };
       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> };
20400  15265   
                                    sender.send(()).await.expect("receiver dropped early");
20401  15266   
                                    result
20402  15267   
                                }
20403  15268   
                            })
20404  15269   
                            .build_unchecked();
20405  15270   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
20406  15271   
                .await
20407  15272   
                .expect("unable to make an HTTP request");
20408  15273   
            ::pretty_assertions::assert_eq!(
20409  15274   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
20410  15275   
                http_response.status()
20411  15276   
            );
20412  15277   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
20413  15278   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
20414  15279   
                http_response.headers(),
20415  15280   
                expected_headers,
20416  15281   
            ));
20417  15282   
        }
20418  15283   
    }
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
       15284  +
    /// Malformed values in headers should be rejected
       15285  +
    /// Test ID: RestJsonHeaderShortMalformedValueRejected_case4
20426  15286   
    #[::tokio::test]
20427         -
    async fn rest_json_body_malformed_map_null_key_malformed_request() {
       15287  +
    #[::tracing_test::traced_test]
       15288  +
    async fn rest_json_header_short_malformed_value_rejected_case4_malformed_request() {
20428  15289   
        {
20429  15290   
            #[allow(unused_mut)]
20430  15291   
            let mut http_request = http::Request::builder()
20431         -
                .uri("/MalformedMap")
       15292  +
                .uri("/MalformedShort/1")
20432  15293   
                .method("POST")
20433         -
                .header("content-type", "application/json")
20434         -
                .body(::aws_smithy_http_server::body::Body::from(
20435         -
                    ::bytes::Bytes::from_static("{ \"bodyMap\" : { null: \"abc\" }  }".as_bytes()),
20436         -
                ))
       15294  +
                .header("shortInHeader", "Infinity")
       15295  +
                .body(::aws_smithy_http_server::body::Body::empty())
20437  15296   
                .unwrap();
20438  15297   
            #[allow(unused_mut)]
20439  15298   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
20440  15299   
            let config = crate::service::RestJsonConfig::builder().build();
20441  15300   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
20442         -
                            .malformed_map(move |input: crate::input::MalformedMapInput| {
       15301  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
20443  15302   
                                let sender = sender.clone();
20444  15303   
                                async move {
20445         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedMapOutput };
       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> };
20446  15305   
                                    sender.send(()).await.expect("receiver dropped early");
20447  15306   
                                    result
20448  15307   
                                }
20449  15308   
                            })
20450  15309   
                            .build_unchecked();
20451  15310   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
20452  15311   
                .await
20453  15312   
                .expect("unable to make an HTTP request");
20454  15313   
            ::pretty_assertions::assert_eq!(
20455  15314   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
20456  15315   
                http_response.status()
20457  15316   
            );
20458  15317   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
20459  15318   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
20460  15319   
                http_response.headers(),
20461  15320   
                expected_headers,
20462  15321   
            ));
20463  15322   
        }
20464  15323   
    }
20465         -
    /// When a dense map contains a null value, the response should be a 400
20466         -
    /// SerializationException.
20467         -
    /// Test ID: RestJsonBodyMalformedMapNullValue
       15324  +
    /// Malformed values in headers should be rejected
       15325  +
    /// Test ID: RestJsonHeaderShortMalformedValueRejected_case5
20468  15326   
    #[::tokio::test]
20469         -
    async fn rest_json_body_malformed_map_null_value_malformed_request() {
       15327  +
    #[::tracing_test::traced_test]
       15328  +
    async fn rest_json_header_short_malformed_value_rejected_case5_malformed_request() {
20470  15329   
        {
20471  15330   
            #[allow(unused_mut)]
20472  15331   
            let mut http_request = http::Request::builder()
20473         -
                .uri("/MalformedMap")
       15332  +
                .uri("/MalformedShort/1")
20474  15333   
                .method("POST")
20475         -
                .header("content-type", "application/json")
20476         -
                .body(::aws_smithy_http_server::body::Body::from(
20477         -
                    ::bytes::Bytes::from_static("{ \"bodyMap\" : { \"abc\": null }  }".as_bytes()),
20478         -
                ))
       15334  +
                .header("shortInHeader", "-Infinity")
       15335  +
                .body(::aws_smithy_http_server::body::Body::empty())
20479  15336   
                .unwrap();
20480  15337   
            #[allow(unused_mut)]
20481  15338   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
20482  15339   
            let config = crate::service::RestJsonConfig::builder().build();
20483  15340   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
20484         -
                            .malformed_map(move |input: crate::input::MalformedMapInput| {
       15341  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
20485  15342   
                                let sender = sender.clone();
20486  15343   
                                async move {
20487         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedMapOutput };
       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> };
20488  15345   
                                    sender.send(()).await.expect("receiver dropped early");
20489  15346   
                                    result
20490  15347   
                                }
20491  15348   
                            })
20492  15349   
                            .build_unchecked();
20493  15350   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
20494  15351   
                .await
20495  15352   
                .expect("unable to make an HTTP request");
20496  15353   
            ::pretty_assertions::assert_eq!(
20497  15354   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
20498  15355   
                http_response.status()
20499  15356   
            );
20500  15357   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
20501  15358   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
20502  15359   
                http_response.headers(),
20503  15360   
                expected_headers,
20504  15361   
            ));
20505  15362   
        }
20506  15363   
    }
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
       15364  +
    /// Malformed values in headers should be rejected
       15365  +
    /// Test ID: RestJsonHeaderShortMalformedValueRejected_case6
20514  15366   
    #[::tokio::test]
20515         -
    async fn rest_json_invalid_json_body_case0_malformed_request() {
       15367  +
    #[::tracing_test::traced_test]
       15368  +
    async fn rest_json_header_short_malformed_value_rejected_case6_malformed_request() {
20516  15369   
        {
20517  15370   
            #[allow(unused_mut)]
20518  15371   
            let mut http_request = http::Request::builder()
20519         -
                .uri("/MalformedRequestBody")
       15372  +
                .uri("/MalformedShort/1")
20520  15373   
                .method("POST")
20521         -
                .header("content-type", "application/json")
20522         -
                .body(::aws_smithy_http_server::body::Body::from(
20523         -
                    ::bytes::Bytes::from_static("{[".as_bytes()),
20524         -
                ))
       15374  +
                .header("shortInHeader", "NaN")
       15375  +
                .body(::aws_smithy_http_server::body::Body::empty())
20525  15376   
                .unwrap();
20526  15377   
            #[allow(unused_mut)]
20527  15378   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
20528  15379   
            let config = crate::service::RestJsonConfig::builder().build();
20529  15380   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
20530         -
                            .malformed_request_body(move |input: crate::input::MalformedRequestBodyInput| {
       15381  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
20531  15382   
                                let sender = sender.clone();
20532  15383   
                                async move {
20533         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedRequestBodyOutput };
       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> };
20534  15385   
                                    sender.send(()).await.expect("receiver dropped early");
20535  15386   
                                    result
20536  15387   
                                }
20537  15388   
                            })
20538  15389   
                            .build_unchecked();
20539  15390   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
20540  15391   
                .await
20541  15392   
                .expect("unable to make an HTTP request");
20542  15393   
            ::pretty_assertions::assert_eq!(
20543  15394   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
20544  15395   
                http_response.status()
20545  15396   
            );
20546  15397   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
20547  15398   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
20548  15399   
                http_response.headers(),
20549  15400   
                expected_headers,
20550  15401   
            ));
20551  15402   
        }
20552  15403   
    }
20553         -
    /// When the request body is not valid JSON, the response should be a 400
20554         -
    /// SerializationException.
20555         -
    /// Test ID: RestJsonInvalidJsonBody_case1
       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  +
       15512  +
    /// Underflow or overflow should result in SerializationException
       15513  +
    /// Test ID: RestJsonBodyByteUnderflowOverflow_case0
20556  15514   
    #[::tokio::test]
20557         -
    async fn rest_json_invalid_json_body_case1_malformed_request() {
       15515  +
    #[::tracing_test::traced_test]
       15516  +
    async fn rest_json_body_byte_underflow_overflow_case0_malformed_request() {
20558  15517   
        {
20559  15518   
            #[allow(unused_mut)]
20560  15519   
            let mut http_request = http::Request::builder()
20561         -
                .uri("/MalformedRequestBody")
       15520  +
                .uri("/MalformedByte/1")
20562  15521   
                .method("POST")
20563  15522   
                .header("content-type", "application/json")
20564  15523   
                .body(::aws_smithy_http_server::body::Body::from(
20565         -
                    ::bytes::Bytes::from_static("{ \"int\": 10 }abc".as_bytes()),
       15524  +
                    ::bytes::Bytes::from_static("{ \"byteInBody\" : 256 }".as_bytes()),
20566  15525   
                ))
20567  15526   
                .unwrap();
20568  15527   
            #[allow(unused_mut)]
20569  15528   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
20570  15529   
            let config = crate::service::RestJsonConfig::builder().build();
20571  15530   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
20572         -
                            .malformed_request_body(move |input: crate::input::MalformedRequestBodyInput| {
       15531  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
20573  15532   
                                let sender = sender.clone();
20574  15533   
                                async move {
20575         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedRequestBodyOutput };
       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> };
20576  15535   
                                    sender.send(()).await.expect("receiver dropped early");
20577  15536   
                                    result
20578  15537   
                                }
20579  15538   
                            })
20580  15539   
                            .build_unchecked();
20581  15540   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
20582  15541   
                .await
20583  15542   
                .expect("unable to make an HTTP request");
20584  15543   
            ::pretty_assertions::assert_eq!(
20585  15544   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
20586  15545   
                http_response.status()
20587  15546   
            );
20588  15547   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
20589  15548   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
20590  15549   
                http_response.headers(),
20591  15550   
                expected_headers,
20592  15551   
            ));
20593  15552   
        }
20594  15553   
    }
20595         -
    /// When the request body is not valid JSON, the response should be a 400
20596         -
    /// SerializationException.
20597         -
    /// Test ID: RestJsonInvalidJsonBody_case2
       15554  +
    /// Underflow or overflow should result in SerializationException
       15555  +
    /// Test ID: RestJsonBodyByteUnderflowOverflow_case1
20598  15556   
    #[::tokio::test]
20599         -
    async fn rest_json_invalid_json_body_case2_malformed_request() {
       15557  +
    #[::tracing_test::traced_test]
       15558  +
    async fn rest_json_body_byte_underflow_overflow_case1_malformed_request() {
20600  15559   
        {
20601  15560   
            #[allow(unused_mut)]
20602  15561   
            let mut http_request = http::Request::builder()
20603         -
                .uri("/MalformedRequestBody")
       15562  +
                .uri("/MalformedByte/1")
20604  15563   
                .method("POST")
20605  15564   
                .header("content-type", "application/json")
20606  15565   
                .body(::aws_smithy_http_server::body::Body::from(
20607         -
                    ::bytes::Bytes::from_static("abc{ \"int\": 10 }".as_bytes()),
       15566  +
                    ::bytes::Bytes::from_static("{ \"byteInBody\" : -256 }".as_bytes()),
20608  15567   
                ))
20609  15568   
                .unwrap();
20610  15569   
            #[allow(unused_mut)]
20611  15570   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
20612  15571   
            let config = crate::service::RestJsonConfig::builder().build();
20613  15572   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
20614         -
                            .malformed_request_body(move |input: crate::input::MalformedRequestBodyInput| {
       15573  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
20615  15574   
                                let sender = sender.clone();
20616  15575   
                                async move {
20617         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedRequestBodyOutput };
       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> };
20618  15577   
                                    sender.send(()).await.expect("receiver dropped early");
20619  15578   
                                    result
20620  15579   
                                }
20621  15580   
                            })
20622  15581   
                            .build_unchecked();
20623  15582   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
20624  15583   
                .await
20625  15584   
                .expect("unable to make an HTTP request");
20626  15585   
            ::pretty_assertions::assert_eq!(
20627  15586   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
20628  15587   
                http_response.status()
20629  15588   
            );
20630  15589   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
20631  15590   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
20632  15591   
                http_response.headers(),
20633  15592   
                expected_headers,
20634  15593   
            ));
20635  15594   
        }
20636  15595   
    }
20637         -
    /// When the request body is not valid JSON, the response should be a 400
20638         -
    /// SerializationException.
20639         -
    /// Test ID: RestJsonInvalidJsonBody_case3
       15596  +
    /// Underflow or overflow should result in SerializationException
       15597  +
    /// Test ID: RestJsonBodyByteUnderflowOverflow_case2
20640  15598   
    #[::tokio::test]
20641         -
    async fn rest_json_invalid_json_body_case3_malformed_request() {
       15599  +
    #[::tracing_test::traced_test]
       15600  +
    async fn rest_json_body_byte_underflow_overflow_case2_malformed_request() {
20642  15601   
        {
20643  15602   
            #[allow(unused_mut)]
20644  15603   
            let mut http_request = http::Request::builder()
20645         -
                .uri("/MalformedRequestBody")
       15604  +
                .uri("/MalformedByte/1")
20646  15605   
                .method("POST")
20647  15606   
                .header("content-type", "application/json")
20648  15607   
                .body(::aws_smithy_http_server::body::Body::from(
20649  15608   
                    ::bytes::Bytes::from_static(
20650         -
                        "{\n    \"int\": 10 // the integer should be 10\n}".as_bytes(),
       15609  +
                        "{ \"byteInBody\" : -9223372000000000000 }".as_bytes(),
20651  15610   
                    ),
20652  15611   
                ))
20653  15612   
                .unwrap();
20654  15613   
            #[allow(unused_mut)]
20655  15614   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
20656  15615   
            let config = crate::service::RestJsonConfig::builder().build();
20657  15616   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
20658         -
                            .malformed_request_body(move |input: crate::input::MalformedRequestBodyInput| {
       15617  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
20659  15618   
                                let sender = sender.clone();
20660  15619   
                                async move {
20661         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedRequestBodyOutput };
       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> };
20662  15621   
                                    sender.send(()).await.expect("receiver dropped early");
20663  15622   
                                    result
20664  15623   
                                }
20665  15624   
                            })
20666  15625   
                            .build_unchecked();
20667  15626   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
20668  15627   
                .await
20669  15628   
                .expect("unable to make an HTTP request");
20670  15629   
            ::pretty_assertions::assert_eq!(
20671  15630   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
20672  15631   
                http_response.status()
20673  15632   
            );
20674  15633   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
20675  15634   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
20676  15635   
                http_response.headers(),
20677  15636   
                expected_headers,
20678  15637   
            ));
20679  15638   
        }
20680  15639   
    }
20681         -
    /// When the request body is not valid JSON, the response should be a 400
20682         -
    /// SerializationException.
20683         -
    /// Test ID: RestJsonInvalidJsonBody_case4
       15640  +
    /// Underflow or overflow should result in SerializationException
       15641  +
    /// Test ID: RestJsonBodyByteUnderflowOverflow_case3
20684  15642   
    #[::tokio::test]
20685         -
    async fn rest_json_invalid_json_body_case4_malformed_request() {
       15643  +
    #[::tracing_test::traced_test]
       15644  +
    async fn rest_json_body_byte_underflow_overflow_case3_malformed_request() {
20686  15645   
        {
20687  15646   
            #[allow(unused_mut)]
20688  15647   
            let mut http_request = http::Request::builder()
20689         -
                .uri("/MalformedRequestBody")
       15648  +
                .uri("/MalformedByte/1")
20690  15649   
                .method("POST")
20691  15650   
                .header("content-type", "application/json")
20692  15651   
                .body(::aws_smithy_http_server::body::Body::from(
20693  15652   
                    ::bytes::Bytes::from_static(
20694         -
                        "{\n    \"int\": 10 /* the integer should be 10 */\n}".as_bytes(),
       15653  +
                        "{ \"byteInBody\" : 9223372000000000000 }".as_bytes(),
20695  15654   
                    ),
20696  15655   
                ))
20697  15656   
                .unwrap();
20698  15657   
            #[allow(unused_mut)]
20699  15658   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
20700  15659   
            let config = crate::service::RestJsonConfig::builder().build();
20701  15660   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
20702         -
                            .malformed_request_body(move |input: crate::input::MalformedRequestBodyInput| {
       15661  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
20703  15662   
                                let sender = sender.clone();
20704  15663   
                                async move {
20705         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedRequestBodyOutput };
       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> };
20706  15665   
                                    sender.send(()).await.expect("receiver dropped early");
20707  15666   
                                    result
20708  15667   
                                }
20709  15668   
                            })
20710  15669   
                            .build_unchecked();
20711  15670   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
20712  15671   
                .await
20713  15672   
                .expect("unable to make an HTTP request");
20714  15673   
            ::pretty_assertions::assert_eq!(
20715  15674   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
20716  15675   
                http_response.status()
20717  15676   
            );
20718  15677   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
20719  15678   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
20720  15679   
                http_response.headers(),
20721  15680   
                expected_headers,
20722  15681   
            ));
20723  15682   
        }
20724  15683   
    }
20725         -
    /// When the request body is not valid JSON, the response should be a 400
20726         -
    /// SerializationException.
20727         -
    /// Test ID: RestJsonInvalidJsonBody_case5
       15684  +
    /// Underflow or overflow should result in SerializationException
       15685  +
    /// Test ID: RestJsonBodyByteUnderflowOverflow_case4
20728  15686   
    #[::tokio::test]
20729         -
    async fn rest_json_invalid_json_body_case5_malformed_request() {
       15687  +
    #[::tracing_test::traced_test]
       15688  +
    async fn rest_json_body_byte_underflow_overflow_case4_malformed_request() {
20730  15689   
        {
20731  15690   
            #[allow(unused_mut)]
20732  15691   
            let mut http_request = http::Request::builder()
20733         -
                .uri("/MalformedRequestBody")
       15692  +
                .uri("/MalformedByte/1")
20734  15693   
                .method("POST")
20735  15694   
                .header("content-type", "application/json")
20736  15695   
                .body(::aws_smithy_http_server::body::Body::from(
20737         -
                    ::bytes::Bytes::from_static("{\"int\" :\\u{000c}10}".as_bytes()),
       15696  +
                    ::bytes::Bytes::from_static(
       15697  +
                        "{ \"byteInBody\" : 123000000000000000000000 }".as_bytes(),
       15698  +
                    ),
20738  15699   
                ))
20739  15700   
                .unwrap();
20740  15701   
            #[allow(unused_mut)]
20741  15702   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
20742  15703   
            let config = crate::service::RestJsonConfig::builder().build();
20743  15704   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
20744         -
                            .malformed_request_body(move |input: crate::input::MalformedRequestBodyInput| {
       15705  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
20745  15706   
                                let sender = sender.clone();
20746  15707   
                                async move {
20747         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedRequestBodyOutput };
       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> };
20748  15709   
                                    sender.send(()).await.expect("receiver dropped early");
20749  15710   
                                    result
20750  15711   
                                }
20751  15712   
                            })
20752  15713   
                            .build_unchecked();
20753  15714   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
20754  15715   
                .await
20755  15716   
                .expect("unable to make an HTTP request");
20756  15717   
            ::pretty_assertions::assert_eq!(
20757  15718   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
20758  15719   
                http_response.status()
20759  15720   
            );
20760  15721   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
20761  15722   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
20762  15723   
                http_response.headers(),
20763  15724   
                expected_headers,
20764  15725   
            ));
20765  15726   
        }
20766  15727   
    }
20767         -
    /// When the request body is not valid JSON, the response should be a 400
20768         -
    /// SerializationException.
20769         -
    /// Test ID: RestJsonInvalidJsonBody_case6
       15728  +
    /// Underflow or overflow should result in SerializationException
       15729  +
    /// Test ID: RestJsonPathByteUnderflowOverflow_case0
20770  15730   
    #[::tokio::test]
20771         -
    async fn rest_json_invalid_json_body_case6_malformed_request() {
       15731  +
    #[::tracing_test::traced_test]
       15732  +
    async fn rest_json_path_byte_underflow_overflow_case0_malformed_request() {
20772  15733   
        {
20773  15734   
            #[allow(unused_mut)]
20774  15735   
            let mut http_request = http::Request::builder()
20775         -
                .uri("/MalformedRequestBody")
       15736  +
                .uri("/MalformedByte/256")
20776  15737   
                .method("POST")
20777         -
                .header("content-type", "application/json")
20778         -
                .body(::aws_smithy_http_server::body::Body::from(
20779         -
                    ::bytes::Bytes::from_static("{'int': 10}".as_bytes()),
20780         -
                ))
       15738  +
                .body(::aws_smithy_http_server::body::Body::empty())
20781  15739   
                .unwrap();
20782  15740   
            #[allow(unused_mut)]
20783  15741   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
20784  15742   
            let config = crate::service::RestJsonConfig::builder().build();
20785  15743   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
20786         -
                            .malformed_request_body(move |input: crate::input::MalformedRequestBodyInput| {
       15744  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
20787  15745   
                                let sender = sender.clone();
20788  15746   
                                async move {
20789         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedRequestBodyOutput };
       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> };
20790  15748   
                                    sender.send(()).await.expect("receiver dropped early");
20791  15749   
                                    result
20792  15750   
                                }
20793  15751   
                            })
20794  15752   
                            .build_unchecked();
20795  15753   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
20796  15754   
                .await
20797  15755   
                .expect("unable to make an HTTP request");
20798  15756   
            ::pretty_assertions::assert_eq!(
20799  15757   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
20800  15758   
                http_response.status()
20801  15759   
            );
20802  15760   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
20803  15761   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
20804  15762   
                http_response.headers(),
20805  15763   
                expected_headers,
20806  15764   
            ));
20807  15765   
        }
20808  15766   
    }
20809         -
    /// When the request body is not valid JSON, the response should be a 400
20810         -
    /// SerializationException.
20811         -
    /// Test ID: RestJsonInvalidJsonBody_case7
       15767  +
    /// Underflow or overflow should result in SerializationException
       15768  +
    /// Test ID: RestJsonPathByteUnderflowOverflow_case1
20812  15769   
    #[::tokio::test]
20813         -
    async fn rest_json_invalid_json_body_case7_malformed_request() {
       15770  +
    #[::tracing_test::traced_test]
       15771  +
    async fn rest_json_path_byte_underflow_overflow_case1_malformed_request() {
20814  15772   
        {
20815  15773   
            #[allow(unused_mut)]
20816  15774   
            let mut http_request = http::Request::builder()
20817         -
                .uri("/MalformedRequestBody")
       15775  +
                .uri("/MalformedByte/-256")
20818  15776   
                .method("POST")
20819         -
                .header("content-type", "application/json")
20820         -
                .body(::aws_smithy_http_server::body::Body::from(
20821         -
                    ::bytes::Bytes::from_static("{\"int\": 10,}".as_bytes()),
20822         -
                ))
       15777  +
                .body(::aws_smithy_http_server::body::Body::empty())
20823  15778   
                .unwrap();
20824  15779   
            #[allow(unused_mut)]
20825  15780   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
20826  15781   
            let config = crate::service::RestJsonConfig::builder().build();
20827  15782   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
20828         -
                            .malformed_request_body(move |input: crate::input::MalformedRequestBodyInput| {
       15783  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
20829  15784   
                                let sender = sender.clone();
20830  15785   
                                async move {
20831         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedRequestBodyOutput };
       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> };
20832  15787   
                                    sender.send(()).await.expect("receiver dropped early");
20833  15788   
                                    result
20834  15789   
                                }
20835  15790   
                            })
20836  15791   
                            .build_unchecked();
20837  15792   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
20838  15793   
                .await
20839  15794   
                .expect("unable to make an HTTP request");
20840  15795   
            ::pretty_assertions::assert_eq!(
20841  15796   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
20842  15797   
                http_response.status()
20843  15798   
            );
20844  15799   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
20845  15800   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
20846  15801   
                http_response.headers(),
20847  15802   
                expected_headers,
20848  15803   
            ));
20849  15804   
        }
20850  15805   
    }
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
       15806  +
    /// Underflow or overflow should result in SerializationException
       15807  +
    /// Test ID: RestJsonPathByteUnderflowOverflow_case2
20854  15808   
    #[::tokio::test]
20855         -
    async fn rest_json_technically_valid_json_body_case0_malformed_request() {
       15809  +
    #[::tracing_test::traced_test]
       15810  +
    async fn rest_json_path_byte_underflow_overflow_case2_malformed_request() {
20856  15811   
        {
20857  15812   
            #[allow(unused_mut)]
20858  15813   
            let mut http_request = http::Request::builder()
20859         -
                .uri("/MalformedRequestBody")
       15814  +
                .uri("/MalformedByte/-9223372000000000000")
20860  15815   
                .method("POST")
20861         -
                .header("content-type", "application/json")
20862         -
                .body(::aws_smithy_http_server::body::Body::from(
20863         -
                    ::bytes::Bytes::from_static("[{ \"int\": 10}]".as_bytes()),
20864         -
                ))
       15816  +
                .body(::aws_smithy_http_server::body::Body::empty())
20865  15817   
                .unwrap();
20866  15818   
            #[allow(unused_mut)]
20867  15819   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
20868  15820   
            let config = crate::service::RestJsonConfig::builder().build();
20869  15821   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
20870         -
                            .malformed_request_body(move |input: crate::input::MalformedRequestBodyInput| {
       15822  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
20871  15823   
                                let sender = sender.clone();
20872  15824   
                                async move {
20873         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedRequestBodyOutput };
       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> };
20874  15826   
                                    sender.send(()).await.expect("receiver dropped early");
20875  15827   
                                    result
20876  15828   
                                }
20877  15829   
                            })
20878  15830   
                            .build_unchecked();
20879  15831   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
20880  15832   
                .await
20881  15833   
                .expect("unable to make an HTTP request");
20882  15834   
            ::pretty_assertions::assert_eq!(
20883  15835   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
20884  15836   
                http_response.status()
20885  15837   
            );
20886  15838   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
20887  15839   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
20888  15840   
                http_response.headers(),
20889  15841   
                expected_headers,
20890  15842   
            ));
20891  15843   
        }
20892  15844   
    }
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
       15845  +
    /// Underflow or overflow should result in SerializationException
       15846  +
    /// Test ID: RestJsonPathByteUnderflowOverflow_case3
20896  15847   
    #[::tokio::test]
20897         -
    async fn rest_json_technically_valid_json_body_case1_malformed_request() {
       15848  +
    #[::tracing_test::traced_test]
       15849  +
    async fn rest_json_path_byte_underflow_overflow_case3_malformed_request() {
20898  15850   
        {
20899  15851   
            #[allow(unused_mut)]
20900  15852   
            let mut http_request = http::Request::builder()
20901         -
                .uri("/MalformedRequestBody")
       15853  +
                .uri("/MalformedByte/9223372000000000000")
20902  15854   
                .method("POST")
20903         -
                .header("content-type", "application/json")
20904         -
                .body(::aws_smithy_http_server::body::Body::from(
20905         -
                    ::bytes::Bytes::from_static("10".as_bytes()),
20906         -
                ))
       15855  +
                .body(::aws_smithy_http_server::body::Body::empty())
20907  15856   
                .unwrap();
20908  15857   
            #[allow(unused_mut)]
20909  15858   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
20910  15859   
            let config = crate::service::RestJsonConfig::builder().build();
20911  15860   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
20912         -
                            .malformed_request_body(move |input: crate::input::MalformedRequestBodyInput| {
       15861  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
20913  15862   
                                let sender = sender.clone();
20914  15863   
                                async move {
20915         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedRequestBodyOutput };
       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> };
20916  15865   
                                    sender.send(()).await.expect("receiver dropped early");
20917  15866   
                                    result
20918  15867   
                                }
20919  15868   
                            })
20920  15869   
                            .build_unchecked();
20921  15870   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
20922  15871   
                .await
20923  15872   
                .expect("unable to make an HTTP request");
20924  15873   
            ::pretty_assertions::assert_eq!(
20925  15874   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
20926  15875   
                http_response.status()
20927  15876   
            );
20928  15877   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
20929  15878   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
20930  15879   
                http_response.headers(),
20931  15880   
                expected_headers,
20932  15881   
            ));
20933  15882   
        }
20934  15883   
    }
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
       15884  +
    /// Underflow or overflow should result in SerializationException
       15885  +
    /// Test ID: RestJsonPathByteUnderflowOverflow_case4
20938  15886   
    #[::tokio::test]
20939         -
    async fn rest_json_technically_valid_json_body_case2_malformed_request() {
       15887  +
    #[::tracing_test::traced_test]
       15888  +
    async fn rest_json_path_byte_underflow_overflow_case4_malformed_request() {
20940  15889   
        {
20941  15890   
            #[allow(unused_mut)]
20942  15891   
            let mut http_request = http::Request::builder()
20943         -
                .uri("/MalformedRequestBody")
       15892  +
                .uri("/MalformedByte/123000000000000000000000")
20944  15893   
                .method("POST")
20945         -
                .header("content-type", "application/json")
20946         -
                .body(::aws_smithy_http_server::body::Body::from(
20947         -
                    ::bytes::Bytes::from_static("null".as_bytes()),
20948         -
                ))
       15894  +
                .body(::aws_smithy_http_server::body::Body::empty())
20949  15895   
                .unwrap();
20950  15896   
            #[allow(unused_mut)]
20951  15897   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
20952  15898   
            let config = crate::service::RestJsonConfig::builder().build();
20953  15899   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
20954         -
                            .malformed_request_body(move |input: crate::input::MalformedRequestBodyInput| {
       15900  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
20955  15901   
                                let sender = sender.clone();
20956  15902   
                                async move {
20957         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedRequestBodyOutput };
       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> };
20958  15904   
                                    sender.send(()).await.expect("receiver dropped early");
20959  15905   
                                    result
20960  15906   
                                }
20961  15907   
                            })
20962  15908   
                            .build_unchecked();
20963  15909   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
20964  15910   
                .await
20965  15911   
                .expect("unable to make an HTTP request");
20966  15912   
            ::pretty_assertions::assert_eq!(
20967  15913   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
20968  15914   
                http_response.status()
20969  15915   
            );
20970  15916   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
20971  15917   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
20972  15918   
                http_response.headers(),
20973  15919   
                expected_headers,
20974  15920   
            ));
20975  15921   
        }
20976  15922   
    }
20977         -
}
20978         -
#[cfg(test)]
20979         -
#[allow(unreachable_code, unused_variables)]
20980         -
mod server_malformed_short_test {
20981  15923   
    /// Underflow or overflow should result in SerializationException
20982         -
    /// Test ID: RestJsonBodyShortUnderflowOverflow_case0
       15924  +
    /// Test ID: RestJsonQueryByteUnderflowOverflow_case0
20983  15925   
    #[::tokio::test]
20984         -
    async fn rest_json_body_short_underflow_overflow_case0_malformed_request() {
       15926  +
    #[::tracing_test::traced_test]
       15927  +
    async fn rest_json_query_byte_underflow_overflow_case0_malformed_request() {
20985  15928   
        {
20986  15929   
            #[allow(unused_mut)]
20987  15930   
            let mut http_request = http::Request::builder()
20988         -
                .uri("/MalformedShort/1")
       15931  +
                .uri("/MalformedByte/1")
20989  15932   
                .method("POST")
20990         -
                .header("content-type", "application/json")
20991         -
                .body(::aws_smithy_http_server::body::Body::from(
20992         -
                    ::bytes::Bytes::from_static("{ \"shortInBody\" : 40000 }".as_bytes()),
20993         -
                ))
       15933  +
                .body(::aws_smithy_http_server::body::Body::empty())
20994  15934   
                .unwrap();
       15935  +
            *http_request.uri_mut() = "/MalformedByte/1?byteInQuery=256".parse().unwrap();
20995  15936   
            #[allow(unused_mut)]
20996  15937   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
20997  15938   
            let config = crate::service::RestJsonConfig::builder().build();
20998  15939   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
20999         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       15940  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
21000  15941   
                                let sender = sender.clone();
21001  15942   
                                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> };
       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> };
21003  15944   
                                    sender.send(()).await.expect("receiver dropped early");
21004  15945   
                                    result
21005  15946   
                                }
21006  15947   
                            })
21007  15948   
                            .build_unchecked();
21008  15949   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
21009  15950   
                .await
21010  15951   
                .expect("unable to make an HTTP request");
21011  15952   
            ::pretty_assertions::assert_eq!(
21012  15953   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
21013  15954   
                http_response.status()
21014  15955   
            );
21015  15956   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
21016  15957   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
21017  15958   
                http_response.headers(),
21018  15959   
                expected_headers,
21019  15960   
            ));
21020  15961   
        }
21021  15962   
    }
21022  15963   
    /// Underflow or overflow should result in SerializationException
21023         -
    /// Test ID: RestJsonBodyShortUnderflowOverflow_case1
       15964  +
    /// Test ID: RestJsonQueryByteUnderflowOverflow_case1
21024  15965   
    #[::tokio::test]
21025         -
    async fn rest_json_body_short_underflow_overflow_case1_malformed_request() {
       15966  +
    #[::tracing_test::traced_test]
       15967  +
    async fn rest_json_query_byte_underflow_overflow_case1_malformed_request() {
21026  15968   
        {
21027  15969   
            #[allow(unused_mut)]
21028  15970   
            let mut http_request = http::Request::builder()
21029         -
                .uri("/MalformedShort/1")
       15971  +
                .uri("/MalformedByte/1")
21030  15972   
                .method("POST")
21031         -
                .header("content-type", "application/json")
21032         -
                .body(::aws_smithy_http_server::body::Body::from(
21033         -
                    ::bytes::Bytes::from_static("{ \"shortInBody\" : -40000 }".as_bytes()),
21034         -
                ))
       15973  +
                .body(::aws_smithy_http_server::body::Body::empty())
21035  15974   
                .unwrap();
       15975  +
            *http_request.uri_mut() = "/MalformedByte/1?byteInQuery=-256".parse().unwrap();
21036  15976   
            #[allow(unused_mut)]
21037  15977   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
21038  15978   
            let config = crate::service::RestJsonConfig::builder().build();
21039  15979   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
21040         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       15980  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
21041  15981   
                                let sender = sender.clone();
21042  15982   
                                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> };
       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> };
21044  15984   
                                    sender.send(()).await.expect("receiver dropped early");
21045  15985   
                                    result
21046  15986   
                                }
21047  15987   
                            })
21048  15988   
                            .build_unchecked();
21049  15989   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
21050  15990   
                .await
21051  15991   
                .expect("unable to make an HTTP request");
21052  15992   
            ::pretty_assertions::assert_eq!(
21053  15993   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
21054  15994   
                http_response.status()
21055  15995   
            );
21056  15996   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
21057  15997   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
21058  15998   
                http_response.headers(),
21059  15999   
                expected_headers,
21060  16000   
            ));
21061  16001   
        }
21062  16002   
    }
21063  16003   
    /// Underflow or overflow should result in SerializationException
21064         -
    /// Test ID: RestJsonBodyShortUnderflowOverflow_case2
       16004  +
    /// Test ID: RestJsonQueryByteUnderflowOverflow_case2
21065  16005   
    #[::tokio::test]
21066         -
    async fn rest_json_body_short_underflow_overflow_case2_malformed_request() {
       16006  +
    #[::tracing_test::traced_test]
       16007  +
    async fn rest_json_query_byte_underflow_overflow_case2_malformed_request() {
21067  16008   
        {
21068  16009   
            #[allow(unused_mut)]
21069  16010   
            let mut http_request = http::Request::builder()
21070         -
                .uri("/MalformedShort/1")
       16011  +
                .uri("/MalformedByte/1")
21071  16012   
                .method("POST")
21072         -
                .header("content-type", "application/json")
21073         -
                .body(::aws_smithy_http_server::body::Body::from(
21074         -
                    ::bytes::Bytes::from_static(
21075         -
                        "{ \"shortInBody\" : -9223372000000000000 }".as_bytes(),
21076         -
                    ),
21077         -
                ))
       16013  +
                .body(::aws_smithy_http_server::body::Body::empty())
       16014  +
                .unwrap();
       16015  +
            *http_request.uri_mut() = "/MalformedByte/1?byteInQuery=-9223372000000000000"
       16016  +
                .parse()
21078  16017   
                .unwrap();
21079  16018   
            #[allow(unused_mut)]
21080  16019   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
21081  16020   
            let config = crate::service::RestJsonConfig::builder().build();
21082  16021   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
21083         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       16022  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
21084  16023   
                                let sender = sender.clone();
21085  16024   
                                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> };
       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> };
21087  16026   
                                    sender.send(()).await.expect("receiver dropped early");
21088  16027   
                                    result
21089  16028   
                                }
21090  16029   
                            })
21091  16030   
                            .build_unchecked();
21092  16031   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
21093  16032   
                .await
21094  16033   
                .expect("unable to make an HTTP request");
21095  16034   
            ::pretty_assertions::assert_eq!(
21096  16035   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
21097  16036   
                http_response.status()
21098  16037   
            );
21099  16038   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
21100  16039   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
21101  16040   
                http_response.headers(),
21102  16041   
                expected_headers,
21103  16042   
            ));
21104  16043   
        }
21105  16044   
    }
21106  16045   
    /// Underflow or overflow should result in SerializationException
21107         -
    /// Test ID: RestJsonBodyShortUnderflowOverflow_case3
       16046  +
    /// Test ID: RestJsonQueryByteUnderflowOverflow_case3
21108  16047   
    #[::tokio::test]
21109         -
    async fn rest_json_body_short_underflow_overflow_case3_malformed_request() {
       16048  +
    #[::tracing_test::traced_test]
       16049  +
    async fn rest_json_query_byte_underflow_overflow_case3_malformed_request() {
21110  16050   
        {
21111  16051   
            #[allow(unused_mut)]
21112  16052   
            let mut http_request = http::Request::builder()
21113         -
                .uri("/MalformedShort/1")
       16053  +
                .uri("/MalformedByte/1")
21114  16054   
                .method("POST")
21115         -
                .header("content-type", "application/json")
21116         -
                .body(::aws_smithy_http_server::body::Body::from(
21117         -
                    ::bytes::Bytes::from_static(
21118         -
                        "{ \"shortInBody\" : 9223372000000000000 }".as_bytes(),
21119         -
                    ),
21120         -
                ))
       16055  +
                .body(::aws_smithy_http_server::body::Body::empty())
       16056  +
                .unwrap();
       16057  +
            *http_request.uri_mut() = "/MalformedByte/1?byteInQuery=9223372000000000000"
       16058  +
                .parse()
21121  16059   
                .unwrap();
21122  16060   
            #[allow(unused_mut)]
21123  16061   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
21124  16062   
            let config = crate::service::RestJsonConfig::builder().build();
21125  16063   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
21126         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       16064  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
21127  16065   
                                let sender = sender.clone();
21128  16066   
                                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> };
       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> };
21130  16068   
                                    sender.send(()).await.expect("receiver dropped early");
21131  16069   
                                    result
21132  16070   
                                }
21133  16071   
                            })
21134  16072   
                            .build_unchecked();
21135  16073   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
21136  16074   
                .await
21137  16075   
                .expect("unable to make an HTTP request");
21138  16076   
            ::pretty_assertions::assert_eq!(
21139  16077   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
21140  16078   
                http_response.status()
21141  16079   
            );
21142  16080   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
21143  16081   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
21144  16082   
                http_response.headers(),
21145  16083   
                expected_headers,
21146  16084   
            ));
21147  16085   
        }
21148  16086   
    }
21149  16087   
    /// Underflow or overflow should result in SerializationException
21150         -
    /// Test ID: RestJsonBodyShortUnderflowOverflow_case4
       16088  +
    /// Test ID: RestJsonQueryByteUnderflowOverflow_case4
21151  16089   
    #[::tokio::test]
21152         -
    async fn rest_json_body_short_underflow_overflow_case4_malformed_request() {
       16090  +
    #[::tracing_test::traced_test]
       16091  +
    async fn rest_json_query_byte_underflow_overflow_case4_malformed_request() {
21153  16092   
        {
21154  16093   
            #[allow(unused_mut)]
21155  16094   
            let mut http_request = http::Request::builder()
21156         -
                .uri("/MalformedShort/1")
       16095  +
                .uri("/MalformedByte/1")
21157  16096   
                .method("POST")
21158         -
                .header("content-type", "application/json")
21159         -
                .body(::aws_smithy_http_server::body::Body::from(
21160         -
                    ::bytes::Bytes::from_static(
21161         -
                        "{ \"shortInBody\" : 123000000000000000000000 }".as_bytes(),
21162         -
                    ),
21163         -
                ))
       16097  +
                .body(::aws_smithy_http_server::body::Body::empty())
       16098  +
                .unwrap();
       16099  +
            *http_request.uri_mut() = "/MalformedByte/1?byteInQuery=123000000000000000000000"
       16100  +
                .parse()
21164  16101   
                .unwrap();
21165  16102   
            #[allow(unused_mut)]
21166  16103   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
21167  16104   
            let config = crate::service::RestJsonConfig::builder().build();
21168  16105   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
21169         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       16106  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
21170  16107   
                                let sender = sender.clone();
21171  16108   
                                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> };
       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> };
21173  16110   
                                    sender.send(()).await.expect("receiver dropped early");
21174  16111   
                                    result
21175  16112   
                                }
21176  16113   
                            })
21177  16114   
                            .build_unchecked();
21178  16115   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
21179  16116   
                .await
21180  16117   
                .expect("unable to make an HTTP request");
21181  16118   
            ::pretty_assertions::assert_eq!(
21182  16119   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
21183  16120   
                http_response.status()
21184  16121   
            );
21185  16122   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
21186  16123   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
21187  16124   
                http_response.headers(),
21188  16125   
                expected_headers,
21189  16126   
            ));
21190  16127   
        }
21191  16128   
    }
21192  16129   
    /// Underflow or overflow should result in SerializationException
21193         -
    /// Test ID: RestJsonPathShortUnderflowOverflow_case0
       16130  +
    /// Test ID: RestJsonHeaderByteUnderflowOverflow_case0
21194  16131   
    #[::tokio::test]
21195         -
    async fn rest_json_path_short_underflow_overflow_case0_malformed_request() {
       16132  +
    #[::tracing_test::traced_test]
       16133  +
    async fn rest_json_header_byte_underflow_overflow_case0_malformed_request() {
21196  16134   
        {
21197  16135   
            #[allow(unused_mut)]
21198  16136   
            let mut http_request = http::Request::builder()
21199         -
                .uri("/MalformedShort/40000")
       16137  +
                .uri("/MalformedByte/1")
21200  16138   
                .method("POST")
       16139  +
                .header("byteInHeader", "256")
21201  16140   
                .body(::aws_smithy_http_server::body::Body::empty())
21202  16141   
                .unwrap();
21203  16142   
            #[allow(unused_mut)]
21204  16143   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
21205  16144   
            let config = crate::service::RestJsonConfig::builder().build();
21206  16145   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
21207         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       16146  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
21208  16147   
                                let sender = sender.clone();
21209  16148   
                                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> };
       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> };
21211  16150   
                                    sender.send(()).await.expect("receiver dropped early");
21212  16151   
                                    result
21213  16152   
                                }
21214  16153   
                            })
21215  16154   
                            .build_unchecked();
21216  16155   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
21217  16156   
                .await
21218  16157   
                .expect("unable to make an HTTP request");
21219  16158   
            ::pretty_assertions::assert_eq!(
21220  16159   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
21221  16160   
                http_response.status()
21222  16161   
            );
21223  16162   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
21224  16163   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
21225  16164   
                http_response.headers(),
21226  16165   
                expected_headers,
21227  16166   
            ));
21228  16167   
        }
21229  16168   
    }
21230  16169   
    /// Underflow or overflow should result in SerializationException
21231         -
    /// Test ID: RestJsonPathShortUnderflowOverflow_case1
       16170  +
    /// Test ID: RestJsonHeaderByteUnderflowOverflow_case1
21232  16171   
    #[::tokio::test]
21233         -
    async fn rest_json_path_short_underflow_overflow_case1_malformed_request() {
       16172  +
    #[::tracing_test::traced_test]
       16173  +
    async fn rest_json_header_byte_underflow_overflow_case1_malformed_request() {
21234  16174   
        {
21235  16175   
            #[allow(unused_mut)]
21236  16176   
            let mut http_request = http::Request::builder()
21237         -
                .uri("/MalformedShort/-40000")
       16177  +
                .uri("/MalformedByte/1")
21238  16178   
                .method("POST")
       16179  +
                .header("byteInHeader", "-256")
21239  16180   
                .body(::aws_smithy_http_server::body::Body::empty())
21240  16181   
                .unwrap();
21241  16182   
            #[allow(unused_mut)]
21242  16183   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
21243  16184   
            let config = crate::service::RestJsonConfig::builder().build();
21244  16185   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
21245         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       16186  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
21246  16187   
                                let sender = sender.clone();
21247  16188   
                                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> };
       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> };
21249  16190   
                                    sender.send(()).await.expect("receiver dropped early");
21250  16191   
                                    result
21251  16192   
                                }
21252  16193   
                            })
21253  16194   
                            .build_unchecked();
21254  16195   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
21255  16196   
                .await
21256  16197   
                .expect("unable to make an HTTP request");
21257  16198   
            ::pretty_assertions::assert_eq!(
21258  16199   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
21259  16200   
                http_response.status()
21260  16201   
            );
21261  16202   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
21262  16203   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
21263  16204   
                http_response.headers(),
21264  16205   
                expected_headers,
21265  16206   
            ));
21266  16207   
        }
21267  16208   
    }
21268  16209   
    /// Underflow or overflow should result in SerializationException
21269         -
    /// Test ID: RestJsonPathShortUnderflowOverflow_case2
       16210  +
    /// Test ID: RestJsonHeaderByteUnderflowOverflow_case2
21270  16211   
    #[::tokio::test]
21271         -
    async fn rest_json_path_short_underflow_overflow_case2_malformed_request() {
       16212  +
    #[::tracing_test::traced_test]
       16213  +
    async fn rest_json_header_byte_underflow_overflow_case2_malformed_request() {
21272  16214   
        {
21273  16215   
            #[allow(unused_mut)]
21274  16216   
            let mut http_request = http::Request::builder()
21275         -
                .uri("/MalformedShort/-9223372000000000000")
       16217  +
                .uri("/MalformedByte/1")
21276  16218   
                .method("POST")
       16219  +
                .header("byteInHeader", "-9223372000000000000")
21277  16220   
                .body(::aws_smithy_http_server::body::Body::empty())
21278  16221   
                .unwrap();
21279  16222   
            #[allow(unused_mut)]
21280  16223   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
21281  16224   
            let config = crate::service::RestJsonConfig::builder().build();
21282  16225   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
21283         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       16226  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
21284  16227   
                                let sender = sender.clone();
21285  16228   
                                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> };
       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> };
21287  16230   
                                    sender.send(()).await.expect("receiver dropped early");
21288  16231   
                                    result
21289  16232   
                                }
21290  16233   
                            })
21291  16234   
                            .build_unchecked();
21292  16235   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
21293  16236   
                .await
21294  16237   
                .expect("unable to make an HTTP request");
21295  16238   
            ::pretty_assertions::assert_eq!(
21296  16239   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
21297  16240   
                http_response.status()
21298  16241   
            );
21299  16242   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
21300  16243   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
21301  16244   
                http_response.headers(),
21302  16245   
                expected_headers,
21303  16246   
            ));
21304  16247   
        }
21305  16248   
    }
21306  16249   
    /// Underflow or overflow should result in SerializationException
21307         -
    /// Test ID: RestJsonPathShortUnderflowOverflow_case3
       16250  +
    /// Test ID: RestJsonHeaderByteUnderflowOverflow_case3
21308  16251   
    #[::tokio::test]
21309         -
    async fn rest_json_path_short_underflow_overflow_case3_malformed_request() {
       16252  +
    #[::tracing_test::traced_test]
       16253  +
    async fn rest_json_header_byte_underflow_overflow_case3_malformed_request() {
21310  16254   
        {
21311  16255   
            #[allow(unused_mut)]
21312  16256   
            let mut http_request = http::Request::builder()
21313         -
                .uri("/MalformedShort/9223372000000000000")
       16257  +
                .uri("/MalformedByte/1")
21314  16258   
                .method("POST")
       16259  +
                .header("byteInHeader", "9223372000000000000")
21315  16260   
                .body(::aws_smithy_http_server::body::Body::empty())
21316  16261   
                .unwrap();
21317  16262   
            #[allow(unused_mut)]
21318  16263   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
21319  16264   
            let config = crate::service::RestJsonConfig::builder().build();
21320  16265   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
21321         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       16266  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
21322  16267   
                                let sender = sender.clone();
21323  16268   
                                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> };
       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> };
21325  16270   
                                    sender.send(()).await.expect("receiver dropped early");
21326  16271   
                                    result
21327  16272   
                                }
21328  16273   
                            })
21329  16274   
                            .build_unchecked();
21330  16275   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
21331  16276   
                .await
21332  16277   
                .expect("unable to make an HTTP request");
21333  16278   
            ::pretty_assertions::assert_eq!(
21334  16279   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
21335  16280   
                http_response.status()
21336  16281   
            );
21337  16282   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
21338  16283   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
21339  16284   
                http_response.headers(),
21340  16285   
                expected_headers,
21341  16286   
            ));
21342  16287   
        }
21343  16288   
    }
21344  16289   
    /// Underflow or overflow should result in SerializationException
21345         -
    /// Test ID: RestJsonPathShortUnderflowOverflow_case4
       16290  +
    /// Test ID: RestJsonHeaderByteUnderflowOverflow_case4
21346  16291   
    #[::tokio::test]
21347         -
    async fn rest_json_path_short_underflow_overflow_case4_malformed_request() {
       16292  +
    #[::tracing_test::traced_test]
       16293  +
    async fn rest_json_header_byte_underflow_overflow_case4_malformed_request() {
21348  16294   
        {
21349  16295   
            #[allow(unused_mut)]
21350  16296   
            let mut http_request = http::Request::builder()
21351         -
                .uri("/MalformedShort/123000000000000000000000")
       16297  +
                .uri("/MalformedByte/1")
21352  16298   
                .method("POST")
       16299  +
                .header("byteInHeader", "123000000000000000000000")
21353  16300   
                .body(::aws_smithy_http_server::body::Body::empty())
21354  16301   
                .unwrap();
21355  16302   
            #[allow(unused_mut)]
21356  16303   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
21357  16304   
            let config = crate::service::RestJsonConfig::builder().build();
21358  16305   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
21359         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       16306  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
21360  16307   
                                let sender = sender.clone();
21361  16308   
                                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> };
       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> };
21363  16310   
                                    sender.send(()).await.expect("receiver dropped early");
21364  16311   
                                    result
21365  16312   
                                }
21366  16313   
                            })
21367  16314   
                            .build_unchecked();
21368  16315   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
21369  16316   
                .await
21370  16317   
                .expect("unable to make an HTTP request");
21371  16318   
            ::pretty_assertions::assert_eq!(
21372  16319   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
21373  16320   
                http_response.status()
21374  16321   
            );
21375  16322   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
21376  16323   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
21377  16324   
                http_response.headers(),
21378  16325   
                expected_headers,
21379  16326   
            ));
21380  16327   
        }
21381  16328   
    }
21382         -
    /// Underflow or overflow should result in SerializationException
21383         -
    /// Test ID: RestJsonQueryShortUnderflowOverflow_case0
       16329  +
    /// Malformed values in the body should be rejected
       16330  +
    /// Test ID: RestJsonBodyByteMalformedValueRejected_case0
21384  16331   
    #[::tokio::test]
21385         -
    async fn rest_json_query_short_underflow_overflow_case0_malformed_request() {
       16332  +
    #[::tracing_test::traced_test]
       16333  +
    async fn rest_json_body_byte_malformed_value_rejected_case0_malformed_request() {
21386  16334   
        {
21387  16335   
            #[allow(unused_mut)]
21388  16336   
            let mut http_request = http::Request::builder()
21389         -
                .uri("/MalformedShort/1")
       16337  +
                .uri("/MalformedByte/1")
21390  16338   
                .method("POST")
21391         -
                .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  +
                ))
21392  16343   
                .unwrap();
21393         -
            *http_request.uri_mut() = "/MalformedShort/1?shortInQuery=40000".parse().unwrap();
21394  16344   
            #[allow(unused_mut)]
21395  16345   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
21396  16346   
            let config = crate::service::RestJsonConfig::builder().build();
21397  16347   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
21398         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       16348  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
21399  16349   
                                let sender = sender.clone();
21400  16350   
                                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> };
       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> };
21402  16352   
                                    sender.send(()).await.expect("receiver dropped early");
21403  16353   
                                    result
21404  16354   
                                }
21405  16355   
                            })
21406  16356   
                            .build_unchecked();
21407  16357   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
21408  16358   
                .await
21409  16359   
                .expect("unable to make an HTTP request");
21410  16360   
            ::pretty_assertions::assert_eq!(
21411  16361   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
21412  16362   
                http_response.status()
21413  16363   
            );
21414  16364   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
21415  16365   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
21416  16366   
                http_response.headers(),
21417  16367   
                expected_headers,
21418  16368   
            ));
21419  16369   
        }
21420  16370   
    }
21421         -
    /// Underflow or overflow should result in SerializationException
21422         -
    /// Test ID: RestJsonQueryShortUnderflowOverflow_case1
       16371  +
    /// Malformed values in the body should be rejected
       16372  +
    /// Test ID: RestJsonBodyByteMalformedValueRejected_case1
21423  16373   
    #[::tokio::test]
21424         -
    async fn rest_json_query_short_underflow_overflow_case1_malformed_request() {
       16374  +
    #[::tracing_test::traced_test]
       16375  +
    async fn rest_json_body_byte_malformed_value_rejected_case1_malformed_request() {
21425  16376   
        {
21426  16377   
            #[allow(unused_mut)]
21427  16378   
            let mut http_request = http::Request::builder()
21428         -
                .uri("/MalformedShort/1")
       16379  +
                .uri("/MalformedByte/1")
21429  16380   
                .method("POST")
21430         -
                .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  +
                ))
21431  16385   
                .unwrap();
21432         -
            *http_request.uri_mut() = "/MalformedShort/1?shortInQuery=-40000".parse().unwrap();
21433  16386   
            #[allow(unused_mut)]
21434  16387   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
21435  16388   
            let config = crate::service::RestJsonConfig::builder().build();
21436  16389   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
21437         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       16390  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
21438  16391   
                                let sender = sender.clone();
21439  16392   
                                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> };
       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> };
21441  16394   
                                    sender.send(()).await.expect("receiver dropped early");
21442  16395   
                                    result
21443  16396   
                                }
21444  16397   
                            })
21445  16398   
                            .build_unchecked();
21446  16399   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
21447  16400   
                .await
21448  16401   
                .expect("unable to make an HTTP request");
21449  16402   
            ::pretty_assertions::assert_eq!(
21450  16403   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
21451  16404   
                http_response.status()
21452  16405   
            );
21453  16406   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
21454  16407   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
21455  16408   
                http_response.headers(),
21456  16409   
                expected_headers,
21457  16410   
            ));
21458  16411   
        }
21459  16412   
    }
21460         -
    /// Underflow or overflow should result in SerializationException
21461         -
    /// Test ID: RestJsonQueryShortUnderflowOverflow_case2
       16413  +
    /// Malformed values in the body should be rejected
       16414  +
    /// Test ID: RestJsonBodyByteMalformedValueRejected_case2
21462  16415   
    #[::tokio::test]
21463         -
    async fn rest_json_query_short_underflow_overflow_case2_malformed_request() {
       16416  +
    #[::tracing_test::traced_test]
       16417  +
    async fn rest_json_body_byte_malformed_value_rejected_case2_malformed_request() {
21464  16418   
        {
21465  16419   
            #[allow(unused_mut)]
21466  16420   
            let mut http_request = http::Request::builder()
21467         -
                .uri("/MalformedShort/1")
       16421  +
                .uri("/MalformedByte/1")
21468  16422   
                .method("POST")
21469         -
                .body(::aws_smithy_http_server::body::Body::empty())
21470         -
                .unwrap();
21471         -
            *http_request.uri_mut() = "/MalformedShort/1?shortInQuery=-9223372000000000000"
21472         -
                .parse()
       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  +
                ))
21473  16427   
                .unwrap();
21474  16428   
            #[allow(unused_mut)]
21475  16429   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
21476  16430   
            let config = crate::service::RestJsonConfig::builder().build();
21477  16431   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
21478         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       16432  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
21479  16433   
                                let sender = sender.clone();
21480  16434   
                                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> };
       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> };
21482  16436   
                                    sender.send(()).await.expect("receiver dropped early");
21483  16437   
                                    result
21484  16438   
                                }
21485  16439   
                            })
21486  16440   
                            .build_unchecked();
21487  16441   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
21488  16442   
                .await
21489  16443   
                .expect("unable to make an HTTP request");
21490  16444   
            ::pretty_assertions::assert_eq!(
21491  16445   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
21492  16446   
                http_response.status()
21493  16447   
            );
21494  16448   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
21495  16449   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
21496  16450   
                http_response.headers(),
21497  16451   
                expected_headers,
21498  16452   
            ));
21499  16453   
        }
21500  16454   
    }
21501         -
    /// Underflow or overflow should result in SerializationException
21502         -
    /// Test ID: RestJsonQueryShortUnderflowOverflow_case3
       16455  +
    /// Malformed values in the body should be rejected
       16456  +
    /// Test ID: RestJsonBodyByteMalformedValueRejected_case3
21503  16457   
    #[::tokio::test]
21504         -
    async fn rest_json_query_short_underflow_overflow_case3_malformed_request() {
       16458  +
    #[::tracing_test::traced_test]
       16459  +
    async fn rest_json_body_byte_malformed_value_rejected_case3_malformed_request() {
21505  16460   
        {
21506  16461   
            #[allow(unused_mut)]
21507  16462   
            let mut http_request = http::Request::builder()
21508         -
                .uri("/MalformedShort/1")
       16463  +
                .uri("/MalformedByte/1")
21509  16464   
                .method("POST")
21510         -
                .body(::aws_smithy_http_server::body::Body::empty())
21511         -
                .unwrap();
21512         -
            *http_request.uri_mut() = "/MalformedShort/1?shortInQuery=9223372000000000000"
21513         -
                .parse()
       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  +
                ))
21514  16469   
                .unwrap();
21515  16470   
            #[allow(unused_mut)]
21516  16471   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
21517  16472   
            let config = crate::service::RestJsonConfig::builder().build();
21518  16473   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
21519         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       16474  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
21520  16475   
                                let sender = sender.clone();
21521  16476   
                                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> };
       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> };
21523  16478   
                                    sender.send(()).await.expect("receiver dropped early");
21524  16479   
                                    result
21525  16480   
                                }
21526  16481   
                            })
21527  16482   
                            .build_unchecked();
21528  16483   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
21529  16484   
                .await
21530  16485   
                .expect("unable to make an HTTP request");
21531  16486   
            ::pretty_assertions::assert_eq!(
21532  16487   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
21533  16488   
                http_response.status()
21534  16489   
            );
21535  16490   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
21536  16491   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
21537  16492   
                http_response.headers(),
21538  16493   
                expected_headers,
21539  16494   
            ));
21540  16495   
        }
21541  16496   
    }
21542         -
    /// Underflow or overflow should result in SerializationException
21543         -
    /// Test ID: RestJsonQueryShortUnderflowOverflow_case4
       16497  +
    /// Malformed values in the body should be rejected
       16498  +
    /// Test ID: RestJsonBodyByteMalformedValueRejected_case4
21544  16499   
    #[::tokio::test]
21545         -
    async fn rest_json_query_short_underflow_overflow_case4_malformed_request() {
       16500  +
    #[::tracing_test::traced_test]
       16501  +
    async fn rest_json_body_byte_malformed_value_rejected_case4_malformed_request() {
21546  16502   
        {
21547  16503   
            #[allow(unused_mut)]
21548  16504   
            let mut http_request = http::Request::builder()
21549         -
                .uri("/MalformedShort/1")
       16505  +
                .uri("/MalformedByte/1")
21550  16506   
                .method("POST")
21551         -
                .body(::aws_smithy_http_server::body::Body::empty())
21552         -
                .unwrap();
21553         -
            *http_request.uri_mut() = "/MalformedShort/1?shortInQuery=123000000000000000000000"
21554         -
                .parse()
       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  +
                ))
21555  16511   
                .unwrap();
21556  16512   
            #[allow(unused_mut)]
21557  16513   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
21558  16514   
            let config = crate::service::RestJsonConfig::builder().build();
21559  16515   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
21560         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       16516  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
21561  16517   
                                let sender = sender.clone();
21562  16518   
                                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> };
       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> };
21564  16520   
                                    sender.send(()).await.expect("receiver dropped early");
21565  16521   
                                    result
21566  16522   
                                }
21567  16523   
                            })
21568  16524   
                            .build_unchecked();
21569  16525   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
21570  16526   
                .await
21571  16527   
                .expect("unable to make an HTTP request");
21572  16528   
            ::pretty_assertions::assert_eq!(
21573  16529   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
21574  16530   
                http_response.status()
21575  16531   
            );
21576  16532   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
21577  16533   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
21578  16534   
                http_response.headers(),
21579  16535   
                expected_headers,
21580  16536   
            ));
21581  16537   
        }
21582  16538   
    }
21583         -
    /// Underflow or overflow should result in SerializationException
21584         -
    /// Test ID: RestJsonHeaderShortUnderflowOverflow_case0
       16539  +
    /// Malformed values in the body should be rejected
       16540  +
    /// Test ID: RestJsonBodyByteMalformedValueRejected_case5
21585  16541   
    #[::tokio::test]
21586         -
    async fn rest_json_header_short_underflow_overflow_case0_malformed_request() {
       16542  +
    #[::tracing_test::traced_test]
       16543  +
    async fn rest_json_body_byte_malformed_value_rejected_case5_malformed_request() {
21587  16544   
        {
21588  16545   
            #[allow(unused_mut)]
21589  16546   
            let mut http_request = http::Request::builder()
21590         -
                .uri("/MalformedShort/1")
       16547  +
                .uri("/MalformedByte/1")
21591  16548   
                .method("POST")
21592         -
                .header("shortInHeader", "40000")
21593         -
                .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  +
                ))
21594  16553   
                .unwrap();
21595  16554   
            #[allow(unused_mut)]
21596  16555   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
21597  16556   
            let config = crate::service::RestJsonConfig::builder().build();
21598  16557   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
21599         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       16558  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
21600  16559   
                                let sender = sender.clone();
21601  16560   
                                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> };
       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> };
21603  16562   
                                    sender.send(()).await.expect("receiver dropped early");
21604  16563   
                                    result
21605  16564   
                                }
21606  16565   
                            })
21607  16566   
                            .build_unchecked();
21608  16567   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
21609  16568   
                .await
21610  16569   
                .expect("unable to make an HTTP request");
21611  16570   
            ::pretty_assertions::assert_eq!(
21612  16571   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
21613  16572   
                http_response.status()
21614  16573   
            );
21615  16574   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
21616  16575   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
21617  16576   
                http_response.headers(),
21618  16577   
                expected_headers,
21619  16578   
            ));
21620  16579   
        }
21621  16580   
    }
21622         -
    /// Underflow or overflow should result in SerializationException
21623         -
    /// Test ID: RestJsonHeaderShortUnderflowOverflow_case1
       16581  +
    /// Malformed values in the body should be rejected
       16582  +
    /// Test ID: RestJsonBodyByteMalformedValueRejected_case6
21624  16583   
    #[::tokio::test]
21625         -
    async fn rest_json_header_short_underflow_overflow_case1_malformed_request() {
       16584  +
    #[::tracing_test::traced_test]
       16585  +
    async fn rest_json_body_byte_malformed_value_rejected_case6_malformed_request() {
21626  16586   
        {
21627  16587   
            #[allow(unused_mut)]
21628  16588   
            let mut http_request = http::Request::builder()
21629         -
                .uri("/MalformedShort/1")
       16589  +
                .uri("/MalformedByte/1")
21630  16590   
                .method("POST")
21631         -
                .header("shortInHeader", "-40000")
21632         -
                .body(::aws_smithy_http_server::body::Body::empty())
       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  +
                ))
21633  16595   
                .unwrap();
21634  16596   
            #[allow(unused_mut)]
21635  16597   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
21636  16598   
            let config = crate::service::RestJsonConfig::builder().build();
21637  16599   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
21638         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       16600  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
21639  16601   
                                let sender = sender.clone();
21640  16602   
                                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> };
       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> };
21642  16604   
                                    sender.send(()).await.expect("receiver dropped early");
21643  16605   
                                    result
21644  16606   
                                }
21645  16607   
                            })
21646  16608   
                            .build_unchecked();
21647  16609   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
21648  16610   
                .await
21649  16611   
                .expect("unable to make an HTTP request");
21650  16612   
            ::pretty_assertions::assert_eq!(
21651  16613   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
21652  16614   
                http_response.status()
21653  16615   
            );
21654  16616   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
21655  16617   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
21656  16618   
                http_response.headers(),
21657  16619   
                expected_headers,
21658  16620   
            ));
21659  16621   
        }
21660  16622   
    }
21661         -
    /// Underflow or overflow should result in SerializationException
21662         -
    /// Test ID: RestJsonHeaderShortUnderflowOverflow_case2
       16623  +
    /// Malformed values in the body should be rejected
       16624  +
    /// Test ID: RestJsonBodyByteMalformedValueRejected_case7
21663  16625   
    #[::tokio::test]
21664         -
    async fn rest_json_header_short_underflow_overflow_case2_malformed_request() {
       16626  +
    #[::tracing_test::traced_test]
       16627  +
    async fn rest_json_body_byte_malformed_value_rejected_case7_malformed_request() {
21665  16628   
        {
21666  16629   
            #[allow(unused_mut)]
21667  16630   
            let mut http_request = http::Request::builder()
21668         -
                .uri("/MalformedShort/1")
       16631  +
                .uri("/MalformedByte/1")
21669  16632   
                .method("POST")
21670         -
                .header("shortInHeader", "-9223372000000000000")
21671         -
                .body(::aws_smithy_http_server::body::Body::empty())
       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  +
                ))
21672  16637   
                .unwrap();
21673  16638   
            #[allow(unused_mut)]
21674  16639   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
21675  16640   
            let config = crate::service::RestJsonConfig::builder().build();
21676  16641   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
21677         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       16642  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
21678  16643   
                                let sender = sender.clone();
21679  16644   
                                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> };
       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> };
21681  16646   
                                    sender.send(()).await.expect("receiver dropped early");
21682  16647   
                                    result
21683  16648   
                                }
21684  16649   
                            })
21685  16650   
                            .build_unchecked();
21686  16651   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
21687  16652   
                .await
21688  16653   
                .expect("unable to make an HTTP request");
21689  16654   
            ::pretty_assertions::assert_eq!(
21690  16655   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
21691  16656   
                http_response.status()
21692  16657   
            );
21693  16658   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
21694  16659   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
21695  16660   
                http_response.headers(),
21696  16661   
                expected_headers,
21697  16662   
            ));
21698  16663   
        }
21699  16664   
    }
21700         -
    /// Underflow or overflow should result in SerializationException
21701         -
    /// Test ID: RestJsonHeaderShortUnderflowOverflow_case3
       16665  +
    /// Malformed values in the body should be rejected
       16666  +
    /// Test ID: RestJsonBodyByteMalformedValueRejected_case8
21702  16667   
    #[::tokio::test]
21703         -
    async fn rest_json_header_short_underflow_overflow_case3_malformed_request() {
       16668  +
    #[::tracing_test::traced_test]
       16669  +
    async fn rest_json_body_byte_malformed_value_rejected_case8_malformed_request() {
21704  16670   
        {
21705  16671   
            #[allow(unused_mut)]
21706  16672   
            let mut http_request = http::Request::builder()
21707         -
                .uri("/MalformedShort/1")
       16673  +
                .uri("/MalformedByte/1")
21708  16674   
                .method("POST")
21709         -
                .header("shortInHeader", "9223372000000000000")
21710         -
                .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  +
                ))
21711  16679   
                .unwrap();
21712  16680   
            #[allow(unused_mut)]
21713  16681   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
21714  16682   
            let config = crate::service::RestJsonConfig::builder().build();
21715  16683   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
21716         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       16684  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
21717  16685   
                                let sender = sender.clone();
21718  16686   
                                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> };
       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> };
21720  16688   
                                    sender.send(()).await.expect("receiver dropped early");
21721  16689   
                                    result
21722  16690   
                                }
21723  16691   
                            })
21724  16692   
                            .build_unchecked();
21725  16693   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
21726  16694   
                .await
21727  16695   
                .expect("unable to make an HTTP request");
21728  16696   
            ::pretty_assertions::assert_eq!(
21729  16697   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
21730  16698   
                http_response.status()
21731  16699   
            );
21732  16700   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
21733  16701   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
21734  16702   
                http_response.headers(),
21735  16703   
                expected_headers,
21736  16704   
            ));
21737  16705   
        }
21738  16706   
    }
21739         -
    /// Underflow or overflow should result in SerializationException
21740         -
    /// Test ID: RestJsonHeaderShortUnderflowOverflow_case4
       16707  +
    /// Malformed values in the body should be rejected
       16708  +
    /// Test ID: RestJsonBodyByteMalformedValueRejected_case9
21741  16709   
    #[::tokio::test]
21742         -
    async fn rest_json_header_short_underflow_overflow_case4_malformed_request() {
       16710  +
    #[::tracing_test::traced_test]
       16711  +
    async fn rest_json_body_byte_malformed_value_rejected_case9_malformed_request() {
21743  16712   
        {
21744  16713   
            #[allow(unused_mut)]
21745  16714   
            let mut http_request = http::Request::builder()
21746         -
                .uri("/MalformedShort/1")
       16715  +
                .uri("/MalformedByte/1")
21747  16716   
                .method("POST")
21748         -
                .header("shortInHeader", "123000000000000000000000")
21749         -
                .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  +
                ))
21750  16721   
                .unwrap();
21751  16722   
            #[allow(unused_mut)]
21752  16723   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
21753  16724   
            let config = crate::service::RestJsonConfig::builder().build();
21754  16725   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
21755         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       16726  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
21756  16727   
                                let sender = sender.clone();
21757  16728   
                                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> };
       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> };
21759  16730   
                                    sender.send(()).await.expect("receiver dropped early");
21760  16731   
                                    result
21761  16732   
                                }
21762  16733   
                            })
21763  16734   
                            .build_unchecked();
21764  16735   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
21765  16736   
                .await
21766  16737   
                .expect("unable to make an HTTP request");
21767  16738   
            ::pretty_assertions::assert_eq!(
21768  16739   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
21769  16740   
                http_response.status()
21770  16741   
            );
21771  16742   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
21772  16743   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
21773  16744   
                http_response.headers(),
21774  16745   
                expected_headers,
21775  16746   
            ));
21776  16747   
        }
21777  16748   
    }
21778  16749   
    /// Malformed values in the body should be rejected
21779         -
    /// Test ID: RestJsonBodyShortMalformedValueRejected_case0
       16750  +
    /// Test ID: RestJsonBodyByteMalformedValueRejected_case10
21780  16751   
    #[::tokio::test]
21781         -
    async fn rest_json_body_short_malformed_value_rejected_case0_malformed_request() {
       16752  +
    #[::tracing_test::traced_test]
       16753  +
    async fn rest_json_body_byte_malformed_value_rejected_case10_malformed_request() {
21782  16754   
        {
21783  16755   
            #[allow(unused_mut)]
21784  16756   
            let mut http_request = http::Request::builder()
21785         -
                .uri("/MalformedShort/1")
       16757  +
                .uri("/MalformedByte/1")
21786  16758   
                .method("POST")
21787  16759   
                .header("content-type", "application/json")
21788  16760   
                .body(::aws_smithy_http_server::body::Body::from(
21789         -
                    ::bytes::Bytes::from_static("{ \"shortInBody\" : \"123\" }".as_bytes()),
       16761  +
                    ::bytes::Bytes::from_static("{ \"byteInBody\" : \"NaN\" }".as_bytes()),
21790  16762   
                ))
21791  16763   
                .unwrap();
21792  16764   
            #[allow(unused_mut)]
21793  16765   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
21794  16766   
            let config = crate::service::RestJsonConfig::builder().build();
21795  16767   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
21796         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       16768  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
21797  16769   
                                let sender = sender.clone();
21798  16770   
                                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> };
       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> };
21800  16772   
                                    sender.send(()).await.expect("receiver dropped early");
21801  16773   
                                    result
21802  16774   
                                }
21803  16775   
                            })
21804  16776   
                            .build_unchecked();
21805  16777   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
21806  16778   
                .await
21807  16779   
                .expect("unable to make an HTTP request");
21808  16780   
            ::pretty_assertions::assert_eq!(
21809  16781   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
21810  16782   
                http_response.status()
21811  16783   
            );
21812  16784   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
21813  16785   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
21814  16786   
                http_response.headers(),
21815  16787   
                expected_headers,
21816  16788   
            ));
21817  16789   
        }
21818  16790   
    }
21819         -
    /// Malformed values in the body should be rejected
21820         -
    /// Test ID: RestJsonBodyShortMalformedValueRejected_case1
       16791  +
    /// Malformed values in the path should be rejected
       16792  +
    /// Test ID: RestJsonPathByteMalformedValueRejected_case0
21821  16793   
    #[::tokio::test]
21822         -
    async fn rest_json_body_short_malformed_value_rejected_case1_malformed_request() {
       16794  +
    #[::tracing_test::traced_test]
       16795  +
    async fn rest_json_path_byte_malformed_value_rejected_case0_malformed_request() {
21823  16796   
        {
21824  16797   
            #[allow(unused_mut)]
21825  16798   
            let mut http_request = http::Request::builder()
21826         -
                .uri("/MalformedShort/1")
       16799  +
                .uri("/MalformedByte/true")
21827  16800   
                .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         -
                ))
       16801  +
                .body(::aws_smithy_http_server::body::Body::empty())
21832  16802   
                .unwrap();
21833  16803   
            #[allow(unused_mut)]
21834  16804   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
21835  16805   
            let config = crate::service::RestJsonConfig::builder().build();
21836  16806   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
21837         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       16807  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
21838  16808   
                                let sender = sender.clone();
21839  16809   
                                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> };
       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> };
21841  16811   
                                    sender.send(()).await.expect("receiver dropped early");
21842  16812   
                                    result
21843  16813   
                                }
21844  16814   
                            })
21845  16815   
                            .build_unchecked();
21846  16816   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
21847  16817   
                .await
21848  16818   
                .expect("unable to make an HTTP request");
21849  16819   
            ::pretty_assertions::assert_eq!(
21850  16820   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
21851  16821   
                http_response.status()
21852  16822   
            );
21853  16823   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
21854  16824   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
21855  16825   
                http_response.headers(),
21856  16826   
                expected_headers,
21857  16827   
            ));
21858  16828   
        }
21859  16829   
    }
21860         -
    /// Malformed values in the body should be rejected
21861         -
    /// Test ID: RestJsonBodyShortMalformedValueRejected_case2
       16830  +
    /// Malformed values in the path should be rejected
       16831  +
    /// Test ID: RestJsonPathByteMalformedValueRejected_case1
21862  16832   
    #[::tokio::test]
21863         -
    async fn rest_json_body_short_malformed_value_rejected_case2_malformed_request() {
       16833  +
    #[::tracing_test::traced_test]
       16834  +
    async fn rest_json_path_byte_malformed_value_rejected_case1_malformed_request() {
21864  16835   
        {
21865  16836   
            #[allow(unused_mut)]
21866  16837   
            let mut http_request = http::Request::builder()
21867         -
                .uri("/MalformedShort/1")
       16838  +
                .uri("/MalformedByte/1.001")
21868  16839   
                .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         -
                ))
       16840  +
                .body(::aws_smithy_http_server::body::Body::empty())
21873  16841   
                .unwrap();
21874  16842   
            #[allow(unused_mut)]
21875  16843   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
21876  16844   
            let config = crate::service::RestJsonConfig::builder().build();
21877  16845   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
21878         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       16846  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
21879  16847   
                                let sender = sender.clone();
21880  16848   
                                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> };
       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> };
21882  16850   
                                    sender.send(()).await.expect("receiver dropped early");
21883  16851   
                                    result
21884  16852   
                                }
21885  16853   
                            })
21886  16854   
                            .build_unchecked();
21887  16855   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
21888  16856   
                .await
21889  16857   
                .expect("unable to make an HTTP request");
21890  16858   
            ::pretty_assertions::assert_eq!(
21891  16859   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
21892  16860   
                http_response.status()
21893  16861   
            );
21894  16862   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
21895  16863   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
21896  16864   
                http_response.headers(),
21897  16865   
                expected_headers,
21898  16866   
            ));
21899  16867   
        }
21900  16868   
    }
21901         -
    /// Malformed values in the body should be rejected
21902         -
    /// Test ID: RestJsonBodyShortMalformedValueRejected_case3
       16869  +
    /// Malformed values in the path should be rejected
       16870  +
    /// Test ID: RestJsonPathByteMalformedValueRejected_case2
21903  16871   
    #[::tokio::test]
21904         -
    async fn rest_json_body_short_malformed_value_rejected_case3_malformed_request() {
       16872  +
    #[::tracing_test::traced_test]
       16873  +
    async fn rest_json_path_byte_malformed_value_rejected_case2_malformed_request() {
21905  16874   
        {
21906  16875   
            #[allow(unused_mut)]
21907  16876   
            let mut http_request = http::Request::builder()
21908         -
                .uri("/MalformedShort/1")
       16877  +
                .uri("/MalformedByte/2ABC")
21909  16878   
                .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         -
                ))
       16879  +
                .body(::aws_smithy_http_server::body::Body::empty())
21914  16880   
                .unwrap();
21915  16881   
            #[allow(unused_mut)]
21916  16882   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
21917  16883   
            let config = crate::service::RestJsonConfig::builder().build();
21918  16884   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
21919         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       16885  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
21920  16886   
                                let sender = sender.clone();
21921  16887   
                                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> };
       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> };
21923  16889   
                                    sender.send(()).await.expect("receiver dropped early");
21924  16890   
                                    result
21925  16891   
                                }
21926  16892   
                            })
21927  16893   
                            .build_unchecked();
21928  16894   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
21929  16895   
                .await
21930  16896   
                .expect("unable to make an HTTP request");
21931  16897   
            ::pretty_assertions::assert_eq!(
21932  16898   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
21933  16899   
                http_response.status()
21934  16900   
            );
21935  16901   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
21936  16902   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
21937  16903   
                http_response.headers(),
21938  16904   
                expected_headers,
21939  16905   
            ));
21940  16906   
        }
21941  16907   
    }
21942         -
    /// Malformed values in the body should be rejected
21943         -
    /// Test ID: RestJsonBodyShortMalformedValueRejected_case4
       16908  +
    /// Malformed values in the path should be rejected
       16909  +
    /// Test ID: RestJsonPathByteMalformedValueRejected_case3
21944  16910   
    #[::tokio::test]
21945         -
    async fn rest_json_body_short_malformed_value_rejected_case4_malformed_request() {
       16911  +
    #[::tracing_test::traced_test]
       16912  +
    async fn rest_json_path_byte_malformed_value_rejected_case3_malformed_request() {
21946  16913   
        {
21947  16914   
            #[allow(unused_mut)]
21948  16915   
            let mut http_request = http::Request::builder()
21949         -
                .uri("/MalformedShort/1")
       16916  +
                .uri("/MalformedByte/0x42")
21950  16917   
                .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         -
                ))
       16918  +
                .body(::aws_smithy_http_server::body::Body::empty())
21955  16919   
                .unwrap();
21956  16920   
            #[allow(unused_mut)]
21957  16921   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
21958  16922   
            let config = crate::service::RestJsonConfig::builder().build();
21959  16923   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
21960         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       16924  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
21961  16925   
                                let sender = sender.clone();
21962  16926   
                                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> };
       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> };
21964  16928   
                                    sender.send(()).await.expect("receiver dropped early");
21965  16929   
                                    result
21966  16930   
                                }
21967  16931   
                            })
21968  16932   
                            .build_unchecked();
21969  16933   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
21970  16934   
                .await
21971  16935   
                .expect("unable to make an HTTP request");
21972  16936   
            ::pretty_assertions::assert_eq!(
21973  16937   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
21974  16938   
                http_response.status()
21975  16939   
            );
21976  16940   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
21977  16941   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
21978  16942   
                http_response.headers(),
21979  16943   
                expected_headers,
21980  16944   
            ));
21981  16945   
        }
21982  16946   
    }
21983         -
    /// Malformed values in the body should be rejected
21984         -
    /// Test ID: RestJsonBodyShortMalformedValueRejected_case5
       16947  +
    /// Malformed values in the path should be rejected
       16948  +
    /// Test ID: RestJsonPathByteMalformedValueRejected_case4
21985  16949   
    #[::tokio::test]
21986         -
    async fn rest_json_body_short_malformed_value_rejected_case5_malformed_request() {
       16950  +
    #[::tracing_test::traced_test]
       16951  +
    async fn rest_json_path_byte_malformed_value_rejected_case4_malformed_request() {
21987  16952   
        {
21988  16953   
            #[allow(unused_mut)]
21989  16954   
            let mut http_request = http::Request::builder()
21990         -
                .uri("/MalformedShort/1")
       16955  +
                .uri("/MalformedByte/Infinity")
21991  16956   
                .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         -
                ))
       16957  +
                .body(::aws_smithy_http_server::body::Body::empty())
21996  16958   
                .unwrap();
21997  16959   
            #[allow(unused_mut)]
21998  16960   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
21999  16961   
            let config = crate::service::RestJsonConfig::builder().build();
22000  16962   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
22001         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       16963  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
22002  16964   
                                let sender = sender.clone();
22003  16965   
                                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> };
       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> };
22005  16967   
                                    sender.send(()).await.expect("receiver dropped early");
22006  16968   
                                    result
22007  16969   
                                }
22008  16970   
                            })
22009  16971   
                            .build_unchecked();
22010  16972   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
22011  16973   
                .await
22012  16974   
                .expect("unable to make an HTTP request");
22013  16975   
            ::pretty_assertions::assert_eq!(
22014  16976   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
22015  16977   
                http_response.status()
22016  16978   
            );
22017  16979   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
22018  16980   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
22019  16981   
                http_response.headers(),
22020  16982   
                expected_headers,
22021  16983   
            ));
22022  16984   
        }
22023  16985   
    }
22024         -
    /// Malformed values in the body should be rejected
22025         -
    /// Test ID: RestJsonBodyShortMalformedValueRejected_case6
       16986  +
    /// Malformed values in the path should be rejected
       16987  +
    /// Test ID: RestJsonPathByteMalformedValueRejected_case5
22026  16988   
    #[::tokio::test]
22027         -
    async fn rest_json_body_short_malformed_value_rejected_case6_malformed_request() {
       16989  +
    #[::tracing_test::traced_test]
       16990  +
    async fn rest_json_path_byte_malformed_value_rejected_case5_malformed_request() {
22028  16991   
        {
22029  16992   
            #[allow(unused_mut)]
22030  16993   
            let mut http_request = http::Request::builder()
22031         -
                .uri("/MalformedShort/1")
       16994  +
                .uri("/MalformedByte/-Infinity")
22032  16995   
                .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         -
                ))
       16996  +
                .body(::aws_smithy_http_server::body::Body::empty())
22037  16997   
                .unwrap();
22038  16998   
            #[allow(unused_mut)]
22039  16999   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
22040  17000   
            let config = crate::service::RestJsonConfig::builder().build();
22041  17001   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
22042         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       17002  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
22043  17003   
                                let sender = sender.clone();
22044  17004   
                                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> };
       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> };
22046  17006   
                                    sender.send(()).await.expect("receiver dropped early");
22047  17007   
                                    result
22048  17008   
                                }
22049  17009   
                            })
22050  17010   
                            .build_unchecked();
22051  17011   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
22052  17012   
                .await
22053  17013   
                .expect("unable to make an HTTP request");
22054  17014   
            ::pretty_assertions::assert_eq!(
22055  17015   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
22056  17016   
                http_response.status()
22057  17017   
            );
22058  17018   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
22059  17019   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
22060  17020   
                http_response.headers(),
22061  17021   
                expected_headers,
22062  17022   
            ));
22063  17023   
        }
22064  17024   
    }
22065         -
    /// Malformed values in the body should be rejected
22066         -
    /// Test ID: RestJsonBodyShortMalformedValueRejected_case7
       17025  +
    /// Malformed values in the path should be rejected
       17026  +
    /// Test ID: RestJsonPathByteMalformedValueRejected_case6
22067  17027   
    #[::tokio::test]
22068         -
    async fn rest_json_body_short_malformed_value_rejected_case7_malformed_request() {
       17028  +
    #[::tracing_test::traced_test]
       17029  +
    async fn rest_json_path_byte_malformed_value_rejected_case6_malformed_request() {
22069  17030   
        {
22070  17031   
            #[allow(unused_mut)]
22071  17032   
            let mut http_request = http::Request::builder()
22072         -
                .uri("/MalformedShort/1")
       17033  +
                .uri("/MalformedByte/NaN")
22073  17034   
                .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         -
                ))
       17035  +
                .body(::aws_smithy_http_server::body::Body::empty())
22078  17036   
                .unwrap();
22079  17037   
            #[allow(unused_mut)]
22080  17038   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
22081  17039   
            let config = crate::service::RestJsonConfig::builder().build();
22082  17040   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
22083         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       17041  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
22084  17042   
                                let sender = sender.clone();
22085  17043   
                                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> };
       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> };
22087  17045   
                                    sender.send(()).await.expect("receiver dropped early");
22088  17046   
                                    result
22089  17047   
                                }
22090  17048   
                            })
22091  17049   
                            .build_unchecked();
22092  17050   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
22093  17051   
                .await
22094  17052   
                .expect("unable to make an HTTP request");
22095  17053   
            ::pretty_assertions::assert_eq!(
22096  17054   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
22097  17055   
                http_response.status()
22098  17056   
            );
22099  17057   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
22100  17058   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
22101  17059   
                http_response.headers(),
22102  17060   
                expected_headers,
22103  17061   
            ));
22104  17062   
        }
22105  17063   
    }
22106         -
    /// Malformed values in the body should be rejected
22107         -
    /// Test ID: RestJsonBodyShortMalformedValueRejected_case8
       17064  +
    /// Malformed values in query parameters should be rejected
       17065  +
    /// Test ID: RestJsonQueryByteMalformedValueRejected_case0
22108  17066   
    #[::tokio::test]
22109         -
    async fn rest_json_body_short_malformed_value_rejected_case8_malformed_request() {
       17067  +
    #[::tracing_test::traced_test]
       17068  +
    async fn rest_json_query_byte_malformed_value_rejected_case0_malformed_request() {
22110  17069   
        {
22111  17070   
            #[allow(unused_mut)]
22112  17071   
            let mut http_request = http::Request::builder()
22113         -
                .uri("/MalformedShort/1")
       17072  +
                .uri("/MalformedByte/1")
22114  17073   
                .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         -
                ))
       17074  +
                .body(::aws_smithy_http_server::body::Body::empty())
22119  17075   
                .unwrap();
       17076  +
            *http_request.uri_mut() = "/MalformedByte/1?byteInQuery=true".parse().unwrap();
22120  17077   
            #[allow(unused_mut)]
22121  17078   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
22122  17079   
            let config = crate::service::RestJsonConfig::builder().build();
22123  17080   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
22124         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       17081  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
22125  17082   
                                let sender = sender.clone();
22126  17083   
                                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> };
       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> };
22128  17085   
                                    sender.send(()).await.expect("receiver dropped early");
22129  17086   
                                    result
22130  17087   
                                }
22131  17088   
                            })
22132  17089   
                            .build_unchecked();
22133  17090   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
22134  17091   
                .await
22135  17092   
                .expect("unable to make an HTTP request");
22136  17093   
            ::pretty_assertions::assert_eq!(
22137  17094   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
22138  17095   
                http_response.status()
22139  17096   
            );
22140  17097   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
22141  17098   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
22142  17099   
                http_response.headers(),
22143  17100   
                expected_headers,
22144  17101   
            ));
22145  17102   
        }
22146  17103   
    }
22147         -
    /// Malformed values in the body should be rejected
22148         -
    /// Test ID: RestJsonBodyShortMalformedValueRejected_case9
       17104  +
    /// Malformed values in query parameters should be rejected
       17105  +
    /// Test ID: RestJsonQueryByteMalformedValueRejected_case1
22149  17106   
    #[::tokio::test]
22150         -
    async fn rest_json_body_short_malformed_value_rejected_case9_malformed_request() {
       17107  +
    #[::tracing_test::traced_test]
       17108  +
    async fn rest_json_query_byte_malformed_value_rejected_case1_malformed_request() {
22151  17109   
        {
22152  17110   
            #[allow(unused_mut)]
22153  17111   
            let mut http_request = http::Request::builder()
22154         -
                .uri("/MalformedShort/1")
       17112  +
                .uri("/MalformedByte/1")
22155  17113   
                .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         -
                ))
       17114  +
                .body(::aws_smithy_http_server::body::Body::empty())
22160  17115   
                .unwrap();
       17116  +
            *http_request.uri_mut() = "/MalformedByte/1?byteInQuery=1.001".parse().unwrap();
22161  17117   
            #[allow(unused_mut)]
22162  17118   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
22163  17119   
            let config = crate::service::RestJsonConfig::builder().build();
22164  17120   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
22165         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       17121  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
22166  17122   
                                let sender = sender.clone();
22167  17123   
                                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> };
       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> };
22169  17125   
                                    sender.send(()).await.expect("receiver dropped early");
22170  17126   
                                    result
22171  17127   
                                }
22172  17128   
                            })
22173  17129   
                            .build_unchecked();
22174  17130   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
22175  17131   
                .await
22176  17132   
                .expect("unable to make an HTTP request");
22177  17133   
            ::pretty_assertions::assert_eq!(
22178  17134   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
22179  17135   
                http_response.status()
22180  17136   
            );
22181  17137   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
22182  17138   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
22183  17139   
                http_response.headers(),
22184  17140   
                expected_headers,
22185  17141   
            ));
22186  17142   
        }
22187  17143   
    }
22188         -
    /// Malformed values in the body should be rejected
22189         -
    /// Test ID: RestJsonBodyShortMalformedValueRejected_case10
       17144  +
    /// Malformed values in query parameters should be rejected
       17145  +
    /// Test ID: RestJsonQueryByteMalformedValueRejected_case2
22190  17146   
    #[::tokio::test]
22191         -
    async fn rest_json_body_short_malformed_value_rejected_case10_malformed_request() {
       17147  +
    #[::tracing_test::traced_test]
       17148  +
    async fn rest_json_query_byte_malformed_value_rejected_case2_malformed_request() {
22192  17149   
        {
22193  17150   
            #[allow(unused_mut)]
22194  17151   
            let mut http_request = http::Request::builder()
22195         -
                .uri("/MalformedShort/1")
       17152  +
                .uri("/MalformedByte/1")
22196  17153   
                .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         -
                ))
       17154  +
                .body(::aws_smithy_http_server::body::Body::empty())
22201  17155   
                .unwrap();
       17156  +
            *http_request.uri_mut() = "/MalformedByte/1?byteInQuery=2ABC".parse().unwrap();
22202  17157   
            #[allow(unused_mut)]
22203  17158   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
22204  17159   
            let config = crate::service::RestJsonConfig::builder().build();
22205  17160   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
22206         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       17161  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
22207  17162   
                                let sender = sender.clone();
22208  17163   
                                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> };
       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> };
22210  17165   
                                    sender.send(()).await.expect("receiver dropped early");
22211  17166   
                                    result
22212  17167   
                                }
22213  17168   
                            })
22214  17169   
                            .build_unchecked();
22215  17170   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
22216  17171   
                .await
22217  17172   
                .expect("unable to make an HTTP request");
22218  17173   
            ::pretty_assertions::assert_eq!(
22219  17174   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
22220  17175   
                http_response.status()
22221  17176   
            );
22222  17177   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
22223  17178   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
22224  17179   
                http_response.headers(),
22225  17180   
                expected_headers,
22226  17181   
            ));
22227  17182   
        }
22228  17183   
    }
22229         -
    /// Malformed values in the path should be rejected
22230         -
    /// Test ID: RestJsonPathShortMalformedValueRejected_case0
       17184  +
    /// Malformed values in query parameters should be rejected
       17185  +
    /// Test ID: RestJsonQueryByteMalformedValueRejected_case3
22231  17186   
    #[::tokio::test]
22232         -
    async fn rest_json_path_short_malformed_value_rejected_case0_malformed_request() {
       17187  +
    #[::tracing_test::traced_test]
       17188  +
    async fn rest_json_query_byte_malformed_value_rejected_case3_malformed_request() {
22233  17189   
        {
22234  17190   
            #[allow(unused_mut)]
22235  17191   
            let mut http_request = http::Request::builder()
22236         -
                .uri("/MalformedShort/true")
       17192  +
                .uri("/MalformedByte/1")
22237  17193   
                .method("POST")
22238  17194   
                .body(::aws_smithy_http_server::body::Body::empty())
22239  17195   
                .unwrap();
       17196  +
            *http_request.uri_mut() = "/MalformedByte/1?byteInQuery=0x42".parse().unwrap();
22240  17197   
            #[allow(unused_mut)]
22241  17198   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
22242  17199   
            let config = crate::service::RestJsonConfig::builder().build();
22243  17200   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
22244         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       17201  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
22245  17202   
                                let sender = sender.clone();
22246  17203   
                                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> };
       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> };
22248  17205   
                                    sender.send(()).await.expect("receiver dropped early");
22249  17206   
                                    result
22250  17207   
                                }
22251  17208   
                            })
22252  17209   
                            .build_unchecked();
22253  17210   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
22254  17211   
                .await
22255  17212   
                .expect("unable to make an HTTP request");
22256  17213   
            ::pretty_assertions::assert_eq!(
22257  17214   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
22258  17215   
                http_response.status()
22259  17216   
            );
22260  17217   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
22261  17218   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
22262  17219   
                http_response.headers(),
22263  17220   
                expected_headers,
22264  17221   
            ));
22265  17222   
        }
22266  17223   
    }
22267         -
    /// Malformed values in the path should be rejected
22268         -
    /// Test ID: RestJsonPathShortMalformedValueRejected_case1
       17224  +
    /// Malformed values in query parameters should be rejected
       17225  +
    /// Test ID: RestJsonQueryByteMalformedValueRejected_case4
22269  17226   
    #[::tokio::test]
22270         -
    async fn rest_json_path_short_malformed_value_rejected_case1_malformed_request() {
       17227  +
    #[::tracing_test::traced_test]
       17228  +
    async fn rest_json_query_byte_malformed_value_rejected_case4_malformed_request() {
22271  17229   
        {
22272  17230   
            #[allow(unused_mut)]
22273  17231   
            let mut http_request = http::Request::builder()
22274         -
                .uri("/MalformedShort/1.001")
       17232  +
                .uri("/MalformedByte/1")
22275  17233   
                .method("POST")
22276  17234   
                .body(::aws_smithy_http_server::body::Body::empty())
22277  17235   
                .unwrap();
       17236  +
            *http_request.uri_mut() = "/MalformedByte/1?byteInQuery=Infinity".parse().unwrap();
22278  17237   
            #[allow(unused_mut)]
22279  17238   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
22280  17239   
            let config = crate::service::RestJsonConfig::builder().build();
22281  17240   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
22282         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       17241  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
22283  17242   
                                let sender = sender.clone();
22284  17243   
                                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> };
       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> };
22286  17245   
                                    sender.send(()).await.expect("receiver dropped early");
22287  17246   
                                    result
22288  17247   
                                }
22289  17248   
                            })
22290  17249   
                            .build_unchecked();
22291  17250   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
22292  17251   
                .await
22293  17252   
                .expect("unable to make an HTTP request");
22294  17253   
            ::pretty_assertions::assert_eq!(
22295  17254   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
22296  17255   
                http_response.status()
22297  17256   
            );
22298  17257   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
22299  17258   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
22300  17259   
                http_response.headers(),
22301  17260   
                expected_headers,
22302  17261   
            ));
22303  17262   
        }
22304  17263   
    }
22305         -
    /// Malformed values in the path should be rejected
22306         -
    /// Test ID: RestJsonPathShortMalformedValueRejected_case2
       17264  +
    /// Malformed values in query parameters should be rejected
       17265  +
    /// Test ID: RestJsonQueryByteMalformedValueRejected_case5
22307  17266   
    #[::tokio::test]
22308         -
    async fn rest_json_path_short_malformed_value_rejected_case2_malformed_request() {
       17267  +
    #[::tracing_test::traced_test]
       17268  +
    async fn rest_json_query_byte_malformed_value_rejected_case5_malformed_request() {
22309  17269   
        {
22310  17270   
            #[allow(unused_mut)]
22311  17271   
            let mut http_request = http::Request::builder()
22312         -
                .uri("/MalformedShort/2ABC")
       17272  +
                .uri("/MalformedByte/1")
22313  17273   
                .method("POST")
22314  17274   
                .body(::aws_smithy_http_server::body::Body::empty())
22315  17275   
                .unwrap();
       17276  +
            *http_request.uri_mut() = "/MalformedByte/1?byteInQuery=-Infinity".parse().unwrap();
22316  17277   
            #[allow(unused_mut)]
22317  17278   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
22318  17279   
            let config = crate::service::RestJsonConfig::builder().build();
22319  17280   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
22320         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       17281  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
22321  17282   
                                let sender = sender.clone();
22322  17283   
                                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> };
       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> };
22324  17285   
                                    sender.send(()).await.expect("receiver dropped early");
22325  17286   
                                    result
22326  17287   
                                }
22327  17288   
                            })
22328  17289   
                            .build_unchecked();
22329  17290   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
22330  17291   
                .await
22331  17292   
                .expect("unable to make an HTTP request");
22332  17293   
            ::pretty_assertions::assert_eq!(
22333  17294   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
22334  17295   
                http_response.status()
22335  17296   
            );
22336  17297   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
22337  17298   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
22338  17299   
                http_response.headers(),
22339  17300   
                expected_headers,
22340  17301   
            ));
22341  17302   
        }
22342  17303   
    }
22343         -
    /// Malformed values in the path should be rejected
22344         -
    /// Test ID: RestJsonPathShortMalformedValueRejected_case3
       17304  +
    /// Malformed values in query parameters should be rejected
       17305  +
    /// Test ID: RestJsonQueryByteMalformedValueRejected_case6
22345  17306   
    #[::tokio::test]
22346         -
    async fn rest_json_path_short_malformed_value_rejected_case3_malformed_request() {
       17307  +
    #[::tracing_test::traced_test]
       17308  +
    async fn rest_json_query_byte_malformed_value_rejected_case6_malformed_request() {
22347  17309   
        {
22348  17310   
            #[allow(unused_mut)]
22349  17311   
            let mut http_request = http::Request::builder()
22350         -
                .uri("/MalformedShort/0x42")
       17312  +
                .uri("/MalformedByte/1")
22351  17313   
                .method("POST")
22352  17314   
                .body(::aws_smithy_http_server::body::Body::empty())
22353  17315   
                .unwrap();
       17316  +
            *http_request.uri_mut() = "/MalformedByte/1?byteInQuery=NaN".parse().unwrap();
22354  17317   
            #[allow(unused_mut)]
22355  17318   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
22356  17319   
            let config = crate::service::RestJsonConfig::builder().build();
22357  17320   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
22358         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       17321  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
22359  17322   
                                let sender = sender.clone();
22360  17323   
                                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> };
       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> };
22362  17325   
                                    sender.send(()).await.expect("receiver dropped early");
22363  17326   
                                    result
22364  17327   
                                }
22365  17328   
                            })
22366  17329   
                            .build_unchecked();
22367  17330   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
22368  17331   
                .await
22369  17332   
                .expect("unable to make an HTTP request");
22370  17333   
            ::pretty_assertions::assert_eq!(
22371  17334   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
22372  17335   
                http_response.status()
22373  17336   
            );
22374  17337   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
22375  17338   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
22376  17339   
                http_response.headers(),
22377  17340   
                expected_headers,
22378  17341   
            ));
22379  17342   
        }
22380  17343   
    }
22381         -
    /// Malformed values in the path should be rejected
22382         -
    /// Test ID: RestJsonPathShortMalformedValueRejected_case4
       17344  +
    /// Malformed values in headers should be rejected
       17345  +
    /// Test ID: RestJsonHeaderByteMalformedValueRejected_case0
22383  17346   
    #[::tokio::test]
22384         -
    async fn rest_json_path_short_malformed_value_rejected_case4_malformed_request() {
       17347  +
    #[::tracing_test::traced_test]
       17348  +
    async fn rest_json_header_byte_malformed_value_rejected_case0_malformed_request() {
22385  17349   
        {
22386  17350   
            #[allow(unused_mut)]
22387  17351   
            let mut http_request = http::Request::builder()
22388         -
                .uri("/MalformedShort/Infinity")
       17352  +
                .uri("/MalformedByte/1")
22389  17353   
                .method("POST")
       17354  +
                .header("byteInHeader", "true")
22390  17355   
                .body(::aws_smithy_http_server::body::Body::empty())
22391  17356   
                .unwrap();
22392  17357   
            #[allow(unused_mut)]
22393  17358   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
22394  17359   
            let config = crate::service::RestJsonConfig::builder().build();
22395  17360   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
22396         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       17361  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
22397  17362   
                                let sender = sender.clone();
22398  17363   
                                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> };
       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> };
22400  17365   
                                    sender.send(()).await.expect("receiver dropped early");
22401  17366   
                                    result
22402  17367   
                                }
22403  17368   
                            })
22404  17369   
                            .build_unchecked();
22405  17370   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
22406  17371   
                .await
22407  17372   
                .expect("unable to make an HTTP request");
22408  17373   
            ::pretty_assertions::assert_eq!(
22409  17374   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
22410  17375   
                http_response.status()
22411  17376   
            );
22412  17377   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
22413  17378   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
22414  17379   
                http_response.headers(),
22415  17380   
                expected_headers,
22416  17381   
            ));
22417  17382   
        }
22418  17383   
    }
22419         -
    /// Malformed values in the path should be rejected
22420         -
    /// Test ID: RestJsonPathShortMalformedValueRejected_case5
       17384  +
    /// Malformed values in headers should be rejected
       17385  +
    /// Test ID: RestJsonHeaderByteMalformedValueRejected_case1
22421  17386   
    #[::tokio::test]
22422         -
    async fn rest_json_path_short_malformed_value_rejected_case5_malformed_request() {
       17387  +
    #[::tracing_test::traced_test]
       17388  +
    async fn rest_json_header_byte_malformed_value_rejected_case1_malformed_request() {
22423  17389   
        {
22424  17390   
            #[allow(unused_mut)]
22425  17391   
            let mut http_request = http::Request::builder()
22426         -
                .uri("/MalformedShort/-Infinity")
       17392  +
                .uri("/MalformedByte/1")
22427  17393   
                .method("POST")
       17394  +
                .header("byteInHeader", "1.001")
22428  17395   
                .body(::aws_smithy_http_server::body::Body::empty())
22429  17396   
                .unwrap();
22430  17397   
            #[allow(unused_mut)]
22431  17398   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
22432  17399   
            let config = crate::service::RestJsonConfig::builder().build();
22433  17400   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
22434         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       17401  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
22435  17402   
                                let sender = sender.clone();
22436  17403   
                                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> };
       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> };
22438  17405   
                                    sender.send(()).await.expect("receiver dropped early");
22439  17406   
                                    result
22440  17407   
                                }
22441  17408   
                            })
22442  17409   
                            .build_unchecked();
22443  17410   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
22444  17411   
                .await
22445  17412   
                .expect("unable to make an HTTP request");
22446  17413   
            ::pretty_assertions::assert_eq!(
22447  17414   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
22448  17415   
                http_response.status()
22449  17416   
            );
22450  17417   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
22451  17418   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
22452  17419   
                http_response.headers(),
22453  17420   
                expected_headers,
22454  17421   
            ));
22455  17422   
        }
22456  17423   
    }
22457         -
    /// Malformed values in the path should be rejected
22458         -
    /// Test ID: RestJsonPathShortMalformedValueRejected_case6
       17424  +
    /// Malformed values in headers should be rejected
       17425  +
    /// Test ID: RestJsonHeaderByteMalformedValueRejected_case2
22459  17426   
    #[::tokio::test]
22460         -
    async fn rest_json_path_short_malformed_value_rejected_case6_malformed_request() {
       17427  +
    #[::tracing_test::traced_test]
       17428  +
    async fn rest_json_header_byte_malformed_value_rejected_case2_malformed_request() {
22461  17429   
        {
22462  17430   
            #[allow(unused_mut)]
22463  17431   
            let mut http_request = http::Request::builder()
22464         -
                .uri("/MalformedShort/NaN")
       17432  +
                .uri("/MalformedByte/1")
22465  17433   
                .method("POST")
       17434  +
                .header("byteInHeader", "2ABC")
22466  17435   
                .body(::aws_smithy_http_server::body::Body::empty())
22467  17436   
                .unwrap();
22468  17437   
            #[allow(unused_mut)]
22469  17438   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
22470  17439   
            let config = crate::service::RestJsonConfig::builder().build();
22471  17440   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
22472         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       17441  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
22473  17442   
                                let sender = sender.clone();
22474  17443   
                                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> };
       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> };
22476  17445   
                                    sender.send(()).await.expect("receiver dropped early");
22477  17446   
                                    result
22478  17447   
                                }
22479  17448   
                            })
22480  17449   
                            .build_unchecked();
22481  17450   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
22482  17451   
                .await
22483  17452   
                .expect("unable to make an HTTP request");
22484  17453   
            ::pretty_assertions::assert_eq!(
22485  17454   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
22486  17455   
                http_response.status()
22487  17456   
            );
22488  17457   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
22489  17458   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
22490  17459   
                http_response.headers(),
22491  17460   
                expected_headers,
22492  17461   
            ));
22493  17462   
        }
22494  17463   
    }
22495         -
    /// Malformed values in query parameters should be rejected
22496         -
    /// Test ID: RestJsonQueryShortMalformedValueRejected_case0
       17464  +
    /// Malformed values in headers should be rejected
       17465  +
    /// Test ID: RestJsonHeaderByteMalformedValueRejected_case3
22497  17466   
    #[::tokio::test]
22498         -
    async fn rest_json_query_short_malformed_value_rejected_case0_malformed_request() {
       17467  +
    #[::tracing_test::traced_test]
       17468  +
    async fn rest_json_header_byte_malformed_value_rejected_case3_malformed_request() {
22499  17469   
        {
22500  17470   
            #[allow(unused_mut)]
22501  17471   
            let mut http_request = http::Request::builder()
22502         -
                .uri("/MalformedShort/1")
       17472  +
                .uri("/MalformedByte/1")
22503  17473   
                .method("POST")
       17474  +
                .header("byteInHeader", "0x42")
22504  17475   
                .body(::aws_smithy_http_server::body::Body::empty())
22505  17476   
                .unwrap();
22506         -
            *http_request.uri_mut() = "/MalformedShort/1?shortInQuery=true".parse().unwrap();
22507  17477   
            #[allow(unused_mut)]
22508  17478   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
22509  17479   
            let config = crate::service::RestJsonConfig::builder().build();
22510  17480   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
22511         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       17481  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
22512  17482   
                                let sender = sender.clone();
22513  17483   
                                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> };
       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> };
22515  17485   
                                    sender.send(()).await.expect("receiver dropped early");
22516  17486   
                                    result
22517  17487   
                                }
22518  17488   
                            })
22519  17489   
                            .build_unchecked();
22520  17490   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
22521  17491   
                .await
22522  17492   
                .expect("unable to make an HTTP request");
22523  17493   
            ::pretty_assertions::assert_eq!(
22524  17494   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
22525  17495   
                http_response.status()
22526  17496   
            );
22527  17497   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
22528  17498   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
22529  17499   
                http_response.headers(),
22530  17500   
                expected_headers,
22531  17501   
            ));
22532  17502   
        }
22533  17503   
    }
22534         -
    /// Malformed values in query parameters should be rejected
22535         -
    /// Test ID: RestJsonQueryShortMalformedValueRejected_case1
       17504  +
    /// Malformed values in headers should be rejected
       17505  +
    /// Test ID: RestJsonHeaderByteMalformedValueRejected_case4
22536  17506   
    #[::tokio::test]
22537         -
    async fn rest_json_query_short_malformed_value_rejected_case1_malformed_request() {
       17507  +
    #[::tracing_test::traced_test]
       17508  +
    async fn rest_json_header_byte_malformed_value_rejected_case4_malformed_request() {
22538  17509   
        {
22539  17510   
            #[allow(unused_mut)]
22540  17511   
            let mut http_request = http::Request::builder()
22541         -
                .uri("/MalformedShort/1")
       17512  +
                .uri("/MalformedByte/1")
22542  17513   
                .method("POST")
       17514  +
                .header("byteInHeader", "Infinity")
22543  17515   
                .body(::aws_smithy_http_server::body::Body::empty())
22544  17516   
                .unwrap();
22545         -
            *http_request.uri_mut() = "/MalformedShort/1?shortInQuery=1.001".parse().unwrap();
22546  17517   
            #[allow(unused_mut)]
22547  17518   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
22548  17519   
            let config = crate::service::RestJsonConfig::builder().build();
22549  17520   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
22550         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       17521  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
22551  17522   
                                let sender = sender.clone();
22552  17523   
                                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> };
       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> };
22554  17525   
                                    sender.send(()).await.expect("receiver dropped early");
22555  17526   
                                    result
22556  17527   
                                }
22557  17528   
                            })
22558  17529   
                            .build_unchecked();
22559  17530   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
22560  17531   
                .await
22561  17532   
                .expect("unable to make an HTTP request");
22562  17533   
            ::pretty_assertions::assert_eq!(
22563  17534   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
22564  17535   
                http_response.status()
22565  17536   
            );
22566  17537   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
22567  17538   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
22568  17539   
                http_response.headers(),
22569  17540   
                expected_headers,
22570  17541   
            ));
22571  17542   
        }
22572  17543   
    }
22573         -
    /// Malformed values in query parameters should be rejected
22574         -
    /// Test ID: RestJsonQueryShortMalformedValueRejected_case2
       17544  +
    /// Malformed values in headers should be rejected
       17545  +
    /// Test ID: RestJsonHeaderByteMalformedValueRejected_case5
22575  17546   
    #[::tokio::test]
22576         -
    async fn rest_json_query_short_malformed_value_rejected_case2_malformed_request() {
       17547  +
    #[::tracing_test::traced_test]
       17548  +
    async fn rest_json_header_byte_malformed_value_rejected_case5_malformed_request() {
22577  17549   
        {
22578  17550   
            #[allow(unused_mut)]
22579  17551   
            let mut http_request = http::Request::builder()
22580         -
                .uri("/MalformedShort/1")
       17552  +
                .uri("/MalformedByte/1")
22581  17553   
                .method("POST")
       17554  +
                .header("byteInHeader", "-Infinity")
22582  17555   
                .body(::aws_smithy_http_server::body::Body::empty())
22583  17556   
                .unwrap();
22584         -
            *http_request.uri_mut() = "/MalformedShort/1?shortInQuery=2ABC".parse().unwrap();
22585  17557   
            #[allow(unused_mut)]
22586  17558   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
22587  17559   
            let config = crate::service::RestJsonConfig::builder().build();
22588  17560   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
22589         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       17561  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
22590  17562   
                                let sender = sender.clone();
22591  17563   
                                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> };
       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> };
22593  17565   
                                    sender.send(()).await.expect("receiver dropped early");
22594  17566   
                                    result
22595  17567   
                                }
22596  17568   
                            })
22597  17569   
                            .build_unchecked();
22598  17570   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
22599  17571   
                .await
22600  17572   
                .expect("unable to make an HTTP request");
22601  17573   
            ::pretty_assertions::assert_eq!(
22602  17574   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
22603  17575   
                http_response.status()
22604  17576   
            );
22605  17577   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
22606  17578   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
22607  17579   
                http_response.headers(),
22608  17580   
                expected_headers,
22609  17581   
            ));
22610  17582   
        }
22611  17583   
    }
22612         -
    /// Malformed values in query parameters should be rejected
22613         -
    /// Test ID: RestJsonQueryShortMalformedValueRejected_case3
       17584  +
    /// Malformed values in headers should be rejected
       17585  +
    /// Test ID: RestJsonHeaderByteMalformedValueRejected_case6
22614  17586   
    #[::tokio::test]
22615         -
    async fn rest_json_query_short_malformed_value_rejected_case3_malformed_request() {
       17587  +
    #[::tracing_test::traced_test]
       17588  +
    async fn rest_json_header_byte_malformed_value_rejected_case6_malformed_request() {
22616  17589   
        {
22617  17590   
            #[allow(unused_mut)]
22618  17591   
            let mut http_request = http::Request::builder()
22619         -
                .uri("/MalformedShort/1")
       17592  +
                .uri("/MalformedByte/1")
22620  17593   
                .method("POST")
       17594  +
                .header("byteInHeader", "NaN")
22621  17595   
                .body(::aws_smithy_http_server::body::Body::empty())
22622  17596   
                .unwrap();
22623         -
            *http_request.uri_mut() = "/MalformedShort/1?shortInQuery=0x42".parse().unwrap();
22624  17597   
            #[allow(unused_mut)]
22625  17598   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
22626  17599   
            let config = crate::service::RestJsonConfig::builder().build();
22627  17600   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
22628         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       17601  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
22629  17602   
                                let sender = sender.clone();
22630  17603   
                                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> };
       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> };
22632  17605   
                                    sender.send(()).await.expect("receiver dropped early");
22633  17606   
                                    result
22634  17607   
                                }
22635  17608   
                            })
22636  17609   
                            .build_unchecked();
22637  17610   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
22638  17611   
                .await
22639  17612   
                .expect("unable to make an HTTP request");
22640  17613   
            ::pretty_assertions::assert_eq!(
22641  17614   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
22642  17615   
                http_response.status()
22643  17616   
            );
22644  17617   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
22645  17618   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
22646  17619   
                http_response.headers(),
22647  17620   
                expected_headers,
22648  17621   
            ));
22649  17622   
        }
22650  17623   
    }
22651         -
    /// Malformed values in query parameters should be rejected
22652         -
    /// Test ID: RestJsonQueryShortMalformedValueRejected_case4
       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
22653  17715   
    #[::tokio::test]
22654         -
    async fn rest_json_query_short_malformed_value_rejected_case4_malformed_request() {
       17716  +
    #[::tracing_test::traced_test]
       17717  +
    async fn rest_json_body_malformed_blob_invalid_base64_case0_malformed_request() {
22655  17718   
        {
22656  17719   
            #[allow(unused_mut)]
22657  17720   
            let mut http_request = http::Request::builder()
22658         -
                .uri("/MalformedShort/1")
       17721  +
                .uri("/MalformedBlob")
22659  17722   
                .method("POST")
22660         -
                .body(::aws_smithy_http_server::body::Body::empty())
       17723  +
                .header("content-type", "application/json")
       17724  +
                .body(::aws_smithy_http_server::body::Body::from(
       17725  +
                    ::bytes::Bytes::from_static("{ \"blob\" : blob }".as_bytes()),
       17726  +
                ))
22661  17727   
                .unwrap();
22662         -
            *http_request.uri_mut() = "/MalformedShort/1?shortInQuery=Infinity".parse().unwrap();
22663  17728   
            #[allow(unused_mut)]
22664  17729   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
22665  17730   
            let config = crate::service::RestJsonConfig::builder().build();
22666  17731   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
22667         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       17732  +
                            .malformed_blob(move |input: crate::input::MalformedBlobInput| {
22668  17733   
                                let sender = sender.clone();
22669  17734   
                                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> };
       17735  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedBlobOutput };
22671  17736   
                                    sender.send(()).await.expect("receiver dropped early");
22672  17737   
                                    result
22673  17738   
                                }
22674  17739   
                            })
22675  17740   
                            .build_unchecked();
22676  17741   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
22677  17742   
                .await
22678  17743   
                .expect("unable to make an HTTP request");
22679  17744   
            ::pretty_assertions::assert_eq!(
22680  17745   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
22681  17746   
                http_response.status()
22682  17747   
            );
22683  17748   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
22684  17749   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
22685  17750   
                http_response.headers(),
22686  17751   
                expected_headers,
22687  17752   
            ));
22688  17753   
        }
22689  17754   
    }
22690         -
    /// Malformed values in query parameters should be rejected
22691         -
    /// Test ID: RestJsonQueryShortMalformedValueRejected_case5
       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
22692  17758   
    #[::tokio::test]
22693         -
    async fn rest_json_query_short_malformed_value_rejected_case5_malformed_request() {
       17759  +
    #[::tracing_test::traced_test]
       17760  +
    async fn rest_json_body_malformed_blob_invalid_base64_case1_malformed_request() {
22694  17761   
        {
22695  17762   
            #[allow(unused_mut)]
22696  17763   
            let mut http_request = http::Request::builder()
22697         -
                .uri("/MalformedShort/1")
       17764  +
                .uri("/MalformedBlob")
22698  17765   
                .method("POST")
22699         -
                .body(::aws_smithy_http_server::body::Body::empty())
       17766  +
                .header("content-type", "application/json")
       17767  +
                .body(::aws_smithy_http_server::body::Body::from(
       17768  +
                    ::bytes::Bytes::from_static("{ \"blob\" : \"xyz\" }".as_bytes()),
       17769  +
                ))
22700  17770   
                .unwrap();
22701         -
            *http_request.uri_mut() = "/MalformedShort/1?shortInQuery=-Infinity".parse().unwrap();
22702  17771   
            #[allow(unused_mut)]
22703  17772   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
22704  17773   
            let config = crate::service::RestJsonConfig::builder().build();
22705  17774   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
22706         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       17775  +
                            .malformed_blob(move |input: crate::input::MalformedBlobInput| {
22707  17776   
                                let sender = sender.clone();
22708  17777   
                                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> };
       17778  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedBlobOutput };
22710  17779   
                                    sender.send(()).await.expect("receiver dropped early");
22711  17780   
                                    result
22712  17781   
                                }
22713  17782   
                            })
22714  17783   
                            .build_unchecked();
22715  17784   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
22716  17785   
                .await
22717  17786   
                .expect("unable to make an HTTP request");
22718  17787   
            ::pretty_assertions::assert_eq!(
22719  17788   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
22720  17789   
                http_response.status()
22721  17790   
            );
22722  17791   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
22723  17792   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
22724  17793   
                http_response.headers(),
22725  17794   
                expected_headers,
22726  17795   
            ));
22727  17796   
        }
22728  17797   
    }
22729         -
    /// Malformed values in query parameters should be rejected
22730         -
    /// Test ID: RestJsonQueryShortMalformedValueRejected_case6
       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
22731  17801   
    #[::tokio::test]
22732         -
    async fn rest_json_query_short_malformed_value_rejected_case6_malformed_request() {
       17802  +
    #[::tracing_test::traced_test]
       17803  +
    async fn rest_json_body_malformed_blob_invalid_base64_case2_malformed_request() {
22733  17804   
        {
22734  17805   
            #[allow(unused_mut)]
22735  17806   
            let mut http_request = http::Request::builder()
22736         -
                .uri("/MalformedShort/1")
       17807  +
                .uri("/MalformedBlob")
22737  17808   
                .method("POST")
22738         -
                .body(::aws_smithy_http_server::body::Body::empty())
       17809  +
                .header("content-type", "application/json")
       17810  +
                .body(::aws_smithy_http_server::body::Body::from(
       17811  +
                    ::bytes::Bytes::from_static("{ \"blob\" : \"YmxvYg=\" }".as_bytes()),
       17812  +
                ))
22739  17813   
                .unwrap();
22740         -
            *http_request.uri_mut() = "/MalformedShort/1?shortInQuery=NaN".parse().unwrap();
22741  17814   
            #[allow(unused_mut)]
22742  17815   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
22743  17816   
            let config = crate::service::RestJsonConfig::builder().build();
22744  17817   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
22745         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       17818  +
                            .malformed_blob(move |input: crate::input::MalformedBlobInput| {
22746  17819   
                                let sender = sender.clone();
22747  17820   
                                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> };
       17821  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedBlobOutput };
22749  17822   
                                    sender.send(()).await.expect("receiver dropped early");
22750  17823   
                                    result
22751  17824   
                                }
22752  17825   
                            })
22753  17826   
                            .build_unchecked();
22754  17827   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
22755  17828   
                .await
22756  17829   
                .expect("unable to make an HTTP request");
22757  17830   
            ::pretty_assertions::assert_eq!(
22758  17831   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
22759  17832   
                http_response.status()
22760  17833   
            );
22761  17834   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
22762  17835   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
22763  17836   
                http_response.headers(),
22764  17837   
                expected_headers,
22765  17838   
            ));
22766  17839   
        }
22767  17840   
    }
22768         -
    /// Malformed values in headers should be rejected
22769         -
    /// Test ID: RestJsonHeaderShortMalformedValueRejected_case0
       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
22770  17844   
    #[::tokio::test]
22771         -
    async fn rest_json_header_short_malformed_value_rejected_case0_malformed_request() {
       17845  +
    #[::tracing_test::traced_test]
       17846  +
    async fn rest_json_body_malformed_blob_invalid_base64_case3_malformed_request() {
22772  17847   
        {
22773  17848   
            #[allow(unused_mut)]
22774  17849   
            let mut http_request = http::Request::builder()
22775         -
                .uri("/MalformedShort/1")
       17850  +
                .uri("/MalformedBlob")
22776  17851   
                .method("POST")
22777         -
                .header("shortInHeader", "true")
22778         -
                .body(::aws_smithy_http_server::body::Body::empty())
       17852  +
                .header("content-type", "application/json")
       17853  +
                .body(::aws_smithy_http_server::body::Body::from(
       17854  +
                    ::bytes::Bytes::from_static("{ \"blob\" : [98, 108, 11, 98] }".as_bytes()),
       17855  +
                ))
22779  17856   
                .unwrap();
22780  17857   
            #[allow(unused_mut)]
22781  17858   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
22782  17859   
            let config = crate::service::RestJsonConfig::builder().build();
22783  17860   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
22784         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       17861  +
                            .malformed_blob(move |input: crate::input::MalformedBlobInput| {
22785  17862   
                                let sender = sender.clone();
22786  17863   
                                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> };
       17864  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedBlobOutput };
22788  17865   
                                    sender.send(()).await.expect("receiver dropped early");
22789  17866   
                                    result
22790  17867   
                                }
22791  17868   
                            })
22792  17869   
                            .build_unchecked();
22793  17870   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
22794  17871   
                .await
22795  17872   
                .expect("unable to make an HTTP request");
22796  17873   
            ::pretty_assertions::assert_eq!(
22797  17874   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
22798  17875   
                http_response.status()
22799  17876   
            );
22800  17877   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
22801  17878   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
22802  17879   
                http_response.headers(),
22803  17880   
                expected_headers,
22804  17881   
            ));
22805  17882   
        }
22806  17883   
    }
22807         -
    /// Malformed values in headers should be rejected
22808         -
    /// Test ID: RestJsonHeaderShortMalformedValueRejected_case1
       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
22809  17887   
    #[::tokio::test]
22810         -
    async fn rest_json_header_short_malformed_value_rejected_case1_malformed_request() {
       17888  +
    #[::tracing_test::traced_test]
       17889  +
    async fn rest_json_body_malformed_blob_invalid_base64_case4_malformed_request() {
22811  17890   
        {
22812  17891   
            #[allow(unused_mut)]
22813  17892   
            let mut http_request = http::Request::builder()
22814         -
                .uri("/MalformedShort/1")
       17893  +
                .uri("/MalformedBlob")
22815  17894   
                .method("POST")
22816         -
                .header("shortInHeader", "1.001")
22817         -
                .body(::aws_smithy_http_server::body::Body::empty())
       17895  +
                .header("content-type", "application/json")
       17896  +
                .body(::aws_smithy_http_server::body::Body::from(
       17897  +
                    ::bytes::Bytes::from_static(
       17898  +
                        "{ \"blob\" : [\"b\", \"l\",\"o\",\"b\"] }".as_bytes(),
       17899  +
                    ),
       17900  +
                ))
22818  17901   
                .unwrap();
22819  17902   
            #[allow(unused_mut)]
22820  17903   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
22821  17904   
            let config = crate::service::RestJsonConfig::builder().build();
22822  17905   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
22823         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       17906  +
                            .malformed_blob(move |input: crate::input::MalformedBlobInput| {
22824  17907   
                                let sender = sender.clone();
22825  17908   
                                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> };
       17909  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedBlobOutput };
22827  17910   
                                    sender.send(()).await.expect("receiver dropped early");
22828  17911   
                                    result
22829  17912   
                                }
22830  17913   
                            })
22831  17914   
                            .build_unchecked();
22832  17915   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
22833  17916   
                .await
22834  17917   
                .expect("unable to make an HTTP request");
22835  17918   
            ::pretty_assertions::assert_eq!(
22836  17919   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
22837  17920   
                http_response.status()
22838  17921   
            );
22839  17922   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
22840  17923   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
22841  17924   
                http_response.headers(),
22842  17925   
                expected_headers,
22843  17926   
            ));
22844  17927   
        }
22845  17928   
    }
22846         -
    /// Malformed values in headers should be rejected
22847         -
    /// Test ID: RestJsonHeaderShortMalformedValueRejected_case2
       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
22848  17932   
    #[::tokio::test]
22849         -
    async fn rest_json_header_short_malformed_value_rejected_case2_malformed_request() {
       17933  +
    #[::tracing_test::traced_test]
       17934  +
    async fn rest_json_body_malformed_blob_invalid_base64_case5_malformed_request() {
22850  17935   
        {
22851  17936   
            #[allow(unused_mut)]
22852  17937   
            let mut http_request = http::Request::builder()
22853         -
                .uri("/MalformedShort/1")
       17938  +
                .uri("/MalformedBlob")
22854  17939   
                .method("POST")
22855         -
                .header("shortInHeader", "2ABC")
22856         -
                .body(::aws_smithy_http_server::body::Body::empty())
       17940  +
                .header("content-type", "application/json")
       17941  +
                .body(::aws_smithy_http_server::body::Body::from(
       17942  +
                    ::bytes::Bytes::from_static("{ \"blob\" : 981081198 }".as_bytes()),
       17943  +
                ))
22857  17944   
                .unwrap();
22858  17945   
            #[allow(unused_mut)]
22859  17946   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
22860  17947   
            let config = crate::service::RestJsonConfig::builder().build();
22861  17948   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
22862         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       17949  +
                            .malformed_blob(move |input: crate::input::MalformedBlobInput| {
22863  17950   
                                let sender = sender.clone();
22864  17951   
                                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> };
       17952  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedBlobOutput };
22866  17953   
                                    sender.send(()).await.expect("receiver dropped early");
22867  17954   
                                    result
22868  17955   
                                }
22869  17956   
                            })
22870  17957   
                            .build_unchecked();
22871  17958   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
22872  17959   
                .await
22873  17960   
                .expect("unable to make an HTTP request");
22874  17961   
            ::pretty_assertions::assert_eq!(
22875  17962   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
22876  17963   
                http_response.status()
22877  17964   
            );
22878  17965   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
22879  17966   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
22880  17967   
                http_response.headers(),
22881  17968   
                expected_headers,
22882  17969   
            ));
22883  17970   
        }
22884  17971   
    }
22885         -
    /// Malformed values in headers should be rejected
22886         -
    /// Test ID: RestJsonHeaderShortMalformedValueRejected_case3
       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
22887  17975   
    #[::tokio::test]
22888         -
    async fn rest_json_header_short_malformed_value_rejected_case3_malformed_request() {
       17976  +
    #[::tracing_test::traced_test]
       17977  +
    async fn rest_json_body_malformed_blob_invalid_base64_case6_malformed_request() {
22889  17978   
        {
22890  17979   
            #[allow(unused_mut)]
22891  17980   
            let mut http_request = http::Request::builder()
22892         -
                .uri("/MalformedShort/1")
       17981  +
                .uri("/MalformedBlob")
22893  17982   
                .method("POST")
22894         -
                .header("shortInHeader", "0x42")
22895         -
                .body(::aws_smithy_http_server::body::Body::empty())
       17983  +
                .header("content-type", "application/json")
       17984  +
                .body(::aws_smithy_http_server::body::Body::from(
       17985  +
                    ::bytes::Bytes::from_static("{ \"blob\" : true }".as_bytes()),
       17986  +
                ))
22896  17987   
                .unwrap();
22897  17988   
            #[allow(unused_mut)]
22898  17989   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
22899  17990   
            let config = crate::service::RestJsonConfig::builder().build();
22900  17991   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
22901         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       17992  +
                            .malformed_blob(move |input: crate::input::MalformedBlobInput| {
22902  17993   
                                let sender = sender.clone();
22903  17994   
                                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> };
       17995  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedBlobOutput };
22905  17996   
                                    sender.send(()).await.expect("receiver dropped early");
22906  17997   
                                    result
22907  17998   
                                }
22908  17999   
                            })
22909  18000   
                            .build_unchecked();
22910  18001   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
22911  18002   
                .await
22912  18003   
                .expect("unable to make an HTTP request");
22913  18004   
            ::pretty_assertions::assert_eq!(
22914  18005   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
22915  18006   
                http_response.status()
22916  18007   
            );
22917  18008   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
22918  18009   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
22919  18010   
                http_response.headers(),
22920  18011   
                expected_headers,
22921  18012   
            ));
22922  18013   
        }
22923  18014   
    }
22924         -
    /// Malformed values in headers should be rejected
22925         -
    /// Test ID: RestJsonHeaderShortMalformedValueRejected_case4
       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
22926  18018   
    #[::tokio::test]
22927         -
    async fn rest_json_header_short_malformed_value_rejected_case4_malformed_request() {
       18019  +
    #[::tracing_test::traced_test]
       18020  +
    async fn rest_json_body_malformed_blob_invalid_base64_case7_malformed_request() {
22928  18021   
        {
22929  18022   
            #[allow(unused_mut)]
22930  18023   
            let mut http_request = http::Request::builder()
22931         -
                .uri("/MalformedShort/1")
       18024  +
                .uri("/MalformedBlob")
22932  18025   
                .method("POST")
22933         -
                .header("shortInHeader", "Infinity")
22934         -
                .body(::aws_smithy_http_server::body::Body::empty())
       18026  +
                .header("content-type", "application/json")
       18027  +
                .body(::aws_smithy_http_server::body::Body::from(
       18028  +
                    ::bytes::Bytes::from_static("{ \"blob\" : [][] }".as_bytes()),
       18029  +
                ))
22935  18030   
                .unwrap();
22936  18031   
            #[allow(unused_mut)]
22937  18032   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
22938  18033   
            let config = crate::service::RestJsonConfig::builder().build();
22939  18034   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
22940         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       18035  +
                            .malformed_blob(move |input: crate::input::MalformedBlobInput| {
22941  18036   
                                let sender = sender.clone();
22942  18037   
                                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> };
       18038  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedBlobOutput };
22944  18039   
                                    sender.send(()).await.expect("receiver dropped early");
22945  18040   
                                    result
22946  18041   
                                }
22947  18042   
                            })
22948  18043   
                            .build_unchecked();
22949  18044   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
22950  18045   
                .await
22951  18046   
                .expect("unable to make an HTTP request");
22952  18047   
            ::pretty_assertions::assert_eq!(
22953  18048   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
22954  18049   
                http_response.status()
22955  18050   
            );
22956  18051   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
22957  18052   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
22958  18053   
                http_response.headers(),
22959  18054   
                expected_headers,
22960  18055   
            ));
22961  18056   
        }
22962  18057   
    }
22963         -
    /// Malformed values in headers should be rejected
22964         -
    /// Test ID: RestJsonHeaderShortMalformedValueRejected_case5
       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
22965  18061   
    #[::tokio::test]
22966         -
    async fn rest_json_header_short_malformed_value_rejected_case5_malformed_request() {
       18062  +
    #[::tracing_test::traced_test]
       18063  +
    async fn rest_json_body_malformed_blob_invalid_base64_case8_malformed_request() {
22967  18064   
        {
22968  18065   
            #[allow(unused_mut)]
22969  18066   
            let mut http_request = http::Request::builder()
22970         -
                .uri("/MalformedShort/1")
       18067  +
                .uri("/MalformedBlob")
22971  18068   
                .method("POST")
22972         -
                .header("shortInHeader", "-Infinity")
22973         -
                .body(::aws_smithy_http_server::body::Body::empty())
       18069  +
                .header("content-type", "application/json")
       18070  +
                .body(::aws_smithy_http_server::body::Body::from(
       18071  +
                    ::bytes::Bytes::from_static("{ \"blob\" : -_== }".as_bytes()),
       18072  +
                ))
22974  18073   
                .unwrap();
22975  18074   
            #[allow(unused_mut)]
22976  18075   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
22977  18076   
            let config = crate::service::RestJsonConfig::builder().build();
22978  18077   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
22979         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       18078  +
                            .malformed_blob(move |input: crate::input::MalformedBlobInput| {
22980  18079   
                                let sender = sender.clone();
22981  18080   
                                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> };
       18081  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedBlobOutput };
22983  18082   
                                    sender.send(()).await.expect("receiver dropped early");
22984  18083   
                                    result
22985  18084   
                                }
22986  18085   
                            })
22987  18086   
                            .build_unchecked();
22988  18087   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
22989  18088   
                .await
22990  18089   
                .expect("unable to make an HTTP request");
22991  18090   
            ::pretty_assertions::assert_eq!(
22992  18091   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
22993  18092   
                http_response.status()
22994  18093   
            );
22995  18094   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
22996  18095   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
22997  18096   
                http_response.headers(),
22998  18097   
                expected_headers,
22999  18098   
            ));
23000  18099   
        }
23001  18100   
    }
23002         -
    /// Malformed values in headers should be rejected
23003         -
    /// Test ID: RestJsonHeaderShortMalformedValueRejected_case6
       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
23004  18192   
    #[::tokio::test]
23005         -
    async fn rest_json_header_short_malformed_value_rejected_case6_malformed_request() {
       18193  +
    #[::tracing_test::traced_test]
       18194  +
    async fn rest_json_body_malformed_map_null_key_malformed_request() {
23006  18195   
        {
23007  18196   
            #[allow(unused_mut)]
23008  18197   
            let mut http_request = http::Request::builder()
23009         -
                .uri("/MalformedShort/1")
       18198  +
                .uri("/MalformedMap")
23010  18199   
                .method("POST")
23011         -
                .header("shortInHeader", "NaN")
23012         -
                .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  +
                ))
23013  18204   
                .unwrap();
23014  18205   
            #[allow(unused_mut)]
23015  18206   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
23016  18207   
            let config = crate::service::RestJsonConfig::builder().build();
23017  18208   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
23018         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       18209  +
                            .malformed_map(move |input: crate::input::MalformedMapInput| {
23019  18210   
                                let sender = sender.clone();
23020  18211   
                                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> };
       18212  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedMapOutput };
23022  18213   
                                    sender.send(()).await.expect("receiver dropped early");
23023  18214   
                                    result
23024  18215   
                                }
23025  18216   
                            })
23026  18217   
                            .build_unchecked();
23027  18218   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
23028  18219   
                .await
23029  18220   
                .expect("unable to make an HTTP request");
23030  18221   
            ::pretty_assertions::assert_eq!(
23031  18222   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
23032  18223   
                http_response.status()
23033  18224   
            );
23034  18225   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
23035  18226   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
23036  18227   
                http_response.headers(),
23037  18228   
                expected_headers,
23038  18229   
            ));
23039  18230   
        }
23040  18231   
    }
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
       18232  +
    /// When a dense map contains a null value, the response should be a 400
       18233  +
    /// SerializationException.
       18234  +
    /// Test ID: RestJsonBodyMalformedMapNullValue
23049  18235   
    #[::tokio::test]
23050         -
    async fn rest_json_header_malformed_string_invalid_base64_media_type_case0_malformed_request() {
       18236  +
    #[::tracing_test::traced_test]
       18237  +
    async fn rest_json_body_malformed_map_null_value_malformed_request() {
23051  18238   
        {
23052  18239   
            #[allow(unused_mut)]
23053  18240   
            let mut http_request = http::Request::builder()
23054         -
                .uri("/MalformedString")
       18241  +
                .uri("/MalformedMap")
23055  18242   
                .method("POST")
23056  18243   
                .header("content-type", "application/json")
23057         -
                .header("amz-media-typed-header", "xyz")
23058         -
                .body(::aws_smithy_http_server::body::Body::empty())
       18244  +
                .body(::aws_smithy_http_server::body::Body::from(
       18245  +
                    ::bytes::Bytes::from_static("{ \"bodyMap\" : { \"abc\": null }  }".as_bytes()),
       18246  +
                ))
23059  18247   
                .unwrap();
23060  18248   
            #[allow(unused_mut)]
23061  18249   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
23062  18250   
            let config = crate::service::RestJsonConfig::builder().build();
23063  18251   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
23064         -
                            .malformed_string(move |input: crate::input::MalformedStringInput| {
       18252  +
                            .malformed_map(move |input: crate::input::MalformedMapInput| {
23065  18253   
                                let sender = sender.clone();
23066  18254   
                                async move {
23067         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedStringOutput };
       18255  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedMapOutput };
23068  18256   
                                    sender.send(()).await.expect("receiver dropped early");
23069  18257   
                                    result
23070  18258   
                                }
23071  18259   
                            })
23072  18260   
                            .build_unchecked();
23073  18261   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
23074  18262   
                .await
23075  18263   
                .expect("unable to make an HTTP request");
23076  18264   
            ::pretty_assertions::assert_eq!(
23077  18265   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
23078  18266   
                http_response.status()
23079  18267   
            );
23080  18268   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
23081  18269   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
23082  18270   
                http_response.headers(),
23083  18271   
                expected_headers,
23084  18272   
            ));
23085  18273   
        }
23086  18274   
    }
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
       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
23091  18366   
    #[::tokio::test]
23092         -
    async fn rest_json_header_malformed_string_invalid_base64_media_type_case1_malformed_request() {
       18367  +
    #[::tracing_test::traced_test]
       18368  +
    async fn rest_json_body_malformed_list_null_item_malformed_request() {
23093  18369   
        {
23094  18370   
            #[allow(unused_mut)]
23095  18371   
            let mut http_request = http::Request::builder()
23096         -
                .uri("/MalformedString")
       18372  +
                .uri("/MalformedList")
23097  18373   
                .method("POST")
23098  18374   
                .header("content-type", "application/json")
23099         -
                .header("amz-media-typed-header", "YmxvYg=")
23100         -
                .body(::aws_smithy_http_server::body::Body::empty())
       18375  +
                .body(::aws_smithy_http_server::body::Body::from(
       18376  +
                    ::bytes::Bytes::from_static(
       18377  +
                        "{ \"bodyList\" : [\"a\", null, \"b\", \"c\"] }".as_bytes(),
       18378  +
                    ),
       18379  +
                ))
23101  18380   
                .unwrap();
23102  18381   
            #[allow(unused_mut)]
23103  18382   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
23104  18383   
            let config = crate::service::RestJsonConfig::builder().build();
23105  18384   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
23106         -
                            .malformed_string(move |input: crate::input::MalformedStringInput| {
       18385  +
                            .malformed_list(move |input: crate::input::MalformedListInput| {
23107  18386   
                                let sender = sender.clone();
23108  18387   
                                async move {
23109         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedStringOutput };
       18388  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedListOutput };
23110  18389   
                                    sender.send(()).await.expect("receiver dropped early");
23111  18390   
                                    result
23112  18391   
                                }
23113  18392   
                            })
23114  18393   
                            .build_unchecked();
23115  18394   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
23116  18395   
                .await
23117  18396   
                .expect("unable to make an HTTP request");
23118  18397   
            ::pretty_assertions::assert_eq!(
23119  18398   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
23120  18399   
                http_response.status()
23121  18400   
            );
23122  18401   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
23123  18402   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
23124  18403   
                http_response.headers(),
23125  18404   
                expected_headers,
23126  18405   
            ));
23127  18406   
        }
23128  18407   
    }
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
       18408  +
    /// When a list does not have a closing bracket, the response should be
       18409  +
    /// a 400 SerializationException.
       18410  +
    /// Test ID: RestJsonBodyMalformedListUnclosed
23133  18411   
    #[::tokio::test]
23134         -
    async fn rest_json_header_malformed_string_invalid_base64_media_type_case2_malformed_request() {
       18412  +
    #[::tracing_test::traced_test]
       18413  +
    async fn rest_json_body_malformed_list_unclosed_malformed_request() {
23135  18414   
        {
23136  18415   
            #[allow(unused_mut)]
23137  18416   
            let mut http_request = http::Request::builder()
23138         -
                .uri("/MalformedString")
       18417  +
                .uri("/MalformedList")
23139  18418   
                .method("POST")
23140  18419   
                .header("content-type", "application/json")
23141         -
                .header("amz-media-typed-header", "[][]")
23142         -
                .body(::aws_smithy_http_server::body::Body::empty())
       18420  +
                .body(::aws_smithy_http_server::body::Body::from(
       18421  +
                    ::bytes::Bytes::from_static(
       18422  +
                        "{ \"bodyList\" : [\"a\", \"b\", \"c\" }".as_bytes(),
       18423  +
                    ),
       18424  +
                ))
23143  18425   
                .unwrap();
23144  18426   
            #[allow(unused_mut)]
23145  18427   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
23146  18428   
            let config = crate::service::RestJsonConfig::builder().build();
23147  18429   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
23148         -
                            .malformed_string(move |input: crate::input::MalformedStringInput| {
       18430  +
                            .malformed_list(move |input: crate::input::MalformedListInput| {
23149  18431   
                                let sender = sender.clone();
23150  18432   
                                async move {
23151         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedStringOutput };
       18433  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedListOutput };
23152  18434   
                                    sender.send(()).await.expect("receiver dropped early");
23153  18435   
                                    result
23154  18436   
                                }
23155  18437   
                            })
23156  18438   
                            .build_unchecked();
23157  18439   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
23158  18440   
                .await
23159  18441   
                .expect("unable to make an HTTP request");
23160  18442   
            ::pretty_assertions::assert_eq!(
23161  18443   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
23162  18444   
                http_response.status()
23163  18445   
            );
23164  18446   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
23165  18447   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
23166  18448   
                http_response.headers(),
23167  18449   
                expected_headers,
23168  18450   
            ));
23169  18451   
        }
23170  18452   
    }
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
       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
23175  18569   
    #[::tokio::test]
23176         -
    async fn rest_json_header_malformed_string_invalid_base64_media_type_case3_malformed_request() {
       18570  +
    #[::tracing_test::traced_test]
       18571  +
    async fn rest_json_body_boolean_string_coercion_case0_malformed_request() {
23177  18572   
        {
23178  18573   
            #[allow(unused_mut)]
23179  18574   
            let mut http_request = http::Request::builder()
23180         -
                .uri("/MalformedString")
       18575  +
                .uri("/MalformedBoolean/true")
23181  18576   
                .method("POST")
23182  18577   
                .header("content-type", "application/json")
23183         -
                .header("amz-media-typed-header", "-_==")
23184         -
                .body(::aws_smithy_http_server::body::Body::empty())
       18578  +
                .body(::aws_smithy_http_server::body::Body::from(
       18579  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : \"true\" }".as_bytes()),
       18580  +
                ))
23185  18581   
                .unwrap();
23186  18582   
            #[allow(unused_mut)]
23187  18583   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
23188  18584   
            let config = crate::service::RestJsonConfig::builder().build();
23189  18585   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
23190         -
                            .malformed_string(move |input: crate::input::MalformedStringInput| {
       18586  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
23191  18587   
                                let sender = sender.clone();
23192  18588   
                                async move {
23193         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedStringOutput };
       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> };
23194  18590   
                                    sender.send(()).await.expect("receiver dropped early");
23195  18591   
                                    result
23196  18592   
                                }
23197  18593   
                            })
23198  18594   
                            .build_unchecked();
23199  18595   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
23200  18596   
                .await
23201  18597   
                .expect("unable to make an HTTP request");
23202  18598   
            ::pretty_assertions::assert_eq!(
23203  18599   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
23204  18600   
                http_response.status()
23205  18601   
            );
23206  18602   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
23207  18603   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
23208  18604   
                http_response.headers(),
23209  18605   
                expected_headers,
23210  18606   
            ));
23211  18607   
        }
23212  18608   
    }
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
       18609  +
    /// Attempted string coercion should result in SerializationException
       18610  +
    /// Test ID: RestJsonBodyBooleanStringCoercion_case1
23220  18611   
    #[::tokio::test]
23221         -
    async fn rest_json_body_timestamp_date_time_rejects_http_date_case0_malformed_request() {
       18612  +
    #[::tracing_test::traced_test]
       18613  +
    async fn rest_json_body_boolean_string_coercion_case1_malformed_request() {
23222  18614   
        {
23223  18615   
            #[allow(unused_mut)]
23224  18616   
            let mut http_request = http::Request::builder()
23225         -
                .uri("/MalformedTimestampBodyDateTime")
       18617  +
                .uri("/MalformedBoolean/true")
23226  18618   
                .method("POST")
23227  18619   
                .header("content-type", "application/json")
23228  18620   
                .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         -
                    ),
       18621  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : \"True\" }".as_bytes()),
23232  18622   
                ))
23233  18623   
                .unwrap();
23234  18624   
            #[allow(unused_mut)]
23235  18625   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
23236  18626   
            let config = crate::service::RestJsonConfig::builder().build();
23237  18627   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
23238         -
                            .malformed_timestamp_body_date_time(move |input: crate::input::MalformedTimestampBodyDateTimeInput| {
       18628  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
23239  18629   
                                let sender = sender.clone();
23240  18630   
                                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> };
       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> };
23242  18632   
                                    sender.send(()).await.expect("receiver dropped early");
23243  18633   
                                    result
23244  18634   
                                }
23245  18635   
                            })
23246  18636   
                            .build_unchecked();
23247  18637   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
23248  18638   
                .await
23249  18639   
                .expect("unable to make an HTTP request");
23250  18640   
            ::pretty_assertions::assert_eq!(
23251  18641   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
23252  18642   
                http_response.status()
23253  18643   
            );
23254  18644   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
23255  18645   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
23256  18646   
                http_response.headers(),
23257  18647   
                expected_headers,
23258  18648   
            ));
23259  18649   
        }
23260  18650   
    }
23261         -
    /// When the format is date-time, epoch-seconds timestamps are rejected with a
23262         -
    /// 400 SerializationException
23263         -
    /// Test ID: RestJsonBodyTimestampDateTimeRejectsEpochSeconds_case0
       18651  +
    /// Attempted string coercion should result in SerializationException
       18652  +
    /// Test ID: RestJsonBodyBooleanStringCoercion_case2
23264  18653   
    #[::tokio::test]
23265         -
    async fn rest_json_body_timestamp_date_time_rejects_epoch_seconds_case0_malformed_request() {
       18654  +
    #[::tracing_test::traced_test]
       18655  +
    async fn rest_json_body_boolean_string_coercion_case2_malformed_request() {
23266  18656   
        {
23267  18657   
            #[allow(unused_mut)]
23268  18658   
            let mut http_request = http::Request::builder()
23269         -
                .uri("/MalformedTimestampBodyDateTime")
       18659  +
                .uri("/MalformedBoolean/true")
23270  18660   
                .method("POST")
23271  18661   
                .header("content-type", "application/json")
23272  18662   
                .body(::aws_smithy_http_server::body::Body::from(
23273         -
                    ::bytes::Bytes::from_static("{ \"timestamp\": 1515531081.1234 }".as_bytes()),
       18663  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : \"TRUE\" }".as_bytes()),
23274  18664   
                ))
23275  18665   
                .unwrap();
23276  18666   
            #[allow(unused_mut)]
23277  18667   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
23278  18668   
            let config = crate::service::RestJsonConfig::builder().build();
23279  18669   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
23280         -
                            .malformed_timestamp_body_date_time(move |input: crate::input::MalformedTimestampBodyDateTimeInput| {
       18670  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
23281  18671   
                                let sender = sender.clone();
23282  18672   
                                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> };
       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> };
23284  18674   
                                    sender.send(()).await.expect("receiver dropped early");
23285  18675   
                                    result
23286  18676   
                                }
23287  18677   
                            })
23288  18678   
                            .build_unchecked();
23289  18679   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
23290  18680   
                .await
23291  18681   
                .expect("unable to make an HTTP request");
23292  18682   
            ::pretty_assertions::assert_eq!(
23293  18683   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
23294  18684   
                http_response.status()
23295  18685   
            );
23296  18686   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
23297  18687   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
23298  18688   
                http_response.headers(),
23299  18689   
                expected_headers,
23300  18690   
            ));
23301  18691   
        }
23302  18692   
    }
23303         -
    /// When the format is date-time, epoch-seconds timestamps are rejected with a
23304         -
    /// 400 SerializationException
23305         -
    /// Test ID: RestJsonBodyTimestampDateTimeRejectsEpochSeconds_case1
       18693  +
    /// Attempted string coercion should result in SerializationException
       18694  +
    /// Test ID: RestJsonBodyBooleanStringCoercion_case3
23306  18695   
    #[::tokio::test]
23307         -
    async fn rest_json_body_timestamp_date_time_rejects_epoch_seconds_case1_malformed_request() {
       18696  +
    #[::tracing_test::traced_test]
       18697  +
    async fn rest_json_body_boolean_string_coercion_case3_malformed_request() {
23308  18698   
        {
23309  18699   
            #[allow(unused_mut)]
23310  18700   
            let mut http_request = http::Request::builder()
23311         -
                .uri("/MalformedTimestampBodyDateTime")
       18701  +
                .uri("/MalformedBoolean/true")
23312  18702   
                .method("POST")
23313  18703   
                .header("content-type", "application/json")
23314  18704   
                .body(::aws_smithy_http_server::body::Body::from(
23315         -
                    ::bytes::Bytes::from_static("{ \"timestamp\": 1515531081 }".as_bytes()),
       18705  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : \"y\" }".as_bytes()),
23316  18706   
                ))
23317  18707   
                .unwrap();
23318  18708   
            #[allow(unused_mut)]
23319  18709   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
23320  18710   
            let config = crate::service::RestJsonConfig::builder().build();
23321  18711   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
23322         -
                            .malformed_timestamp_body_date_time(move |input: crate::input::MalformedTimestampBodyDateTimeInput| {
       18712  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
23323  18713   
                                let sender = sender.clone();
23324  18714   
                                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> };
       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> };
23326  18716   
                                    sender.send(()).await.expect("receiver dropped early");
23327  18717   
                                    result
23328  18718   
                                }
23329  18719   
                            })
23330  18720   
                            .build_unchecked();
23331  18721   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
23332  18722   
                .await
23333  18723   
                .expect("unable to make an HTTP request");
23334  18724   
            ::pretty_assertions::assert_eq!(
23335  18725   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
23336  18726   
                http_response.status()
23337  18727   
            );
23338  18728   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
23339  18729   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
23340  18730   
                http_response.headers(),
23341  18731   
                expected_headers,
23342  18732   
            ));
23343  18733   
        }
23344  18734   
    }
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
       18735  +
    /// Attempted string coercion should result in SerializationException
       18736  +
    /// Test ID: RestJsonBodyBooleanStringCoercion_case4
23348  18737   
    #[::tokio::test]
23349         -
    async fn rest_json_body_timestamp_date_time_rejects_utc_offsets_case0_malformed_request() {
       18738  +
    #[::tracing_test::traced_test]
       18739  +
    async fn rest_json_body_boolean_string_coercion_case4_malformed_request() {
23350  18740   
        {
23351  18741   
            #[allow(unused_mut)]
23352  18742   
            let mut http_request = http::Request::builder()
23353         -
                .uri("/MalformedTimestampBodyDateTime")
       18743  +
                .uri("/MalformedBoolean/true")
23354  18744   
                .method("POST")
23355  18745   
                .header("content-type", "application/json")
23356  18746   
                .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         -
                    ),
       18747  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : \"Y\" }".as_bytes()),
23360  18748   
                ))
23361  18749   
                .unwrap();
23362  18750   
            #[allow(unused_mut)]
23363  18751   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
23364  18752   
            let config = crate::service::RestJsonConfig::builder().build();
23365  18753   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
23366         -
                            .malformed_timestamp_body_date_time(move |input: crate::input::MalformedTimestampBodyDateTimeInput| {
       18754  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
23367  18755   
                                let sender = sender.clone();
23368  18756   
                                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> };
       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> };
23370  18758   
                                    sender.send(()).await.expect("receiver dropped early");
23371  18759   
                                    result
23372  18760   
                                }
23373  18761   
                            })
23374  18762   
                            .build_unchecked();
23375  18763   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
23376  18764   
                .await
23377  18765   
                .expect("unable to make an HTTP request");
23378  18766   
            ::pretty_assertions::assert_eq!(
23379  18767   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
23380  18768   
                http_response.status()
23381  18769   
            );
23382  18770   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
23383  18771   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
23384  18772   
                http_response.headers(),
23385  18773   
                expected_headers,
23386  18774   
            ));
23387  18775   
        }
23388  18776   
    }
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
       18777  +
    /// Attempted string coercion should result in SerializationException
       18778  +
    /// Test ID: RestJsonBodyBooleanStringCoercion_case5
23392  18779   
    #[::tokio::test]
23393         -
    async fn rest_json_body_timestamp_date_time_rejects_different8601_formats_case0_malformed_request(
23394         -
    ) {
       18780  +
    #[::tracing_test::traced_test]
       18781  +
    async fn rest_json_body_boolean_string_coercion_case5_malformed_request() {
23395  18782   
        {
23396  18783   
            #[allow(unused_mut)]
23397  18784   
            let mut http_request = http::Request::builder()
23398         -
                .uri("/MalformedTimestampBodyDateTime")
       18785  +
                .uri("/MalformedBoolean/true")
23399  18786   
                .method("POST")
23400  18787   
                .header("content-type", "application/json")
23401  18788   
                .body(::aws_smithy_http_server::body::Body::from(
23402         -
                    ::bytes::Bytes::from_static(
23403         -
                        "{ \"timestamp\": \"1996-12-19T16:39:57+00\" }".as_bytes(),
23404         -
                    ),
       18789  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : \"yes\" }".as_bytes()),
23405  18790   
                ))
23406  18791   
                .unwrap();
23407  18792   
            #[allow(unused_mut)]
23408  18793   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
23409  18794   
            let config = crate::service::RestJsonConfig::builder().build();
23410  18795   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
23411         -
                            .malformed_timestamp_body_date_time(move |input: crate::input::MalformedTimestampBodyDateTimeInput| {
       18796  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
23412  18797   
                                let sender = sender.clone();
23413  18798   
                                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> };
       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> };
23415  18800   
                                    sender.send(()).await.expect("receiver dropped early");
23416  18801   
                                    result
23417  18802   
                                }
23418  18803   
                            })
23419  18804   
                            .build_unchecked();
23420  18805   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
23421  18806   
                .await
23422  18807   
                .expect("unable to make an HTTP request");
23423  18808   
            ::pretty_assertions::assert_eq!(
23424  18809   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
23425  18810   
                http_response.status()
23426  18811   
            );
23427  18812   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
23428  18813   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
23429  18814   
                http_response.headers(),
23430  18815   
                expected_headers,
23431  18816   
            ));
23432  18817   
        }
23433  18818   
    }
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
       18819  +
    /// Attempted string coercion should result in SerializationException
       18820  +
    /// Test ID: RestJsonBodyBooleanStringCoercion_case6
23437  18821   
    #[::tokio::test]
23438         -
    async fn rest_json_body_timestamp_date_time_rejects_different8601_formats_case1_malformed_request(
23439         -
    ) {
       18822  +
    #[::tracing_test::traced_test]
       18823  +
    async fn rest_json_body_boolean_string_coercion_case6_malformed_request() {
23440  18824   
        {
23441  18825   
            #[allow(unused_mut)]
23442  18826   
            let mut http_request = http::Request::builder()
23443         -
                .uri("/MalformedTimestampBodyDateTime")
       18827  +
                .uri("/MalformedBoolean/true")
23444  18828   
                .method("POST")
23445  18829   
                .header("content-type", "application/json")
23446  18830   
                .body(::aws_smithy_http_server::body::Body::from(
23447         -
                    ::bytes::Bytes::from_static(
23448         -
                        "{ \"timestamp\": \"1996-12-19T16:39:57+00Z\" }".as_bytes(),
23449         -
                    ),
       18831  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : \"Yes\" }".as_bytes()),
23450  18832   
                ))
23451  18833   
                .unwrap();
23452  18834   
            #[allow(unused_mut)]
23453  18835   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
23454  18836   
            let config = crate::service::RestJsonConfig::builder().build();
23455  18837   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
23456         -
                            .malformed_timestamp_body_date_time(move |input: crate::input::MalformedTimestampBodyDateTimeInput| {
       18838  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
23457  18839   
                                let sender = sender.clone();
23458  18840   
                                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> };
       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> };
23460  18842   
                                    sender.send(()).await.expect("receiver dropped early");
23461  18843   
                                    result
23462  18844   
                                }
23463  18845   
                            })
23464  18846   
                            .build_unchecked();
23465  18847   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
23466  18848   
                .await
23467  18849   
                .expect("unable to make an HTTP request");
23468  18850   
            ::pretty_assertions::assert_eq!(
23469  18851   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
23470  18852   
                http_response.status()
23471  18853   
            );
23472  18854   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
23473  18855   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
23474  18856   
                http_response.headers(),
23475  18857   
                expected_headers,
23476  18858   
            ));
23477  18859   
        }
23478         -
    }
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
       18860  +
    }
       18861  +
    /// Attempted string coercion should result in SerializationException
       18862  +
    /// Test ID: RestJsonBodyBooleanStringCoercion_case7
23482  18863   
    #[::tokio::test]
23483         -
    async fn rest_json_body_timestamp_date_time_rejects_different8601_formats_case2_malformed_request(
23484         -
    ) {
       18864  +
    #[::tracing_test::traced_test]
       18865  +
    async fn rest_json_body_boolean_string_coercion_case7_malformed_request() {
23485  18866   
        {
23486  18867   
            #[allow(unused_mut)]
23487  18868   
            let mut http_request = http::Request::builder()
23488         -
                .uri("/MalformedTimestampBodyDateTime")
       18869  +
                .uri("/MalformedBoolean/true")
23489  18870   
                .method("POST")
23490  18871   
                .header("content-type", "application/json")
23491  18872   
                .body(::aws_smithy_http_server::body::Body::from(
23492         -
                    ::bytes::Bytes::from_static(
23493         -
                        "{ \"timestamp\": \"1996-12-19T16:39:57\" }".as_bytes(),
23494         -
                    ),
       18873  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : \"YES\" }".as_bytes()),
23495  18874   
                ))
23496  18875   
                .unwrap();
23497  18876   
            #[allow(unused_mut)]
23498  18877   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
23499  18878   
            let config = crate::service::RestJsonConfig::builder().build();
23500  18879   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
23501         -
                            .malformed_timestamp_body_date_time(move |input: crate::input::MalformedTimestampBodyDateTimeInput| {
       18880  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
23502  18881   
                                let sender = sender.clone();
23503  18882   
                                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> };
       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> };
23505  18884   
                                    sender.send(()).await.expect("receiver dropped early");
23506  18885   
                                    result
23507  18886   
                                }
23508  18887   
                            })
23509  18888   
                            .build_unchecked();
23510  18889   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
23511  18890   
                .await
23512  18891   
                .expect("unable to make an HTTP request");
23513  18892   
            ::pretty_assertions::assert_eq!(
23514  18893   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
23515  18894   
                http_response.status()
23516  18895   
            );
23517  18896   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
23518  18897   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
23519  18898   
                http_response.headers(),
23520  18899   
                expected_headers,
23521  18900   
            ));
23522  18901   
        }
23523  18902   
    }
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
       18903  +
    /// Attempted string coercion should result in SerializationException
       18904  +
    /// Test ID: RestJsonBodyBooleanStringCoercion_case8
23527  18905   
    #[::tokio::test]
23528         -
    async fn rest_json_body_timestamp_date_time_rejects_different8601_formats_case3_malformed_request(
23529         -
    ) {
       18906  +
    #[::tracing_test::traced_test]
       18907  +
    async fn rest_json_body_boolean_string_coercion_case8_malformed_request() {
23530  18908   
        {
23531  18909   
            #[allow(unused_mut)]
23532  18910   
            let mut http_request = http::Request::builder()
23533         -
                .uri("/MalformedTimestampBodyDateTime")
       18911  +
                .uri("/MalformedBoolean/true")
23534  18912   
                .method("POST")
23535  18913   
                .header("content-type", "application/json")
23536  18914   
                .body(::aws_smithy_http_server::body::Body::from(
23537         -
                    ::bytes::Bytes::from_static(
23538         -
                        "{ \"timestamp\": \"1996-12-19T163957\" }".as_bytes(),
23539         -
                    ),
       18915  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : \"1\" }".as_bytes()),
23540  18916   
                ))
23541  18917   
                .unwrap();
23542  18918   
            #[allow(unused_mut)]
23543  18919   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
23544  18920   
            let config = crate::service::RestJsonConfig::builder().build();
23545  18921   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
23546         -
                            .malformed_timestamp_body_date_time(move |input: crate::input::MalformedTimestampBodyDateTimeInput| {
       18922  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
23547  18923   
                                let sender = sender.clone();
23548  18924   
                                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> };
       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> };
23550  18926   
                                    sender.send(()).await.expect("receiver dropped early");
23551  18927   
                                    result
23552  18928   
                                }
23553  18929   
                            })
23554  18930   
                            .build_unchecked();
23555  18931   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
23556  18932   
                .await
23557  18933   
                .expect("unable to make an HTTP request");
23558  18934   
            ::pretty_assertions::assert_eq!(
23559  18935   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
23560  18936   
                http_response.status()
23561  18937   
            );
23562  18938   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
23563  18939   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
23564  18940   
                http_response.headers(),
23565  18941   
                expected_headers,
23566  18942   
            ));
23567  18943   
        }
23568  18944   
    }
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
       18945  +
    /// Attempted string coercion should result in SerializationException
       18946  +
    /// Test ID: RestJsonBodyBooleanStringCoercion_case9
23572  18947   
    #[::tokio::test]
23573         -
    async fn rest_json_body_timestamp_date_time_rejects_different8601_formats_case4_malformed_request(
23574         -
    ) {
       18948  +
    #[::tracing_test::traced_test]
       18949  +
    async fn rest_json_body_boolean_string_coercion_case9_malformed_request() {
23575  18950   
        {
23576  18951   
            #[allow(unused_mut)]
23577  18952   
            let mut http_request = http::Request::builder()
23578         -
                .uri("/MalformedTimestampBodyDateTime")
       18953  +
                .uri("/MalformedBoolean/true")
23579  18954   
                .method("POST")
23580  18955   
                .header("content-type", "application/json")
23581  18956   
                .body(::aws_smithy_http_server::body::Body::from(
23582         -
                    ::bytes::Bytes::from_static(
23583         -
                        "{ \"timestamp\": \"19961219T163957Z\" }".as_bytes(),
23584         -
                    ),
       18957  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : \"on\" }".as_bytes()),
23585  18958   
                ))
23586  18959   
                .unwrap();
23587  18960   
            #[allow(unused_mut)]
23588  18961   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
23589  18962   
            let config = crate::service::RestJsonConfig::builder().build();
23590  18963   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
23591         -
                            .malformed_timestamp_body_date_time(move |input: crate::input::MalformedTimestampBodyDateTimeInput| {
       18964  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
23592  18965   
                                let sender = sender.clone();
23593  18966   
                                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> };
       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> };
23595  18968   
                                    sender.send(()).await.expect("receiver dropped early");
23596  18969   
                                    result
23597  18970   
                                }
23598  18971   
                            })
23599  18972   
                            .build_unchecked();
23600  18973   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
23601  18974   
                .await
23602  18975   
                .expect("unable to make an HTTP request");
23603  18976   
            ::pretty_assertions::assert_eq!(
23604  18977   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
23605  18978   
                http_response.status()
23606  18979   
            );
23607  18980   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
23608  18981   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
23609  18982   
                http_response.headers(),
23610  18983   
                expected_headers,
23611  18984   
            ));
23612  18985   
        }
23613  18986   
    }
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
       18987  +
    /// Attempted string coercion should result in SerializationException
       18988  +
    /// Test ID: RestJsonBodyBooleanStringCoercion_case10
23617  18989   
    #[::tokio::test]
23618         -
    async fn rest_json_body_timestamp_date_time_rejects_different8601_formats_case5_malformed_request(
23619         -
    ) {
       18990  +
    #[::tracing_test::traced_test]
       18991  +
    async fn rest_json_body_boolean_string_coercion_case10_malformed_request() {
23620  18992   
        {
23621  18993   
            #[allow(unused_mut)]
23622  18994   
            let mut http_request = http::Request::builder()
23623         -
                .uri("/MalformedTimestampBodyDateTime")
       18995  +
                .uri("/MalformedBoolean/true")
23624  18996   
                .method("POST")
23625  18997   
                .header("content-type", "application/json")
23626  18998   
                .body(::aws_smithy_http_server::body::Body::from(
23627         -
                    ::bytes::Bytes::from_static(
23628         -
                        "{ \"timestamp\": \"19961219T163957\" }".as_bytes(),
23629         -
                    ),
       18999  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : \"On\" }".as_bytes()),
23630  19000   
                ))
23631  19001   
                .unwrap();
23632  19002   
            #[allow(unused_mut)]
23633  19003   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
23634  19004   
            let config = crate::service::RestJsonConfig::builder().build();
23635  19005   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
23636         -
                            .malformed_timestamp_body_date_time(move |input: crate::input::MalformedTimestampBodyDateTimeInput| {
       19006  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
23637  19007   
                                let sender = sender.clone();
23638  19008   
                                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> };
       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> };
23640  19010   
                                    sender.send(()).await.expect("receiver dropped early");
23641  19011   
                                    result
23642  19012   
                                }
23643  19013   
                            })
23644  19014   
                            .build_unchecked();
23645  19015   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
23646  19016   
                .await
23647  19017   
                .expect("unable to make an HTTP request");
23648  19018   
            ::pretty_assertions::assert_eq!(
23649  19019   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
23650  19020   
                http_response.status()
23651  19021   
            );
23652  19022   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
23653  19023   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
23654  19024   
                http_response.headers(),
23655  19025   
                expected_headers,
23656  19026   
            ));
23657  19027   
        }
23658  19028   
    }
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
       19029  +
    /// Attempted string coercion should result in SerializationException
       19030  +
    /// Test ID: RestJsonBodyBooleanStringCoercion_case11
23662  19031   
    #[::tokio::test]
23663         -
    async fn rest_json_body_timestamp_date_time_rejects_different8601_formats_case6_malformed_request(
23664         -
    ) {
       19032  +
    #[::tracing_test::traced_test]
       19033  +
    async fn rest_json_body_boolean_string_coercion_case11_malformed_request() {
23665  19034   
        {
23666  19035   
            #[allow(unused_mut)]
23667  19036   
            let mut http_request = http::Request::builder()
23668         -
                .uri("/MalformedTimestampBodyDateTime")
       19037  +
                .uri("/MalformedBoolean/true")
23669  19038   
                .method("POST")
23670  19039   
                .header("content-type", "application/json")
23671  19040   
                .body(::aws_smithy_http_server::body::Body::from(
23672         -
                    ::bytes::Bytes::from_static(
23673         -
                        "{ \"timestamp\": \"19961219T16:39:57Z\" }".as_bytes(),
23674         -
                    ),
       19041  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : \"ON\" }".as_bytes()),
23675  19042   
                ))
23676  19043   
                .unwrap();
23677  19044   
            #[allow(unused_mut)]
23678  19045   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
23679  19046   
            let config = crate::service::RestJsonConfig::builder().build();
23680  19047   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
23681         -
                            .malformed_timestamp_body_date_time(move |input: crate::input::MalformedTimestampBodyDateTimeInput| {
       19048  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
23682  19049   
                                let sender = sender.clone();
23683  19050   
                                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> };
       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> };
23685  19052   
                                    sender.send(()).await.expect("receiver dropped early");
23686  19053   
                                    result
23687  19054   
                                }
23688  19055   
                            })
23689  19056   
                            .build_unchecked();
23690  19057   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
23691  19058   
                .await
23692  19059   
                .expect("unable to make an HTTP request");
23693  19060   
            ::pretty_assertions::assert_eq!(
23694  19061   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
23695  19062   
                http_response.status()
23696  19063   
            );
23697  19064   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
23698  19065   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
23699  19066   
                http_response.headers(),
23700  19067   
                expected_headers,
23701  19068   
            ));
23702  19069   
        }
23703  19070   
    }
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
       19071  +
    /// Attempted string coercion should result in SerializationException
       19072  +
    /// Test ID: RestJsonBodyBooleanStringCoercion_case12
23707  19073   
    #[::tokio::test]
23708         -
    async fn rest_json_body_timestamp_date_time_rejects_different8601_formats_case7_malformed_request(
23709         -
    ) {
       19074  +
    #[::tracing_test::traced_test]
       19075  +
    async fn rest_json_body_boolean_string_coercion_case12_malformed_request() {
23710  19076   
        {
23711  19077   
            #[allow(unused_mut)]
23712  19078   
            let mut http_request = http::Request::builder()
23713         -
                .uri("/MalformedTimestampBodyDateTime")
       19079  +
                .uri("/MalformedBoolean/true")
23714  19080   
                .method("POST")
23715  19081   
                .header("content-type", "application/json")
23716  19082   
                .body(::aws_smithy_http_server::body::Body::from(
23717         -
                    ::bytes::Bytes::from_static(
23718         -
                        "{ \"timestamp\": \"19961219T16:39:57\" }".as_bytes(),
23719         -
                    ),
       19083  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : \"false\" }".as_bytes()),
23720  19084   
                ))
23721  19085   
                .unwrap();
23722  19086   
            #[allow(unused_mut)]
23723  19087   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
23724  19088   
            let config = crate::service::RestJsonConfig::builder().build();
23725  19089   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
23726         -
                            .malformed_timestamp_body_date_time(move |input: crate::input::MalformedTimestampBodyDateTimeInput| {
       19090  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
23727  19091   
                                let sender = sender.clone();
23728  19092   
                                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> };
       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> };
23730  19094   
                                    sender.send(()).await.expect("receiver dropped early");
23731  19095   
                                    result
23732  19096   
                                }
23733  19097   
                            })
23734  19098   
                            .build_unchecked();
23735  19099   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
23736  19100   
                .await
23737  19101   
                .expect("unable to make an HTTP request");
23738  19102   
            ::pretty_assertions::assert_eq!(
23739  19103   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
23740  19104   
                http_response.status()
23741  19105   
            );
23742  19106   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
23743  19107   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
23744  19108   
                http_response.headers(),
23745  19109   
                expected_headers,
23746  19110   
            ));
23747  19111   
        }
23748  19112   
    }
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
       19113  +
    /// Attempted string coercion should result in SerializationException
       19114  +
    /// Test ID: RestJsonBodyBooleanStringCoercion_case13
23752  19115   
    #[::tokio::test]
23753         -
    async fn rest_json_body_timestamp_date_time_rejects_different8601_formats_case8_malformed_request(
23754         -
    ) {
       19116  +
    #[::tracing_test::traced_test]
       19117  +
    async fn rest_json_body_boolean_string_coercion_case13_malformed_request() {
23755  19118   
        {
23756  19119   
            #[allow(unused_mut)]
23757  19120   
            let mut http_request = http::Request::builder()
23758         -
                .uri("/MalformedTimestampBodyDateTime")
       19121  +
                .uri("/MalformedBoolean/true")
23759  19122   
                .method("POST")
23760  19123   
                .header("content-type", "application/json")
23761  19124   
                .body(::aws_smithy_http_server::body::Body::from(
23762         -
                    ::bytes::Bytes::from_static(
23763         -
                        "{ \"timestamp\": \"1996-12-19T16:39Z\" }".as_bytes(),
23764         -
                    ),
       19125  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : \"False\" }".as_bytes()),
23765  19126   
                ))
23766  19127   
                .unwrap();
23767  19128   
            #[allow(unused_mut)]
23768  19129   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
23769  19130   
            let config = crate::service::RestJsonConfig::builder().build();
23770  19131   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
23771         -
                            .malformed_timestamp_body_date_time(move |input: crate::input::MalformedTimestampBodyDateTimeInput| {
       19132  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
23772  19133   
                                let sender = sender.clone();
23773  19134   
                                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> };
       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> };
23775  19136   
                                    sender.send(()).await.expect("receiver dropped early");
23776  19137   
                                    result
23777  19138   
                                }
23778  19139   
                            })
23779  19140   
                            .build_unchecked();
23780  19141   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
23781  19142   
                .await
23782  19143   
                .expect("unable to make an HTTP request");
23783  19144   
            ::pretty_assertions::assert_eq!(
23784  19145   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
23785  19146   
                http_response.status()
23786  19147   
            );
23787  19148   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
23788  19149   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
23789  19150   
                http_response.headers(),
23790  19151   
                expected_headers,
23791  19152   
            ));
23792  19153   
        }
23793  19154   
    }
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
       19155  +
    /// Attempted string coercion should result in SerializationException
       19156  +
    /// Test ID: RestJsonBodyBooleanStringCoercion_case14
23797  19157   
    #[::tokio::test]
23798         -
    async fn rest_json_body_timestamp_date_time_rejects_different8601_formats_case9_malformed_request(
23799         -
    ) {
       19158  +
    #[::tracing_test::traced_test]
       19159  +
    async fn rest_json_body_boolean_string_coercion_case14_malformed_request() {
23800  19160   
        {
23801  19161   
            #[allow(unused_mut)]
23802  19162   
            let mut http_request = http::Request::builder()
23803         -
                .uri("/MalformedTimestampBodyDateTime")
       19163  +
                .uri("/MalformedBoolean/true")
23804  19164   
                .method("POST")
23805  19165   
                .header("content-type", "application/json")
23806  19166   
                .body(::aws_smithy_http_server::body::Body::from(
23807         -
                    ::bytes::Bytes::from_static(
23808         -
                        "{ \"timestamp\": \"1996-12-19T16:39\" }".as_bytes(),
23809         -
                    ),
       19167  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : \"FALSE\" }".as_bytes()),
23810  19168   
                ))
23811  19169   
                .unwrap();
23812  19170   
            #[allow(unused_mut)]
23813  19171   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
23814  19172   
            let config = crate::service::RestJsonConfig::builder().build();
23815  19173   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
23816         -
                            .malformed_timestamp_body_date_time(move |input: crate::input::MalformedTimestampBodyDateTimeInput| {
       19174  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
23817  19175   
                                let sender = sender.clone();
23818  19176   
                                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> };
       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> };
23820  19178   
                                    sender.send(()).await.expect("receiver dropped early");
23821  19179   
                                    result
23822  19180   
                                }
23823  19181   
                            })
23824  19182   
                            .build_unchecked();
23825  19183   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
23826  19184   
                .await
23827  19185   
                .expect("unable to make an HTTP request");
23828  19186   
            ::pretty_assertions::assert_eq!(
23829  19187   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
23830  19188   
                http_response.status()
23831  19189   
            );
23832  19190   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
23833  19191   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
23834  19192   
                http_response.headers(),
23835  19193   
                expected_headers,
23836  19194   
            ));
23837  19195   
        }
23838  19196   
    }
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
       19197  +
    /// Attempted string coercion should result in SerializationException
       19198  +
    /// Test ID: RestJsonBodyBooleanStringCoercion_case15
23842  19199   
    #[::tokio::test]
23843         -
    async fn rest_json_body_timestamp_date_time_rejects_different8601_formats_case10_malformed_request(
23844         -
    ) {
       19200  +
    #[::tracing_test::traced_test]
       19201  +
    async fn rest_json_body_boolean_string_coercion_case15_malformed_request() {
23845  19202   
        {
23846  19203   
            #[allow(unused_mut)]
23847  19204   
            let mut http_request = http::Request::builder()
23848         -
                .uri("/MalformedTimestampBodyDateTime")
       19205  +
                .uri("/MalformedBoolean/true")
23849  19206   
                .method("POST")
23850  19207   
                .header("content-type", "application/json")
23851  19208   
                .body(::aws_smithy_http_server::body::Body::from(
23852         -
                    ::bytes::Bytes::from_static(
23853         -
                        "{ \"timestamp\": \"1996-12-19T1639\" }".as_bytes(),
23854         -
                    ),
       19209  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : \"n\" }".as_bytes()),
23855  19210   
                ))
23856  19211   
                .unwrap();
23857  19212   
            #[allow(unused_mut)]
23858  19213   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
23859  19214   
            let config = crate::service::RestJsonConfig::builder().build();
23860  19215   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
23861         -
                            .malformed_timestamp_body_date_time(move |input: crate::input::MalformedTimestampBodyDateTimeInput| {
       19216  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
23862  19217   
                                let sender = sender.clone();
23863  19218   
                                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> };
       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> };
23865  19220   
                                    sender.send(()).await.expect("receiver dropped early");
23866  19221   
                                    result
23867  19222   
                                }
23868  19223   
                            })
23869  19224   
                            .build_unchecked();
23870  19225   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
23871  19226   
                .await
23872  19227   
                .expect("unable to make an HTTP request");
23873  19228   
            ::pretty_assertions::assert_eq!(
23874  19229   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
23875  19230   
                http_response.status()
23876  19231   
            );
23877  19232   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
23878  19233   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
23879  19234   
                http_response.headers(),
23880  19235   
                expected_headers,
23881  19236   
            ));
23882  19237   
        }
23883  19238   
    }
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
       19239  +
    /// Attempted string coercion should result in SerializationException
       19240  +
    /// Test ID: RestJsonBodyBooleanStringCoercion_case16
23887  19241   
    #[::tokio::test]
23888         -
    async fn rest_json_body_timestamp_date_time_rejects_different8601_formats_case11_malformed_request(
23889         -
    ) {
       19242  +
    #[::tracing_test::traced_test]
       19243  +
    async fn rest_json_body_boolean_string_coercion_case16_malformed_request() {
23890  19244   
        {
23891  19245   
            #[allow(unused_mut)]
23892  19246   
            let mut http_request = http::Request::builder()
23893         -
                .uri("/MalformedTimestampBodyDateTime")
       19247  +
                .uri("/MalformedBoolean/true")
23894  19248   
                .method("POST")
23895  19249   
                .header("content-type", "application/json")
23896  19250   
                .body(::aws_smithy_http_server::body::Body::from(
23897         -
                    ::bytes::Bytes::from_static("{ \"timestamp\": \"1996-12-19T16Z\" }".as_bytes()),
       19251  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : \"N\" }".as_bytes()),
23898  19252   
                ))
23899  19253   
                .unwrap();
23900  19254   
            #[allow(unused_mut)]
23901  19255   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
23902  19256   
            let config = crate::service::RestJsonConfig::builder().build();
23903  19257   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
23904         -
                            .malformed_timestamp_body_date_time(move |input: crate::input::MalformedTimestampBodyDateTimeInput| {
       19258  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
23905  19259   
                                let sender = sender.clone();
23906  19260   
                                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> };
       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> };
23908  19262   
                                    sender.send(()).await.expect("receiver dropped early");
23909  19263   
                                    result
23910  19264   
                                }
23911  19265   
                            })
23912  19266   
                            .build_unchecked();
23913  19267   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
23914  19268   
                .await
23915  19269   
                .expect("unable to make an HTTP request");
23916  19270   
            ::pretty_assertions::assert_eq!(
23917  19271   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
23918  19272   
                http_response.status()
23919  19273   
            );
23920  19274   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
23921  19275   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
23922  19276   
                http_response.headers(),
23923  19277   
                expected_headers,
23924  19278   
            ));
23925  19279   
        }
23926  19280   
    }
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
       19281  +
    /// Attempted string coercion should result in SerializationException
       19282  +
    /// Test ID: RestJsonBodyBooleanStringCoercion_case17
23930  19283   
    #[::tokio::test]
23931         -
    async fn rest_json_body_timestamp_date_time_rejects_different8601_formats_case12_malformed_request(
23932         -
    ) {
       19284  +
    #[::tracing_test::traced_test]
       19285  +
    async fn rest_json_body_boolean_string_coercion_case17_malformed_request() {
23933  19286   
        {
23934  19287   
            #[allow(unused_mut)]
23935  19288   
            let mut http_request = http::Request::builder()
23936         -
                .uri("/MalformedTimestampBodyDateTime")
       19289  +
                .uri("/MalformedBoolean/true")
23937  19290   
                .method("POST")
23938  19291   
                .header("content-type", "application/json")
23939  19292   
                .body(::aws_smithy_http_server::body::Body::from(
23940         -
                    ::bytes::Bytes::from_static("{ \"timestamp\": \"1996-12-19T16\" }".as_bytes()),
       19293  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : \"no\" }".as_bytes()),
23941  19294   
                ))
23942  19295   
                .unwrap();
23943  19296   
            #[allow(unused_mut)]
23944  19297   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
23945  19298   
            let config = crate::service::RestJsonConfig::builder().build();
23946  19299   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
23947         -
                            .malformed_timestamp_body_date_time(move |input: crate::input::MalformedTimestampBodyDateTimeInput| {
       19300  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
23948  19301   
                                let sender = sender.clone();
23949  19302   
                                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> };
       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> };
23951  19304   
                                    sender.send(()).await.expect("receiver dropped early");
23952  19305   
                                    result
23953  19306   
                                }
23954  19307   
                            })
23955  19308   
                            .build_unchecked();
23956  19309   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
23957  19310   
                .await
23958  19311   
                .expect("unable to make an HTTP request");
23959  19312   
            ::pretty_assertions::assert_eq!(
23960  19313   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
23961  19314   
                http_response.status()
23962  19315   
            );
23963  19316   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
23964  19317   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
23965  19318   
                http_response.headers(),
23966  19319   
                expected_headers,
23967  19320   
            ));
23968  19321   
        }
23969  19322   
    }
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
       19323  +
    /// Attempted string coercion should result in SerializationException
       19324  +
    /// Test ID: RestJsonBodyBooleanStringCoercion_case18
23973  19325   
    #[::tokio::test]
23974         -
    async fn rest_json_body_timestamp_date_time_rejects_different8601_formats_case13_malformed_request(
23975         -
    ) {
       19326  +
    #[::tracing_test::traced_test]
       19327  +
    async fn rest_json_body_boolean_string_coercion_case18_malformed_request() {
23976  19328   
        {
23977  19329   
            #[allow(unused_mut)]
23978  19330   
            let mut http_request = http::Request::builder()
23979         -
                .uri("/MalformedTimestampBodyDateTime")
       19331  +
                .uri("/MalformedBoolean/true")
23980  19332   
                .method("POST")
23981  19333   
                .header("content-type", "application/json")
23982  19334   
                .body(::aws_smithy_http_server::body::Body::from(
23983         -
                    ::bytes::Bytes::from_static(
23984         -
                        "{ \"timestamp\": \"1996-12-19 16:39:57Z\" }".as_bytes(),
23985         -
                    ),
       19335  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : \"No\" }".as_bytes()),
23986  19336   
                ))
23987  19337   
                .unwrap();
23988  19338   
            #[allow(unused_mut)]
23989  19339   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
23990  19340   
            let config = crate::service::RestJsonConfig::builder().build();
23991  19341   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
23992         -
                            .malformed_timestamp_body_date_time(move |input: crate::input::MalformedTimestampBodyDateTimeInput| {
       19342  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
23993  19343   
                                let sender = sender.clone();
23994  19344   
                                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> };
       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> };
23996  19346   
                                    sender.send(()).await.expect("receiver dropped early");
23997  19347   
                                    result
23998  19348   
                                }
23999  19349   
                            })
24000  19350   
                            .build_unchecked();
24001  19351   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
24002  19352   
                .await
24003  19353   
                .expect("unable to make an HTTP request");
24004  19354   
            ::pretty_assertions::assert_eq!(
24005  19355   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
24006  19356   
                http_response.status()
24007  19357   
            );
24008  19358   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
24009  19359   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
24010  19360   
                http_response.headers(),
24011  19361   
                expected_headers,
24012  19362   
            ));
24013  19363   
        }
24014  19364   
    }
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
       19365  +
    /// Attempted string coercion should result in SerializationException
       19366  +
    /// Test ID: RestJsonBodyBooleanStringCoercion_case19
24018  19367   
    #[::tokio::test]
24019         -
    async fn rest_json_body_timestamp_date_time_rejects_different8601_formats_case14_malformed_request(
24020         -
    ) {
       19368  +
    #[::tracing_test::traced_test]
       19369  +
    async fn rest_json_body_boolean_string_coercion_case19_malformed_request() {
24021  19370   
        {
24022  19371   
            #[allow(unused_mut)]
24023  19372   
            let mut http_request = http::Request::builder()
24024         -
                .uri("/MalformedTimestampBodyDateTime")
       19373  +
                .uri("/MalformedBoolean/true")
24025  19374   
                .method("POST")
24026  19375   
                .header("content-type", "application/json")
24027  19376   
                .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         -
                    ),
       19377  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : \"NO\" }".as_bytes()),
24031  19378   
                ))
24032  19379   
                .unwrap();
24033  19380   
            #[allow(unused_mut)]
24034  19381   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
24035  19382   
            let config = crate::service::RestJsonConfig::builder().build();
24036  19383   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
24037         -
                            .malformed_timestamp_body_date_time(move |input: crate::input::MalformedTimestampBodyDateTimeInput| {
       19384  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
24038  19385   
                                let sender = sender.clone();
24039  19386   
                                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> };
       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> };
24041  19388   
                                    sender.send(()).await.expect("receiver dropped early");
24042  19389   
                                    result
24043  19390   
                                }
24044  19391   
                            })
24045  19392   
                            .build_unchecked();
24046  19393   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
24047  19394   
                .await
24048  19395   
                .expect("unable to make an HTTP request");
24049  19396   
            ::pretty_assertions::assert_eq!(
24050  19397   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
24051  19398   
                http_response.status()
24052  19399   
            );
24053  19400   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
24054  19401   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
24055  19402   
                http_response.headers(),
24056  19403   
                expected_headers,
24057  19404   
            ));
24058  19405   
        }
24059  19406   
    }
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
       19407  +
    /// Attempted string coercion should result in SerializationException
       19408  +
    /// Test ID: RestJsonBodyBooleanStringCoercion_case20
24067  19409   
    #[::tokio::test]
24068         -
    async fn rest_json_body_timestamp_default_rejects_date_time_case0_malformed_request() {
       19410  +
    #[::tracing_test::traced_test]
       19411  +
    async fn rest_json_body_boolean_string_coercion_case20_malformed_request() {
24069  19412   
        {
24070  19413   
            #[allow(unused_mut)]
24071  19414   
            let mut http_request = http::Request::builder()
24072         -
                .uri("/MalformedTimestampBodyDefault")
       19415  +
                .uri("/MalformedBoolean/true")
24073  19416   
                .method("POST")
24074  19417   
                .header("content-type", "application/json")
24075  19418   
                .body(::aws_smithy_http_server::body::Body::from(
24076         -
                    ::bytes::Bytes::from_static(
24077         -
                        "{ \"timestamp\": \"1985-04-12T23:20:50.52Z\" }".as_bytes(),
24078         -
                    ),
       19419  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : \"0\" }".as_bytes()),
24079  19420   
                ))
24080  19421   
                .unwrap();
24081  19422   
            #[allow(unused_mut)]
24082  19423   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
24083  19424   
            let config = crate::service::RestJsonConfig::builder().build();
24084  19425   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
24085         -
                            .malformed_timestamp_body_default(move |input: crate::input::MalformedTimestampBodyDefaultInput| {
       19426  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
24086  19427   
                                let sender = sender.clone();
24087  19428   
                                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> };
       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> };
24089  19430   
                                    sender.send(()).await.expect("receiver dropped early");
24090  19431   
                                    result
24091  19432   
                                }
24092  19433   
                            })
24093  19434   
                            .build_unchecked();
24094  19435   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
24095  19436   
                .await
24096  19437   
                .expect("unable to make an HTTP request");
24097  19438   
            ::pretty_assertions::assert_eq!(
24098  19439   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
24099  19440   
                http_response.status()
24100  19441   
            );
24101  19442   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
24102  19443   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
24103  19444   
                http_response.headers(),
24104  19445   
                expected_headers,
24105  19446   
            ));
24106  19447   
        }
24107  19448   
    }
24108         -
    /// By default, RFC3339 timestamps are rejected with a
24109         -
    /// 400 SerializationException
24110         -
    /// Test ID: RestJsonBodyTimestampDefaultRejectsDateTime_case1
       19449  +
    /// Attempted string coercion should result in SerializationException
       19450  +
    /// Test ID: RestJsonBodyBooleanStringCoercion_case21
24111  19451   
    #[::tokio::test]
24112         -
    async fn rest_json_body_timestamp_default_rejects_date_time_case1_malformed_request() {
       19452  +
    #[::tracing_test::traced_test]
       19453  +
    async fn rest_json_body_boolean_string_coercion_case21_malformed_request() {
24113  19454   
        {
24114  19455   
            #[allow(unused_mut)]
24115  19456   
            let mut http_request = http::Request::builder()
24116         -
                .uri("/MalformedTimestampBodyDefault")
       19457  +
                .uri("/MalformedBoolean/true")
24117  19458   
                .method("POST")
24118  19459   
                .header("content-type", "application/json")
24119  19460   
                .body(::aws_smithy_http_server::body::Body::from(
24120         -
                    ::bytes::Bytes::from_static(
24121         -
                        "{ \"timestamp\": \"1985-04-12T23:20:50Z\" }".as_bytes(),
24122         -
                    ),
       19461  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : \"off\" }".as_bytes()),
24123  19462   
                ))
24124  19463   
                .unwrap();
24125  19464   
            #[allow(unused_mut)]
24126  19465   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
24127  19466   
            let config = crate::service::RestJsonConfig::builder().build();
24128  19467   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
24129         -
                            .malformed_timestamp_body_default(move |input: crate::input::MalformedTimestampBodyDefaultInput| {
       19468  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
24130  19469   
                                let sender = sender.clone();
24131  19470   
                                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> };
       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> };
24133  19472   
                                    sender.send(()).await.expect("receiver dropped early");
24134  19473   
                                    result
24135  19474   
                                }
24136  19475   
                            })
24137  19476   
                            .build_unchecked();
24138  19477   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
24139  19478   
                .await
24140  19479   
                .expect("unable to make an HTTP request");
24141  19480   
            ::pretty_assertions::assert_eq!(
24142  19481   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
24143  19482   
                http_response.status()
24144  19483   
            );
24145  19484   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
24146  19485   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
24147  19486   
                http_response.headers(),
24148  19487   
                expected_headers,
24149  19488   
            ));
24150  19489   
        }
24151  19490   
    }
24152         -
    /// By default, RFC3339 timestamps are rejected with a
24153         -
    /// 400 SerializationException
24154         -
    /// Test ID: RestJsonBodyTimestampDefaultRejectsDateTime_case2
       19491  +
    /// Attempted string coercion should result in SerializationException
       19492  +
    /// Test ID: RestJsonBodyBooleanStringCoercion_case22
24155  19493   
    #[::tokio::test]
24156         -
    async fn rest_json_body_timestamp_default_rejects_date_time_case2_malformed_request() {
       19494  +
    #[::tracing_test::traced_test]
       19495  +
    async fn rest_json_body_boolean_string_coercion_case22_malformed_request() {
24157  19496   
        {
24158  19497   
            #[allow(unused_mut)]
24159  19498   
            let mut http_request = http::Request::builder()
24160         -
                .uri("/MalformedTimestampBodyDefault")
       19499  +
                .uri("/MalformedBoolean/true")
24161  19500   
                .method("POST")
24162  19501   
                .header("content-type", "application/json")
24163  19502   
                .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         -
                    ),
       19503  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : \"Off\" }".as_bytes()),
24167  19504   
                ))
24168  19505   
                .unwrap();
24169  19506   
            #[allow(unused_mut)]
24170  19507   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
24171  19508   
            let config = crate::service::RestJsonConfig::builder().build();
24172  19509   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
24173         -
                            .malformed_timestamp_body_default(move |input: crate::input::MalformedTimestampBodyDefaultInput| {
       19510  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
24174  19511   
                                let sender = sender.clone();
24175  19512   
                                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> };
       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> };
24177  19514   
                                    sender.send(()).await.expect("receiver dropped early");
24178  19515   
                                    result
24179  19516   
                                }
24180  19517   
                            })
24181  19518   
                            .build_unchecked();
24182  19519   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
24183  19520   
                .await
24184  19521   
                .expect("unable to make an HTTP request");
24185  19522   
            ::pretty_assertions::assert_eq!(
24186  19523   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
24187  19524   
                http_response.status()
24188  19525   
            );
24189  19526   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
24190  19527   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
24191  19528   
                http_response.headers(),
24192  19529   
                expected_headers,
24193  19530   
            ));
24194  19531   
        }
24195  19532   
    }
24196         -
    /// By default, epoch second timestamps as strings are rejected with a
24197         -
    /// 400 SerializationException
24198         -
    /// Test ID: RestJsonBodyTimestampDefaultRejectsStringifiedEpochSeconds_case0
       19533  +
    /// Attempted string coercion should result in SerializationException
       19534  +
    /// Test ID: RestJsonBodyBooleanStringCoercion_case23
24199  19535   
    #[::tokio::test]
24200         -
    async fn rest_json_body_timestamp_default_rejects_stringified_epoch_seconds_case0_malformed_request(
24201         -
    ) {
       19536  +
    #[::tracing_test::traced_test]
       19537  +
    async fn rest_json_body_boolean_string_coercion_case23_malformed_request() {
24202  19538   
        {
24203  19539   
            #[allow(unused_mut)]
24204  19540   
            let mut http_request = http::Request::builder()
24205         -
                .uri("/MalformedTimestampBodyDefault")
       19541  +
                .uri("/MalformedBoolean/true")
24206  19542   
                .method("POST")
24207  19543   
                .header("content-type", "application/json")
24208  19544   
                .body(::aws_smithy_http_server::body::Body::from(
24209         -
                    ::bytes::Bytes::from_static(
24210         -
                        "{ \"timestamp\": \"1515531081.1234\" }".as_bytes(),
24211         -
                    ),
       19545  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : \"OFF\" }".as_bytes()),
24212  19546   
                ))
24213  19547   
                .unwrap();
24214  19548   
            #[allow(unused_mut)]
24215  19549   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
24216  19550   
            let config = crate::service::RestJsonConfig::builder().build();
24217  19551   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
24218         -
                            .malformed_timestamp_body_default(move |input: crate::input::MalformedTimestampBodyDefaultInput| {
       19552  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
24219  19553   
                                let sender = sender.clone();
24220  19554   
                                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> };
       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> };
24222  19556   
                                    sender.send(()).await.expect("receiver dropped early");
24223  19557   
                                    result
24224  19558   
                                }
24225  19559   
                            })
24226  19560   
                            .build_unchecked();
24227  19561   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
24228  19562   
                .await
24229  19563   
                .expect("unable to make an HTTP request");
24230  19564   
            ::pretty_assertions::assert_eq!(
24231  19565   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
24232  19566   
                http_response.status()
24233  19567   
            );
24234  19568   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
24235  19569   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
24236  19570   
                http_response.headers(),
24237  19571   
                expected_headers,
24238  19572   
            ));
24239  19573   
        }
24240  19574   
    }
24241         -
    /// By default, epoch second timestamps as strings are rejected with a
24242         -
    /// 400 SerializationException
24243         -
    /// Test ID: RestJsonBodyTimestampDefaultRejectsStringifiedEpochSeconds_case1
       19575  +
    /// YAML-style alternate boolean literals should result in SerializationException
       19576  +
    /// Test ID: RestJsonBodyBooleanBadLiteral_case0
24244  19577   
    #[::tokio::test]
24245         -
    async fn rest_json_body_timestamp_default_rejects_stringified_epoch_seconds_case1_malformed_request(
24246         -
    ) {
       19578  +
    #[::tracing_test::traced_test]
       19579  +
    async fn rest_json_body_boolean_bad_literal_case0_malformed_request() {
24247  19580   
        {
24248  19581   
            #[allow(unused_mut)]
24249  19582   
            let mut http_request = http::Request::builder()
24250         -
                .uri("/MalformedTimestampBodyDefault")
       19583  +
                .uri("/MalformedBoolean/true")
24251  19584   
                .method("POST")
24252  19585   
                .header("content-type", "application/json")
24253  19586   
                .body(::aws_smithy_http_server::body::Body::from(
24254         -
                    ::bytes::Bytes::from_static("{ \"timestamp\": \"1515531081\" }".as_bytes()),
       19587  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : True }".as_bytes()),
24255  19588   
                ))
24256  19589   
                .unwrap();
24257  19590   
            #[allow(unused_mut)]
24258  19591   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
24259  19592   
            let config = crate::service::RestJsonConfig::builder().build();
24260  19593   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
24261         -
                            .malformed_timestamp_body_default(move |input: crate::input::MalformedTimestampBodyDefaultInput| {
       19594  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
24262  19595   
                                let sender = sender.clone();
24263  19596   
                                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> };
       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> };
24265  19598   
                                    sender.send(()).await.expect("receiver dropped early");
24266  19599   
                                    result
24267  19600   
                                }
24268  19601   
                            })
24269  19602   
                            .build_unchecked();
24270  19603   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
24271  19604   
                .await
24272  19605   
                .expect("unable to make an HTTP request");
24273  19606   
            ::pretty_assertions::assert_eq!(
24274  19607   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
24275  19608   
                http_response.status()
24276  19609   
            );
24277  19610   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
24278  19611   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
24279  19612   
                http_response.headers(),
24280  19613   
                expected_headers,
24281  19614   
            ));
24282  19615   
        }
24283  19616   
    }
24284         -
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
24285         -
    /// Test ID: RestJsonBodyTimestampDefaultRejectsMalformedEpochSeconds_case0
       19617  +
    /// YAML-style alternate boolean literals should result in SerializationException
       19618  +
    /// Test ID: RestJsonBodyBooleanBadLiteral_case1
24286  19619   
    #[::tokio::test]
24287         -
    async fn rest_json_body_timestamp_default_rejects_malformed_epoch_seconds_case0_malformed_request(
24288         -
    ) {
       19620  +
    #[::tracing_test::traced_test]
       19621  +
    async fn rest_json_body_boolean_bad_literal_case1_malformed_request() {
24289  19622   
        {
24290  19623   
            #[allow(unused_mut)]
24291  19624   
            let mut http_request = http::Request::builder()
24292         -
                .uri("/MalformedTimestampBodyDefault")
       19625  +
                .uri("/MalformedBoolean/true")
24293  19626   
                .method("POST")
24294  19627   
                .header("content-type", "application/json")
24295  19628   
                .body(::aws_smithy_http_server::body::Body::from(
24296         -
                    ::bytes::Bytes::from_static("{ \"timestamp\": true }".as_bytes()),
       19629  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : TRUE }".as_bytes()),
24297  19630   
                ))
24298  19631   
                .unwrap();
24299  19632   
            #[allow(unused_mut)]
24300  19633   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
24301  19634   
            let config = crate::service::RestJsonConfig::builder().build();
24302  19635   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
24303         -
                            .malformed_timestamp_body_default(move |input: crate::input::MalformedTimestampBodyDefaultInput| {
       19636  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
24304  19637   
                                let sender = sender.clone();
24305  19638   
                                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> };
       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> };
24307  19640   
                                    sender.send(()).await.expect("receiver dropped early");
24308  19641   
                                    result
24309  19642   
                                }
24310  19643   
                            })
24311  19644   
                            .build_unchecked();
24312  19645   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
24313  19646   
                .await
24314  19647   
                .expect("unable to make an HTTP request");
24315  19648   
            ::pretty_assertions::assert_eq!(
24316  19649   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
24317  19650   
                http_response.status()
24318  19651   
            );
24319  19652   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
24320  19653   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
24321  19654   
                http_response.headers(),
24322  19655   
                expected_headers,
24323  19656   
            ));
24324  19657   
        }
24325  19658   
    }
24326         -
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
24327         -
    /// Test ID: RestJsonBodyTimestampDefaultRejectsMalformedEpochSeconds_case1
       19659  +
    /// YAML-style alternate boolean literals should result in SerializationException
       19660  +
    /// Test ID: RestJsonBodyBooleanBadLiteral_case2
24328  19661   
    #[::tokio::test]
24329         -
    async fn rest_json_body_timestamp_default_rejects_malformed_epoch_seconds_case1_malformed_request(
24330         -
    ) {
       19662  +
    #[::tracing_test::traced_test]
       19663  +
    async fn rest_json_body_boolean_bad_literal_case2_malformed_request() {
24331  19664   
        {
24332  19665   
            #[allow(unused_mut)]
24333  19666   
            let mut http_request = http::Request::builder()
24334         -
                .uri("/MalformedTimestampBodyDefault")
       19667  +
                .uri("/MalformedBoolean/true")
24335  19668   
                .method("POST")
24336  19669   
                .header("content-type", "application/json")
24337  19670   
                .body(::aws_smithy_http_server::body::Body::from(
24338         -
                    ::bytes::Bytes::from_static("{ \"timestamp\": 1515531081ABC }".as_bytes()),
       19671  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : y }".as_bytes()),
24339  19672   
                ))
24340  19673   
                .unwrap();
24341  19674   
            #[allow(unused_mut)]
24342  19675   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
24343  19676   
            let config = crate::service::RestJsonConfig::builder().build();
24344  19677   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
24345         -
                            .malformed_timestamp_body_default(move |input: crate::input::MalformedTimestampBodyDefaultInput| {
       19678  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
24346  19679   
                                let sender = sender.clone();
24347  19680   
                                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> };
       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> };
24349  19682   
                                    sender.send(()).await.expect("receiver dropped early");
24350  19683   
                                    result
24351  19684   
                                }
24352  19685   
                            })
24353  19686   
                            .build_unchecked();
24354  19687   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
24355  19688   
                .await
24356  19689   
                .expect("unable to make an HTTP request");
24357  19690   
            ::pretty_assertions::assert_eq!(
24358  19691   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
24359  19692   
                http_response.status()
24360  19693   
            );
24361  19694   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
24362  19695   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
24363  19696   
                http_response.headers(),
24364  19697   
                expected_headers,
24365  19698   
            ));
24366  19699   
        }
24367  19700   
    }
24368         -
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
24369         -
    /// Test ID: RestJsonBodyTimestampDefaultRejectsMalformedEpochSeconds_case2
       19701  +
    /// YAML-style alternate boolean literals should result in SerializationException
       19702  +
    /// Test ID: RestJsonBodyBooleanBadLiteral_case3
24370  19703   
    #[::tokio::test]
24371         -
    async fn rest_json_body_timestamp_default_rejects_malformed_epoch_seconds_case2_malformed_request(
24372         -
    ) {
       19704  +
    #[::tracing_test::traced_test]
       19705  +
    async fn rest_json_body_boolean_bad_literal_case3_malformed_request() {
24373  19706   
        {
24374  19707   
            #[allow(unused_mut)]
24375  19708   
            let mut http_request = http::Request::builder()
24376         -
                .uri("/MalformedTimestampBodyDefault")
       19709  +
                .uri("/MalformedBoolean/true")
24377  19710   
                .method("POST")
24378  19711   
                .header("content-type", "application/json")
24379  19712   
                .body(::aws_smithy_http_server::body::Body::from(
24380         -
                    ::bytes::Bytes::from_static("{ \"timestamp\": 0x42 }".as_bytes()),
       19713  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : Y }".as_bytes()),
24381  19714   
                ))
24382  19715   
                .unwrap();
24383  19716   
            #[allow(unused_mut)]
24384  19717   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
24385  19718   
            let config = crate::service::RestJsonConfig::builder().build();
24386  19719   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
24387         -
                            .malformed_timestamp_body_default(move |input: crate::input::MalformedTimestampBodyDefaultInput| {
       19720  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
24388  19721   
                                let sender = sender.clone();
24389  19722   
                                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> };
       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> };
24391  19724   
                                    sender.send(()).await.expect("receiver dropped early");
24392  19725   
                                    result
24393  19726   
                                }
24394  19727   
                            })
24395  19728   
                            .build_unchecked();
24396  19729   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
24397  19730   
                .await
24398  19731   
                .expect("unable to make an HTTP request");
24399  19732   
            ::pretty_assertions::assert_eq!(
24400  19733   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
24401  19734   
                http_response.status()
24402  19735   
            );
24403  19736   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
24404  19737   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
24405  19738   
                http_response.headers(),
24406  19739   
                expected_headers,
24407  19740   
            ));
24408  19741   
        }
24409  19742   
    }
24410         -
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
24411         -
    /// Test ID: RestJsonBodyTimestampDefaultRejectsMalformedEpochSeconds_case3
       19743  +
    /// YAML-style alternate boolean literals should result in SerializationException
       19744  +
    /// Test ID: RestJsonBodyBooleanBadLiteral_case4
24412  19745   
    #[::tokio::test]
24413         -
    async fn rest_json_body_timestamp_default_rejects_malformed_epoch_seconds_case3_malformed_request(
24414         -
    ) {
       19746  +
    #[::tracing_test::traced_test]
       19747  +
    async fn rest_json_body_boolean_bad_literal_case4_malformed_request() {
24415  19748   
        {
24416  19749   
            #[allow(unused_mut)]
24417  19750   
            let mut http_request = http::Request::builder()
24418         -
                .uri("/MalformedTimestampBodyDefault")
       19751  +
                .uri("/MalformedBoolean/true")
24419  19752   
                .method("POST")
24420  19753   
                .header("content-type", "application/json")
24421  19754   
                .body(::aws_smithy_http_server::body::Body::from(
24422         -
                    ::bytes::Bytes::from_static("{ \"timestamp\": 1515531081.123.456 }".as_bytes()),
       19755  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : yes }".as_bytes()),
24423  19756   
                ))
24424  19757   
                .unwrap();
24425  19758   
            #[allow(unused_mut)]
24426  19759   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
24427  19760   
            let config = crate::service::RestJsonConfig::builder().build();
24428  19761   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
24429         -
                            .malformed_timestamp_body_default(move |input: crate::input::MalformedTimestampBodyDefaultInput| {
       19762  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
24430  19763   
                                let sender = sender.clone();
24431  19764   
                                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> };
       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> };
24433  19766   
                                    sender.send(()).await.expect("receiver dropped early");
24434  19767   
                                    result
24435  19768   
                                }
24436  19769   
                            })
24437  19770   
                            .build_unchecked();
24438  19771   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
24439  19772   
                .await
24440  19773   
                .expect("unable to make an HTTP request");
24441  19774   
            ::pretty_assertions::assert_eq!(
24442  19775   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
24443  19776   
                http_response.status()
24444  19777   
            );
24445  19778   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
24446  19779   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
24447  19780   
                http_response.headers(),
24448  19781   
                expected_headers,
24449  19782   
            ));
24450  19783   
        }
24451  19784   
    }
24452         -
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
24453         -
    /// Test ID: RestJsonBodyTimestampDefaultRejectsMalformedEpochSeconds_case4
       19785  +
    /// YAML-style alternate boolean literals should result in SerializationException
       19786  +
    /// Test ID: RestJsonBodyBooleanBadLiteral_case5
24454  19787   
    #[::tokio::test]
24455         -
    async fn rest_json_body_timestamp_default_rejects_malformed_epoch_seconds_case4_malformed_request(
24456         -
    ) {
       19788  +
    #[::tracing_test::traced_test]
       19789  +
    async fn rest_json_body_boolean_bad_literal_case5_malformed_request() {
24457  19790   
        {
24458  19791   
            #[allow(unused_mut)]
24459  19792   
            let mut http_request = http::Request::builder()
24460         -
                .uri("/MalformedTimestampBodyDefault")
       19793  +
                .uri("/MalformedBoolean/true")
24461  19794   
                .method("POST")
24462  19795   
                .header("content-type", "application/json")
24463  19796   
                .body(::aws_smithy_http_server::body::Body::from(
24464         -
                    ::bytes::Bytes::from_static("{ \"timestamp\": Infinity }".as_bytes()),
       19797  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : Yes }".as_bytes()),
24465  19798   
                ))
24466  19799   
                .unwrap();
24467  19800   
            #[allow(unused_mut)]
24468  19801   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
24469  19802   
            let config = crate::service::RestJsonConfig::builder().build();
24470  19803   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
24471         -
                            .malformed_timestamp_body_default(move |input: crate::input::MalformedTimestampBodyDefaultInput| {
       19804  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
24472  19805   
                                let sender = sender.clone();
24473  19806   
                                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> };
       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> };
24475  19808   
                                    sender.send(()).await.expect("receiver dropped early");
24476  19809   
                                    result
24477  19810   
                                }
24478  19811   
                            })
24479  19812   
                            .build_unchecked();
24480  19813   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
24481  19814   
                .await
24482  19815   
                .expect("unable to make an HTTP request");
24483  19816   
            ::pretty_assertions::assert_eq!(
24484  19817   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
24485  19818   
                http_response.status()
24486  19819   
            );
24487  19820   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
24488  19821   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
24489  19822   
                http_response.headers(),
24490  19823   
                expected_headers,
24491  19824   
            ));
24492  19825   
        }
24493  19826   
    }
24494         -
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
24495         -
    /// Test ID: RestJsonBodyTimestampDefaultRejectsMalformedEpochSeconds_case5
       19827  +
    /// YAML-style alternate boolean literals should result in SerializationException
       19828  +
    /// Test ID: RestJsonBodyBooleanBadLiteral_case6
24496  19829   
    #[::tokio::test]
24497         -
    async fn rest_json_body_timestamp_default_rejects_malformed_epoch_seconds_case5_malformed_request(
24498         -
    ) {
       19830  +
    #[::tracing_test::traced_test]
       19831  +
    async fn rest_json_body_boolean_bad_literal_case6_malformed_request() {
24499  19832   
        {
24500  19833   
            #[allow(unused_mut)]
24501  19834   
            let mut http_request = http::Request::builder()
24502         -
                .uri("/MalformedTimestampBodyDefault")
       19835  +
                .uri("/MalformedBoolean/true")
24503  19836   
                .method("POST")
24504  19837   
                .header("content-type", "application/json")
24505  19838   
                .body(::aws_smithy_http_server::body::Body::from(
24506         -
                    ::bytes::Bytes::from_static("{ \"timestamp\": \"Infinity\" }".as_bytes()),
       19839  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : YES }".as_bytes()),
24507  19840   
                ))
24508  19841   
                .unwrap();
24509  19842   
            #[allow(unused_mut)]
24510  19843   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
24511  19844   
            let config = crate::service::RestJsonConfig::builder().build();
24512  19845   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
24513         -
                            .malformed_timestamp_body_default(move |input: crate::input::MalformedTimestampBodyDefaultInput| {
       19846  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
24514  19847   
                                let sender = sender.clone();
24515  19848   
                                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> };
       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> };
24517  19850   
                                    sender.send(()).await.expect("receiver dropped early");
24518  19851   
                                    result
24519  19852   
                                }
24520  19853   
                            })
24521  19854   
                            .build_unchecked();
24522  19855   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
24523  19856   
                .await
24524  19857   
                .expect("unable to make an HTTP request");
24525  19858   
            ::pretty_assertions::assert_eq!(
24526  19859   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
24527  19860   
                http_response.status()
24528  19861   
            );
24529  19862   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
24530  19863   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
24531  19864   
                http_response.headers(),
24532  19865   
                expected_headers,
24533  19866   
            ));
24534  19867   
        }
24535  19868   
    }
24536         -
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
24537         -
    /// Test ID: RestJsonBodyTimestampDefaultRejectsMalformedEpochSeconds_case6
       19869  +
    /// YAML-style alternate boolean literals should result in SerializationException
       19870  +
    /// Test ID: RestJsonBodyBooleanBadLiteral_case7
24538  19871   
    #[::tokio::test]
24539         -
    async fn rest_json_body_timestamp_default_rejects_malformed_epoch_seconds_case6_malformed_request(
24540         -
    ) {
       19872  +
    #[::tracing_test::traced_test]
       19873  +
    async fn rest_json_body_boolean_bad_literal_case7_malformed_request() {
24541  19874   
        {
24542  19875   
            #[allow(unused_mut)]
24543  19876   
            let mut http_request = http::Request::builder()
24544         -
                .uri("/MalformedTimestampBodyDefault")
       19877  +
                .uri("/MalformedBoolean/true")
24545  19878   
                .method("POST")
24546  19879   
                .header("content-type", "application/json")
24547  19880   
                .body(::aws_smithy_http_server::body::Body::from(
24548         -
                    ::bytes::Bytes::from_static("{ \"timestamp\": -Infinity }".as_bytes()),
       19881  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : 1 }".as_bytes()),
24549  19882   
                ))
24550  19883   
                .unwrap();
24551  19884   
            #[allow(unused_mut)]
24552  19885   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
24553  19886   
            let config = crate::service::RestJsonConfig::builder().build();
24554  19887   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
24555         -
                            .malformed_timestamp_body_default(move |input: crate::input::MalformedTimestampBodyDefaultInput| {
       19888  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
24556  19889   
                                let sender = sender.clone();
24557  19890   
                                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> };
       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> };
24559  19892   
                                    sender.send(()).await.expect("receiver dropped early");
24560  19893   
                                    result
24561  19894   
                                }
24562  19895   
                            })
24563  19896   
                            .build_unchecked();
24564  19897   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
24565  19898   
                .await
24566  19899   
                .expect("unable to make an HTTP request");
24567  19900   
            ::pretty_assertions::assert_eq!(
24568  19901   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
24569  19902   
                http_response.status()
24570  19903   
            );
24571  19904   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
24572  19905   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
24573  19906   
                http_response.headers(),
24574  19907   
                expected_headers,
24575  19908   
            ));
24576  19909   
        }
24577  19910   
    }
24578         -
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
24579         -
    /// Test ID: RestJsonBodyTimestampDefaultRejectsMalformedEpochSeconds_case7
       19911  +
    /// YAML-style alternate boolean literals should result in SerializationException
       19912  +
    /// Test ID: RestJsonBodyBooleanBadLiteral_case8
24580  19913   
    #[::tokio::test]
24581         -
    async fn rest_json_body_timestamp_default_rejects_malformed_epoch_seconds_case7_malformed_request(
24582         -
    ) {
       19914  +
    #[::tracing_test::traced_test]
       19915  +
    async fn rest_json_body_boolean_bad_literal_case8_malformed_request() {
24583  19916   
        {
24584  19917   
            #[allow(unused_mut)]
24585  19918   
            let mut http_request = http::Request::builder()
24586         -
                .uri("/MalformedTimestampBodyDefault")
       19919  +
                .uri("/MalformedBoolean/true")
24587  19920   
                .method("POST")
24588  19921   
                .header("content-type", "application/json")
24589  19922   
                .body(::aws_smithy_http_server::body::Body::from(
24590         -
                    ::bytes::Bytes::from_static("{ \"timestamp\": \"-Infinity\" }".as_bytes()),
       19923  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : on }".as_bytes()),
24591  19924   
                ))
24592  19925   
                .unwrap();
24593  19926   
            #[allow(unused_mut)]
24594  19927   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
24595  19928   
            let config = crate::service::RestJsonConfig::builder().build();
24596  19929   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
24597         -
                            .malformed_timestamp_body_default(move |input: crate::input::MalformedTimestampBodyDefaultInput| {
       19930  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
24598  19931   
                                let sender = sender.clone();
24599  19932   
                                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> };
       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> };
24601  19934   
                                    sender.send(()).await.expect("receiver dropped early");
24602  19935   
                                    result
24603  19936   
                                }
24604  19937   
                            })
24605  19938   
                            .build_unchecked();
24606  19939   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
24607  19940   
                .await
24608  19941   
                .expect("unable to make an HTTP request");
24609  19942   
            ::pretty_assertions::assert_eq!(
24610  19943   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
24611  19944   
                http_response.status()
24612  19945   
            );
24613  19946   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
24614  19947   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
24615  19948   
                http_response.headers(),
24616  19949   
                expected_headers,
24617  19950   
            ));
24618  19951   
        }
24619  19952   
    }
24620         -
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
24621         -
    /// Test ID: RestJsonBodyTimestampDefaultRejectsMalformedEpochSeconds_case8
       19953  +
    /// YAML-style alternate boolean literals should result in SerializationException
       19954  +
    /// Test ID: RestJsonBodyBooleanBadLiteral_case9
24622  19955   
    #[::tokio::test]
24623         -
    async fn rest_json_body_timestamp_default_rejects_malformed_epoch_seconds_case8_malformed_request(
24624         -
    ) {
       19956  +
    #[::tracing_test::traced_test]
       19957  +
    async fn rest_json_body_boolean_bad_literal_case9_malformed_request() {
24625  19958   
        {
24626  19959   
            #[allow(unused_mut)]
24627  19960   
            let mut http_request = http::Request::builder()
24628         -
                .uri("/MalformedTimestampBodyDefault")
       19961  +
                .uri("/MalformedBoolean/true")
24629  19962   
                .method("POST")
24630  19963   
                .header("content-type", "application/json")
24631  19964   
                .body(::aws_smithy_http_server::body::Body::from(
24632         -
                    ::bytes::Bytes::from_static("{ \"timestamp\": NaN }".as_bytes()),
       19965  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : On }".as_bytes()),
24633  19966   
                ))
24634  19967   
                .unwrap();
24635  19968   
            #[allow(unused_mut)]
24636  19969   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
24637  19970   
            let config = crate::service::RestJsonConfig::builder().build();
24638  19971   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
24639         -
                            .malformed_timestamp_body_default(move |input: crate::input::MalformedTimestampBodyDefaultInput| {
       19972  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
24640  19973   
                                let sender = sender.clone();
24641  19974   
                                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> };
       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> };
24643  19976   
                                    sender.send(()).await.expect("receiver dropped early");
24644  19977   
                                    result
24645  19978   
                                }
24646  19979   
                            })
24647  19980   
                            .build_unchecked();
24648  19981   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
24649  19982   
                .await
24650  19983   
                .expect("unable to make an HTTP request");
24651  19984   
            ::pretty_assertions::assert_eq!(
24652  19985   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
24653  19986   
                http_response.status()
24654  19987   
            );
24655  19988   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
24656  19989   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
24657  19990   
                http_response.headers(),
24658  19991   
                expected_headers,
24659  19992   
            ));
24660  19993   
        }
24661  19994   
    }
24662         -
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
24663         -
    /// Test ID: RestJsonBodyTimestampDefaultRejectsMalformedEpochSeconds_case9
       19995  +
    /// YAML-style alternate boolean literals should result in SerializationException
       19996  +
    /// Test ID: RestJsonBodyBooleanBadLiteral_case10
24664  19997   
    #[::tokio::test]
24665         -
    async fn rest_json_body_timestamp_default_rejects_malformed_epoch_seconds_case9_malformed_request(
24666         -
    ) {
       19998  +
    #[::tracing_test::traced_test]
       19999  +
    async fn rest_json_body_boolean_bad_literal_case10_malformed_request() {
24667  20000   
        {
24668  20001   
            #[allow(unused_mut)]
24669  20002   
            let mut http_request = http::Request::builder()
24670         -
                .uri("/MalformedTimestampBodyDefault")
       20003  +
                .uri("/MalformedBoolean/true")
24671  20004   
                .method("POST")
24672  20005   
                .header("content-type", "application/json")
24673  20006   
                .body(::aws_smithy_http_server::body::Body::from(
24674         -
                    ::bytes::Bytes::from_static("{ \"timestamp\": \"NaN\" }".as_bytes()),
       20007  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : ON }".as_bytes()),
24675  20008   
                ))
24676  20009   
                .unwrap();
24677  20010   
            #[allow(unused_mut)]
24678  20011   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
24679  20012   
            let config = crate::service::RestJsonConfig::builder().build();
24680  20013   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
24681         -
                            .malformed_timestamp_body_default(move |input: crate::input::MalformedTimestampBodyDefaultInput| {
       20014  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
24682  20015   
                                let sender = sender.clone();
24683  20016   
                                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> };
       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> };
24685  20018   
                                    sender.send(()).await.expect("receiver dropped early");
24686  20019   
                                    result
24687  20020   
                                }
24688  20021   
                            })
24689  20022   
                            .build_unchecked();
24690  20023   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
24691  20024   
                .await
24692  20025   
                .expect("unable to make an HTTP request");
24693  20026   
            ::pretty_assertions::assert_eq!(
24694  20027   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
24695  20028   
                http_response.status()
24696  20029   
            );
24697  20030   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
24698  20031   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
24699  20032   
                http_response.headers(),
24700  20033   
                expected_headers,
24701  20034   
            ));
24702  20035   
        }
24703  20036   
    }
24704         -
    /// By default, IMF-fixdate timestamps are rejected with a
24705         -
    /// 400 SerializationException
24706         -
    /// Test ID: RestJsonBodyTimestampDefaultRejectsHttpDate_case0
       20037  +
    /// YAML-style alternate boolean literals should result in SerializationException
       20038  +
    /// Test ID: RestJsonBodyBooleanBadLiteral_case11
24707  20039   
    #[::tokio::test]
24708         -
    async fn rest_json_body_timestamp_default_rejects_http_date_case0_malformed_request() {
       20040  +
    #[::tracing_test::traced_test]
       20041  +
    async fn rest_json_body_boolean_bad_literal_case11_malformed_request() {
24709  20042   
        {
24710  20043   
            #[allow(unused_mut)]
24711  20044   
            let mut http_request = http::Request::builder()
24712         -
                .uri("/MalformedTimestampBodyDefault")
       20045  +
                .uri("/MalformedBoolean/true")
24713  20046   
                .method("POST")
24714  20047   
                .header("content-type", "application/json")
24715  20048   
                .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         -
                    ),
       20049  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : False }".as_bytes()),
24719  20050   
                ))
24720  20051   
                .unwrap();
24721  20052   
            #[allow(unused_mut)]
24722  20053   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
24723  20054   
            let config = crate::service::RestJsonConfig::builder().build();
24724  20055   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
24725         -
                            .malformed_timestamp_body_default(move |input: crate::input::MalformedTimestampBodyDefaultInput| {
       20056  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
24726  20057   
                                let sender = sender.clone();
24727  20058   
                                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> };
       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> };
24729  20060   
                                    sender.send(()).await.expect("receiver dropped early");
24730  20061   
                                    result
24731  20062   
                                }
24732  20063   
                            })
24733  20064   
                            .build_unchecked();
24734  20065   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
24735  20066   
                .await
24736  20067   
                .expect("unable to make an HTTP request");
24737  20068   
            ::pretty_assertions::assert_eq!(
24738  20069   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
24739  20070   
                http_response.status()
24740  20071   
            );
24741  20072   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
24742  20073   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
24743  20074   
                http_response.headers(),
24744  20075   
                expected_headers,
24745  20076   
            ));
24746  20077   
        }
24747  20078   
    }
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
       20079  +
    /// YAML-style alternate boolean literals should result in SerializationException
       20080  +
    /// Test ID: RestJsonBodyBooleanBadLiteral_case12
24755  20081   
    #[::tokio::test]
24756         -
    async fn rest_json_body_timestamp_http_date_rejects_date_time_case0_malformed_request() {
       20082  +
    #[::tracing_test::traced_test]
       20083  +
    async fn rest_json_body_boolean_bad_literal_case12_malformed_request() {
24757  20084   
        {
24758  20085   
            #[allow(unused_mut)]
24759  20086   
            let mut http_request = http::Request::builder()
24760         -
                .uri("/MalformedTimestampBodyHttpDate")
       20087  +
                .uri("/MalformedBoolean/true")
24761  20088   
                .method("POST")
24762  20089   
                .header("content-type", "application/json")
24763  20090   
                .body(::aws_smithy_http_server::body::Body::from(
24764         -
                    ::bytes::Bytes::from_static(
24765         -
                        "{ \"timestamp\": \"1985-04-12T23:20:50.52Z\" }".as_bytes(),
24766         -
                    ),
       20091  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : FALSE }".as_bytes()),
24767  20092   
                ))
24768  20093   
                .unwrap();
24769  20094   
            #[allow(unused_mut)]
24770  20095   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
24771  20096   
            let config = crate::service::RestJsonConfig::builder().build();
24772  20097   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
24773         -
                            .malformed_timestamp_body_http_date(move |input: crate::input::MalformedTimestampBodyHttpDateInput| {
       20098  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
24774  20099   
                                let sender = sender.clone();
24775  20100   
                                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> };
       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> };
24777  20102   
                                    sender.send(()).await.expect("receiver dropped early");
24778  20103   
                                    result
24779  20104   
                                }
24780  20105   
                            })
24781  20106   
                            .build_unchecked();
24782  20107   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
24783  20108   
                .await
24784  20109   
                .expect("unable to make an HTTP request");
24785  20110   
            ::pretty_assertions::assert_eq!(
24786  20111   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
24787  20112   
                http_response.status()
24788  20113   
            );
24789  20114   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
24790  20115   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
24791  20116   
                http_response.headers(),
24792  20117   
                expected_headers,
24793  20118   
            ));
24794  20119   
        }
24795  20120   
    }
24796         -
    /// When the format is http-date, RFC3339 timestamps are rejected with a
24797         -
    /// 400 SerializationException
24798         -
    /// Test ID: RestJsonBodyTimestampHttpDateRejectsDateTime_case1
       20121  +
    /// YAML-style alternate boolean literals should result in SerializationException
       20122  +
    /// Test ID: RestJsonBodyBooleanBadLiteral_case13
24799  20123   
    #[::tokio::test]
24800         -
    async fn rest_json_body_timestamp_http_date_rejects_date_time_case1_malformed_request() {
       20124  +
    #[::tracing_test::traced_test]
       20125  +
    async fn rest_json_body_boolean_bad_literal_case13_malformed_request() {
24801  20126   
        {
24802  20127   
            #[allow(unused_mut)]
24803  20128   
            let mut http_request = http::Request::builder()
24804         -
                .uri("/MalformedTimestampBodyHttpDate")
       20129  +
                .uri("/MalformedBoolean/true")
24805  20130   
                .method("POST")
24806  20131   
                .header("content-type", "application/json")
24807  20132   
                .body(::aws_smithy_http_server::body::Body::from(
24808         -
                    ::bytes::Bytes::from_static(
24809         -
                        "{ \"timestamp\": \"1985-04-12T23:20:50Z\" }".as_bytes(),
24810         -
                    ),
       20133  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : n }".as_bytes()),
24811  20134   
                ))
24812  20135   
                .unwrap();
24813  20136   
            #[allow(unused_mut)]
24814  20137   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
24815  20138   
            let config = crate::service::RestJsonConfig::builder().build();
24816  20139   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
24817         -
                            .malformed_timestamp_body_http_date(move |input: crate::input::MalformedTimestampBodyHttpDateInput| {
       20140  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
24818  20141   
                                let sender = sender.clone();
24819  20142   
                                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> };
       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> };
24821  20144   
                                    sender.send(()).await.expect("receiver dropped early");
24822  20145   
                                    result
24823  20146   
                                }
24824  20147   
                            })
24825  20148   
                            .build_unchecked();
24826  20149   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
24827  20150   
                .await
24828  20151   
                .expect("unable to make an HTTP request");
24829  20152   
            ::pretty_assertions::assert_eq!(
24830  20153   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
24831  20154   
                http_response.status()
24832  20155   
            );
24833  20156   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
24834  20157   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
24835  20158   
                http_response.headers(),
24836  20159   
                expected_headers,
24837  20160   
            ));
24838  20161   
        }
24839  20162   
    }
24840         -
    /// When the format is http-date, RFC3339 timestamps are rejected with a
24841         -
    /// 400 SerializationException
24842         -
    /// Test ID: RestJsonBodyTimestampHttpDateRejectsDateTime_case2
       20163  +
    /// YAML-style alternate boolean literals should result in SerializationException
       20164  +
    /// Test ID: RestJsonBodyBooleanBadLiteral_case14
24843  20165   
    #[::tokio::test]
24844         -
    async fn rest_json_body_timestamp_http_date_rejects_date_time_case2_malformed_request() {
       20166  +
    #[::tracing_test::traced_test]
       20167  +
    async fn rest_json_body_boolean_bad_literal_case14_malformed_request() {
24845  20168   
        {
24846  20169   
            #[allow(unused_mut)]
24847  20170   
            let mut http_request = http::Request::builder()
24848         -
                .uri("/MalformedTimestampBodyHttpDate")
       20171  +
                .uri("/MalformedBoolean/true")
24849  20172   
                .method("POST")
24850  20173   
                .header("content-type", "application/json")
24851  20174   
                .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         -
                    ),
       20175  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : N }".as_bytes()),
24855  20176   
                ))
24856  20177   
                .unwrap();
24857  20178   
            #[allow(unused_mut)]
24858  20179   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
24859  20180   
            let config = crate::service::RestJsonConfig::builder().build();
24860  20181   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
24861         -
                            .malformed_timestamp_body_http_date(move |input: crate::input::MalformedTimestampBodyHttpDateInput| {
       20182  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
24862  20183   
                                let sender = sender.clone();
24863  20184   
                                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> };
       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> };
24865  20186   
                                    sender.send(()).await.expect("receiver dropped early");
24866  20187   
                                    result
24867  20188   
                                }
24868  20189   
                            })
24869  20190   
                            .build_unchecked();
24870  20191   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
24871  20192   
                .await
24872  20193   
                .expect("unable to make an HTTP request");
24873  20194   
            ::pretty_assertions::assert_eq!(
24874  20195   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
24875  20196   
                http_response.status()
24876  20197   
            );
24877  20198   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
24878  20199   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
24879  20200   
                http_response.headers(),
24880  20201   
                expected_headers,
24881  20202   
            ));
24882  20203   
        }
24883  20204   
    }
24884         -
    /// When the format is http-date, epoch-seconds timestamps are rejected with a
24885         -
    /// 400 SerializationException
24886         -
    /// Test ID: RestJsonBodyTimestampHttpDateRejectsEpoch_case0
       20205  +
    /// YAML-style alternate boolean literals should result in SerializationException
       20206  +
    /// Test ID: RestJsonBodyBooleanBadLiteral_case15
24887  20207   
    #[::tokio::test]
24888         -
    async fn rest_json_body_timestamp_http_date_rejects_epoch_case0_malformed_request() {
       20208  +
    #[::tracing_test::traced_test]
       20209  +
    async fn rest_json_body_boolean_bad_literal_case15_malformed_request() {
24889  20210   
        {
24890  20211   
            #[allow(unused_mut)]
24891  20212   
            let mut http_request = http::Request::builder()
24892         -
                .uri("/MalformedTimestampBodyHttpDate")
       20213  +
                .uri("/MalformedBoolean/true")
24893  20214   
                .method("POST")
24894  20215   
                .header("content-type", "application/json")
24895  20216   
                .body(::aws_smithy_http_server::body::Body::from(
24896         -
                    ::bytes::Bytes::from_static("{ \"timestamp\": 1515531081.1234 }".as_bytes()),
       20217  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : no }".as_bytes()),
24897  20218   
                ))
24898  20219   
                .unwrap();
24899  20220   
            #[allow(unused_mut)]
24900  20221   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
24901  20222   
            let config = crate::service::RestJsonConfig::builder().build();
24902  20223   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
24903         -
                            .malformed_timestamp_body_http_date(move |input: crate::input::MalformedTimestampBodyHttpDateInput| {
       20224  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
24904  20225   
                                let sender = sender.clone();
24905  20226   
                                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> };
       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> };
24907  20228   
                                    sender.send(()).await.expect("receiver dropped early");
24908  20229   
                                    result
24909  20230   
                                }
24910  20231   
                            })
24911  20232   
                            .build_unchecked();
24912  20233   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
24913  20234   
                .await
24914  20235   
                .expect("unable to make an HTTP request");
24915  20236   
            ::pretty_assertions::assert_eq!(
24916  20237   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
24917  20238   
                http_response.status()
24918  20239   
            );
24919  20240   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
24920  20241   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
24921  20242   
                http_response.headers(),
24922  20243   
                expected_headers,
24923  20244   
            ));
24924  20245   
        }
24925  20246   
    }
24926         -
    /// When the format is http-date, epoch-seconds timestamps are rejected with a
24927         -
    /// 400 SerializationException
24928         -
    /// Test ID: RestJsonBodyTimestampHttpDateRejectsEpoch_case1
       20247  +
    /// YAML-style alternate boolean literals should result in SerializationException
       20248  +
    /// Test ID: RestJsonBodyBooleanBadLiteral_case16
24929  20249   
    #[::tokio::test]
24930         -
    async fn rest_json_body_timestamp_http_date_rejects_epoch_case1_malformed_request() {
       20250  +
    #[::tracing_test::traced_test]
       20251  +
    async fn rest_json_body_boolean_bad_literal_case16_malformed_request() {
24931  20252   
        {
24932  20253   
            #[allow(unused_mut)]
24933  20254   
            let mut http_request = http::Request::builder()
24934         -
                .uri("/MalformedTimestampBodyHttpDate")
       20255  +
                .uri("/MalformedBoolean/true")
24935  20256   
                .method("POST")
24936  20257   
                .header("content-type", "application/json")
24937  20258   
                .body(::aws_smithy_http_server::body::Body::from(
24938         -
                    ::bytes::Bytes::from_static("{ \"timestamp\": 1515531081 }".as_bytes()),
       20259  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : No }".as_bytes()),
24939  20260   
                ))
24940  20261   
                .unwrap();
24941  20262   
            #[allow(unused_mut)]
24942  20263   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
24943  20264   
            let config = crate::service::RestJsonConfig::builder().build();
24944  20265   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
24945         -
                            .malformed_timestamp_body_http_date(move |input: crate::input::MalformedTimestampBodyHttpDateInput| {
       20266  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
24946  20267   
                                let sender = sender.clone();
24947  20268   
                                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> };
       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> };
24949  20270   
                                    sender.send(()).await.expect("receiver dropped early");
24950  20271   
                                    result
24951  20272   
                                }
24952  20273   
                            })
24953  20274   
                            .build_unchecked();
24954  20275   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
24955  20276   
                .await
24956  20277   
                .expect("unable to make an HTTP request");
24957  20278   
            ::pretty_assertions::assert_eq!(
24958  20279   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
24959  20280   
                http_response.status()
24960  20281   
            );
24961  20282   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
24962  20283   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
24963  20284   
                http_response.headers(),
24964  20285   
                expected_headers,
24965  20286   
            ));
24966  20287   
        }
24967  20288   
    }
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
       20289  +
    /// YAML-style alternate boolean literals should result in SerializationException
       20290  +
    /// Test ID: RestJsonBodyBooleanBadLiteral_case17
24975  20291   
    #[::tokio::test]
24976         -
    async fn rest_json_header_timestamp_date_time_rejects_http_date_case0_malformed_request() {
       20292  +
    #[::tracing_test::traced_test]
       20293  +
    async fn rest_json_body_boolean_bad_literal_case17_malformed_request() {
24977  20294   
        {
24978  20295   
            #[allow(unused_mut)]
24979  20296   
            let mut http_request = http::Request::builder()
24980         -
                .uri("/MalformedTimestampHeaderDateTime")
       20297  +
                .uri("/MalformedBoolean/true")
24981  20298   
                .method("POST")
24982         -
                .header("timestamp", "Tue, 29 Apr 2014 18:30:38 GMT")
24983         -
                .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  +
                ))
24984  20303   
                .unwrap();
24985  20304   
            #[allow(unused_mut)]
24986  20305   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
24987  20306   
            let config = crate::service::RestJsonConfig::builder().build();
24988  20307   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
24989         -
                            .malformed_timestamp_header_date_time(move |input: crate::input::MalformedTimestampHeaderDateTimeInput| {
       20308  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
24990  20309   
                                let sender = sender.clone();
24991  20310   
                                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> };
       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> };
24993  20312   
                                    sender.send(()).await.expect("receiver dropped early");
24994  20313   
                                    result
24995  20314   
                                }
24996  20315   
                            })
24997  20316   
                            .build_unchecked();
24998  20317   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
24999  20318   
                .await
25000  20319   
                .expect("unable to make an HTTP request");
25001  20320   
            ::pretty_assertions::assert_eq!(
25002  20321   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
25003  20322   
                http_response.status()
25004  20323   
            );
25005  20324   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
25006  20325   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
25007  20326   
                http_response.headers(),
25008  20327   
                expected_headers,
25009  20328   
            ));
25010  20329   
        }
25011  20330   
    }
25012         -
    /// When the format is date-time, epoch-seconds timestamps are rejected with a
25013         -
    /// 400 SerializationException
25014         -
    /// Test ID: RestJsonHeaderTimestampDateTimeRejectsEpochSeconds_case0
       20331  +
    /// YAML-style alternate boolean literals should result in SerializationException
       20332  +
    /// Test ID: RestJsonBodyBooleanBadLiteral_case18
25015  20333   
    #[::tokio::test]
25016         -
    async fn rest_json_header_timestamp_date_time_rejects_epoch_seconds_case0_malformed_request() {
       20334  +
    #[::tracing_test::traced_test]
       20335  +
    async fn rest_json_body_boolean_bad_literal_case18_malformed_request() {
25017  20336   
        {
25018  20337   
            #[allow(unused_mut)]
25019  20338   
            let mut http_request = http::Request::builder()
25020         -
                .uri("/MalformedTimestampHeaderDateTime")
       20339  +
                .uri("/MalformedBoolean/true")
25021  20340   
                .method("POST")
25022         -
                .header("timestamp", "1515531081.1234")
25023         -
                .body(::aws_smithy_http_server::body::Body::empty())
       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  +
                ))
25024  20345   
                .unwrap();
25025  20346   
            #[allow(unused_mut)]
25026  20347   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
25027  20348   
            let config = crate::service::RestJsonConfig::builder().build();
25028  20349   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
25029         -
                            .malformed_timestamp_header_date_time(move |input: crate::input::MalformedTimestampHeaderDateTimeInput| {
       20350  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
25030  20351   
                                let sender = sender.clone();
25031  20352   
                                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> };
       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> };
25033  20354   
                                    sender.send(()).await.expect("receiver dropped early");
25034  20355   
                                    result
25035  20356   
                                }
25036  20357   
                            })
25037  20358   
                            .build_unchecked();
25038  20359   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
25039  20360   
                .await
25040  20361   
                .expect("unable to make an HTTP request");
25041  20362   
            ::pretty_assertions::assert_eq!(
25042  20363   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
25043  20364   
                http_response.status()
25044  20365   
            );
25045  20366   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
25046  20367   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
25047  20368   
                http_response.headers(),
25048  20369   
                expected_headers,
25049  20370   
            ));
25050  20371   
        }
25051  20372   
    }
25052         -
    /// When the format is date-time, epoch-seconds timestamps are rejected with a
25053         -
    /// 400 SerializationException
25054         -
    /// Test ID: RestJsonHeaderTimestampDateTimeRejectsEpochSeconds_case1
       20373  +
    /// YAML-style alternate boolean literals should result in SerializationException
       20374  +
    /// Test ID: RestJsonBodyBooleanBadLiteral_case19
25055  20375   
    #[::tokio::test]
25056         -
    async fn rest_json_header_timestamp_date_time_rejects_epoch_seconds_case1_malformed_request() {
       20376  +
    #[::tracing_test::traced_test]
       20377  +
    async fn rest_json_body_boolean_bad_literal_case19_malformed_request() {
25057  20378   
        {
25058  20379   
            #[allow(unused_mut)]
25059  20380   
            let mut http_request = http::Request::builder()
25060         -
                .uri("/MalformedTimestampHeaderDateTime")
       20381  +
                .uri("/MalformedBoolean/true")
25061  20382   
                .method("POST")
25062         -
                .header("timestamp", "1515531081")
25063         -
                .body(::aws_smithy_http_server::body::Body::empty())
       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  +
                ))
25064  20387   
                .unwrap();
25065  20388   
            #[allow(unused_mut)]
25066  20389   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
25067  20390   
            let config = crate::service::RestJsonConfig::builder().build();
25068  20391   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
25069         -
                            .malformed_timestamp_header_date_time(move |input: crate::input::MalformedTimestampHeaderDateTimeInput| {
       20392  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
25070  20393   
                                let sender = sender.clone();
25071  20394   
                                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> };
       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> };
25073  20396   
                                    sender.send(()).await.expect("receiver dropped early");
25074  20397   
                                    result
25075  20398   
                                }
25076  20399   
                            })
25077  20400   
                            .build_unchecked();
25078  20401   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
25079  20402   
                .await
25080  20403   
                .expect("unable to make an HTTP request");
25081  20404   
            ::pretty_assertions::assert_eq!(
25082  20405   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
25083  20406   
                http_response.status()
25084  20407   
            );
25085  20408   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
25086  20409   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
25087  20410   
                http_response.headers(),
25088  20411   
                expected_headers,
25089  20412   
            ));
25090  20413   
        }
25091  20414   
    }
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
       20415  +
    /// YAML-style alternate boolean literals should result in SerializationException
       20416  +
    /// Test ID: RestJsonBodyBooleanBadLiteral_case20
25095  20417   
    #[::tokio::test]
25096         -
    async fn rest_json_header_timestamp_date_time_rejects_different8601_formats_case0_malformed_request(
25097         -
    ) {
       20418  +
    #[::tracing_test::traced_test]
       20419  +
    async fn rest_json_body_boolean_bad_literal_case20_malformed_request() {
25098  20420   
        {
25099  20421   
            #[allow(unused_mut)]
25100  20422   
            let mut http_request = http::Request::builder()
25101         -
                .uri("/MalformedTimestampHeaderDateTime")
       20423  +
                .uri("/MalformedBoolean/true")
25102  20424   
                .method("POST")
25103         -
                .header("timestamp", "1996-12-19T16:39:57+00")
25104         -
                .body(::aws_smithy_http_server::body::Body::empty())
       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  +
                ))
25105  20429   
                .unwrap();
25106  20430   
            #[allow(unused_mut)]
25107  20431   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
25108  20432   
            let config = crate::service::RestJsonConfig::builder().build();
25109  20433   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
25110         -
                            .malformed_timestamp_header_date_time(move |input: crate::input::MalformedTimestampHeaderDateTimeInput| {
       20434  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
25111  20435   
                                let sender = sender.clone();
25112  20436   
                                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> };
       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> };
25114  20438   
                                    sender.send(()).await.expect("receiver dropped early");
25115  20439   
                                    result
25116  20440   
                                }
25117  20441   
                            })
25118  20442   
                            .build_unchecked();
25119  20443   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
25120  20444   
                .await
25121  20445   
                .expect("unable to make an HTTP request");
25122  20446   
            ::pretty_assertions::assert_eq!(
25123  20447   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
25124  20448   
                http_response.status()
25125  20449   
            );
25126  20450   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
25127  20451   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
25128  20452   
                http_response.headers(),
25129  20453   
                expected_headers,
25130  20454   
            ));
25131  20455   
        }
25132  20456   
    }
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
       20457  +
    /// YAML-style alternate boolean literals should result in SerializationException
       20458  +
    /// Test ID: RestJsonBodyBooleanBadLiteral_case21
25136  20459   
    #[::tokio::test]
25137         -
    async fn rest_json_header_timestamp_date_time_rejects_different8601_formats_case1_malformed_request(
25138         -
    ) {
       20460  +
    #[::tracing_test::traced_test]
       20461  +
    async fn rest_json_body_boolean_bad_literal_case21_malformed_request() {
25139  20462   
        {
25140  20463   
            #[allow(unused_mut)]
25141  20464   
            let mut http_request = http::Request::builder()
25142         -
                .uri("/MalformedTimestampHeaderDateTime")
       20465  +
                .uri("/MalformedBoolean/true")
25143  20466   
                .method("POST")
25144         -
                .header("timestamp", "1996-12-19T16:39:57+00Z")
25145         -
                .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  +
                ))
25146  20471   
                .unwrap();
25147  20472   
            #[allow(unused_mut)]
25148  20473   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
25149  20474   
            let config = crate::service::RestJsonConfig::builder().build();
25150  20475   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
25151         -
                            .malformed_timestamp_header_date_time(move |input: crate::input::MalformedTimestampHeaderDateTimeInput| {
       20476  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
25152  20477   
                                let sender = sender.clone();
25153  20478   
                                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> };
       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> };
25155  20480   
                                    sender.send(()).await.expect("receiver dropped early");
25156  20481   
                                    result
25157  20482   
                                }
25158  20483   
                            })
25159  20484   
                            .build_unchecked();
25160  20485   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
25161  20486   
                .await
25162  20487   
                .expect("unable to make an HTTP request");
25163  20488   
            ::pretty_assertions::assert_eq!(
25164  20489   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
25165  20490   
                http_response.status()
25166  20491   
            );
25167  20492   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
25168  20493   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
25169  20494   
                http_response.headers(),
25170  20495   
                expected_headers,
25171  20496   
            ));
25172  20497   
        }
25173  20498   
    }
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
       20499  +
    /// Attempted string coercion should result in SerializationException
       20500  +
    /// Test ID: RestJsonPathBooleanStringCoercion_case0
25177  20501   
    #[::tokio::test]
25178         -
    async fn rest_json_header_timestamp_date_time_rejects_different8601_formats_case2_malformed_request(
25179         -
    ) {
       20502  +
    #[::tracing_test::traced_test]
       20503  +
    async fn rest_json_path_boolean_string_coercion_case0_malformed_request() {
25180  20504   
        {
25181  20505   
            #[allow(unused_mut)]
25182  20506   
            let mut http_request = http::Request::builder()
25183         -
                .uri("/MalformedTimestampHeaderDateTime")
       20507  +
                .uri("/MalformedBoolean/True")
25184  20508   
                .method("POST")
25185         -
                .header("timestamp", "1996-12-19T16:39:57")
25186  20509   
                .body(::aws_smithy_http_server::body::Body::empty())
25187  20510   
                .unwrap();
25188  20511   
            #[allow(unused_mut)]
25189  20512   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
25190  20513   
            let config = crate::service::RestJsonConfig::builder().build();
25191  20514   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
25192         -
                            .malformed_timestamp_header_date_time(move |input: crate::input::MalformedTimestampHeaderDateTimeInput| {
       20515  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
25193  20516   
                                let sender = sender.clone();
25194  20517   
                                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> };
       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> };
25196  20519   
                                    sender.send(()).await.expect("receiver dropped early");
25197  20520   
                                    result
25198  20521   
                                }
25199  20522   
                            })
25200  20523   
                            .build_unchecked();
25201  20524   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
25202  20525   
                .await
25203  20526   
                .expect("unable to make an HTTP request");
25204  20527   
            ::pretty_assertions::assert_eq!(
25205  20528   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
25206  20529   
                http_response.status()
25207  20530   
            );
25208  20531   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
25209  20532   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
25210  20533   
                http_response.headers(),
25211  20534   
                expected_headers,
25212  20535   
            ));
25213  20536   
        }
25214  20537   
    }
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
       20538  +
    /// Attempted string coercion should result in SerializationException
       20539  +
    /// Test ID: RestJsonPathBooleanStringCoercion_case1
25218  20540   
    #[::tokio::test]
25219         -
    async fn rest_json_header_timestamp_date_time_rejects_different8601_formats_case3_malformed_request(
25220         -
    ) {
       20541  +
    #[::tracing_test::traced_test]
       20542  +
    async fn rest_json_path_boolean_string_coercion_case1_malformed_request() {
25221  20543   
        {
25222  20544   
            #[allow(unused_mut)]
25223  20545   
            let mut http_request = http::Request::builder()
25224         -
                .uri("/MalformedTimestampHeaderDateTime")
       20546  +
                .uri("/MalformedBoolean/TRUE")
25225  20547   
                .method("POST")
25226         -
                .header("timestamp", "1996-12-19T163957")
25227  20548   
                .body(::aws_smithy_http_server::body::Body::empty())
25228  20549   
                .unwrap();
25229  20550   
            #[allow(unused_mut)]
25230  20551   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
25231  20552   
            let config = crate::service::RestJsonConfig::builder().build();
25232  20553   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
25233         -
                            .malformed_timestamp_header_date_time(move |input: crate::input::MalformedTimestampHeaderDateTimeInput| {
       20554  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
25234  20555   
                                let sender = sender.clone();
25235  20556   
                                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> };
       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> };
25237  20558   
                                    sender.send(()).await.expect("receiver dropped early");
25238  20559   
                                    result
25239  20560   
                                }
25240  20561   
                            })
25241  20562   
                            .build_unchecked();
25242  20563   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
25243  20564   
                .await
25244  20565   
                .expect("unable to make an HTTP request");
25245  20566   
            ::pretty_assertions::assert_eq!(
25246  20567   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
25247  20568   
                http_response.status()
25248  20569   
            );
25249  20570   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
25250  20571   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
25251  20572   
                http_response.headers(),
25252  20573   
                expected_headers,
25253  20574   
            ));
25254  20575   
        }
25255  20576   
    }
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
       20577  +
    /// Attempted string coercion should result in SerializationException
       20578  +
    /// Test ID: RestJsonPathBooleanStringCoercion_case2
25259  20579   
    #[::tokio::test]
25260         -
    async fn rest_json_header_timestamp_date_time_rejects_different8601_formats_case4_malformed_request(
25261         -
    ) {
       20580  +
    #[::tracing_test::traced_test]
       20581  +
    async fn rest_json_path_boolean_string_coercion_case2_malformed_request() {
25262  20582   
        {
25263  20583   
            #[allow(unused_mut)]
25264  20584   
            let mut http_request = http::Request::builder()
25265         -
                .uri("/MalformedTimestampHeaderDateTime")
       20585  +
                .uri("/MalformedBoolean/y")
25266  20586   
                .method("POST")
25267         -
                .header("timestamp", "19961219T163957Z")
25268  20587   
                .body(::aws_smithy_http_server::body::Body::empty())
25269  20588   
                .unwrap();
25270  20589   
            #[allow(unused_mut)]
25271  20590   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
25272  20591   
            let config = crate::service::RestJsonConfig::builder().build();
25273  20592   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
25274         -
                            .malformed_timestamp_header_date_time(move |input: crate::input::MalformedTimestampHeaderDateTimeInput| {
       20593  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
25275  20594   
                                let sender = sender.clone();
25276  20595   
                                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> };
       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> };
25278  20597   
                                    sender.send(()).await.expect("receiver dropped early");
25279  20598   
                                    result
25280  20599   
                                }
25281  20600   
                            })
25282  20601   
                            .build_unchecked();
25283  20602   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
25284  20603   
                .await
25285  20604   
                .expect("unable to make an HTTP request");
25286  20605   
            ::pretty_assertions::assert_eq!(
25287  20606   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
25288  20607   
                http_response.status()
25289  20608   
            );
25290  20609   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
25291  20610   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
25292  20611   
                http_response.headers(),
25293  20612   
                expected_headers,
25294  20613   
            ));
25295  20614   
        }
25296  20615   
    }
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
       20616  +
    /// Attempted string coercion should result in SerializationException
       20617  +
    /// Test ID: RestJsonPathBooleanStringCoercion_case3
25300  20618   
    #[::tokio::test]
25301         -
    async fn rest_json_header_timestamp_date_time_rejects_different8601_formats_case5_malformed_request(
25302         -
    ) {
       20619  +
    #[::tracing_test::traced_test]
       20620  +
    async fn rest_json_path_boolean_string_coercion_case3_malformed_request() {
25303  20621   
        {
25304  20622   
            #[allow(unused_mut)]
25305  20623   
            let mut http_request = http::Request::builder()
25306         -
                .uri("/MalformedTimestampHeaderDateTime")
       20624  +
                .uri("/MalformedBoolean/Y")
25307  20625   
                .method("POST")
25308         -
                .header("timestamp", "19961219T163957")
25309  20626   
                .body(::aws_smithy_http_server::body::Body::empty())
25310  20627   
                .unwrap();
25311  20628   
            #[allow(unused_mut)]
25312  20629   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
25313  20630   
            let config = crate::service::RestJsonConfig::builder().build();
25314  20631   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
25315         -
                            .malformed_timestamp_header_date_time(move |input: crate::input::MalformedTimestampHeaderDateTimeInput| {
       20632  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
25316  20633   
                                let sender = sender.clone();
25317  20634   
                                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> };
       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> };
25319  20636   
                                    sender.send(()).await.expect("receiver dropped early");
25320  20637   
                                    result
25321  20638   
                                }
25322  20639   
                            })
25323  20640   
                            .build_unchecked();
25324  20641   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
25325  20642   
                .await
25326  20643   
                .expect("unable to make an HTTP request");
25327  20644   
            ::pretty_assertions::assert_eq!(
25328  20645   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
25329  20646   
                http_response.status()
25330  20647   
            );
25331  20648   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
25332  20649   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
25333  20650   
                http_response.headers(),
25334  20651   
                expected_headers,
25335  20652   
            ));
25336  20653   
        }
25337  20654   
    }
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
       20655  +
    /// Attempted string coercion should result in SerializationException
       20656  +
    /// Test ID: RestJsonPathBooleanStringCoercion_case4
25341  20657   
    #[::tokio::test]
25342         -
    async fn rest_json_header_timestamp_date_time_rejects_different8601_formats_case6_malformed_request(
25343         -
    ) {
       20658  +
    #[::tracing_test::traced_test]
       20659  +
    async fn rest_json_path_boolean_string_coercion_case4_malformed_request() {
25344  20660   
        {
25345  20661   
            #[allow(unused_mut)]
25346  20662   
            let mut http_request = http::Request::builder()
25347         -
                .uri("/MalformedTimestampHeaderDateTime")
       20663  +
                .uri("/MalformedBoolean/yes")
25348  20664   
                .method("POST")
25349         -
                .header("timestamp", "19961219T16:39:57Z")
25350  20665   
                .body(::aws_smithy_http_server::body::Body::empty())
25351  20666   
                .unwrap();
25352  20667   
            #[allow(unused_mut)]
25353  20668   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
25354  20669   
            let config = crate::service::RestJsonConfig::builder().build();
25355  20670   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
25356         -
                            .malformed_timestamp_header_date_time(move |input: crate::input::MalformedTimestampHeaderDateTimeInput| {
       20671  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
25357  20672   
                                let sender = sender.clone();
25358  20673   
                                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> };
       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> };
25360  20675   
                                    sender.send(()).await.expect("receiver dropped early");
25361  20676   
                                    result
25362  20677   
                                }
25363  20678   
                            })
25364  20679   
                            .build_unchecked();
25365  20680   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
25366  20681   
                .await
25367  20682   
                .expect("unable to make an HTTP request");
25368  20683   
            ::pretty_assertions::assert_eq!(
25369  20684   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
25370  20685   
                http_response.status()
25371  20686   
            );
25372  20687   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
25373  20688   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
25374  20689   
                http_response.headers(),
25375  20690   
                expected_headers,
25376  20691   
            ));
25377  20692   
        }
25378  20693   
    }
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
       20694  +
    /// Attempted string coercion should result in SerializationException
       20695  +
    /// Test ID: RestJsonPathBooleanStringCoercion_case5
25382  20696   
    #[::tokio::test]
25383         -
    async fn rest_json_header_timestamp_date_time_rejects_different8601_formats_case7_malformed_request(
25384         -
    ) {
       20697  +
    #[::tracing_test::traced_test]
       20698  +
    async fn rest_json_path_boolean_string_coercion_case5_malformed_request() {
25385  20699   
        {
25386  20700   
            #[allow(unused_mut)]
25387  20701   
            let mut http_request = http::Request::builder()
25388         -
                .uri("/MalformedTimestampHeaderDateTime")
       20702  +
                .uri("/MalformedBoolean/Yes")
25389  20703   
                .method("POST")
25390         -
                .header("timestamp", "19961219T16:39:57")
25391  20704   
                .body(::aws_smithy_http_server::body::Body::empty())
25392  20705   
                .unwrap();
25393  20706   
            #[allow(unused_mut)]
25394  20707   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
25395  20708   
            let config = crate::service::RestJsonConfig::builder().build();
25396  20709   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
25397         -
                            .malformed_timestamp_header_date_time(move |input: crate::input::MalformedTimestampHeaderDateTimeInput| {
       20710  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
25398  20711   
                                let sender = sender.clone();
25399  20712   
                                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> };
       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> };
25401  20714   
                                    sender.send(()).await.expect("receiver dropped early");
25402  20715   
                                    result
25403  20716   
                                }
25404  20717   
                            })
25405  20718   
                            .build_unchecked();
25406  20719   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
25407  20720   
                .await
25408  20721   
                .expect("unable to make an HTTP request");
25409  20722   
            ::pretty_assertions::assert_eq!(
25410  20723   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
25411  20724   
                http_response.status()
25412  20725   
            );
25413  20726   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
25414  20727   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
25415  20728   
                http_response.headers(),
25416  20729   
                expected_headers,
25417  20730   
            ));
25418  20731   
        }
25419  20732   
    }
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
       20733  +
    /// Attempted string coercion should result in SerializationException
       20734  +
    /// Test ID: RestJsonPathBooleanStringCoercion_case6
25423  20735   
    #[::tokio::test]
25424         -
    async fn rest_json_header_timestamp_date_time_rejects_different8601_formats_case8_malformed_request(
25425         -
    ) {
       20736  +
    #[::tracing_test::traced_test]
       20737  +
    async fn rest_json_path_boolean_string_coercion_case6_malformed_request() {
25426  20738   
        {
25427  20739   
            #[allow(unused_mut)]
25428  20740   
            let mut http_request = http::Request::builder()
25429         -
                .uri("/MalformedTimestampHeaderDateTime")
       20741  +
                .uri("/MalformedBoolean/YES")
25430  20742   
                .method("POST")
25431         -
                .header("timestamp", "1996-12-19T16:39Z")
25432  20743   
                .body(::aws_smithy_http_server::body::Body::empty())
25433  20744   
                .unwrap();
25434  20745   
            #[allow(unused_mut)]
25435  20746   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
25436  20747   
            let config = crate::service::RestJsonConfig::builder().build();
25437  20748   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
25438         -
                            .malformed_timestamp_header_date_time(move |input: crate::input::MalformedTimestampHeaderDateTimeInput| {
       20749  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
25439  20750   
                                let sender = sender.clone();
25440  20751   
                                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> };
       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> };
25442  20753   
                                    sender.send(()).await.expect("receiver dropped early");
25443  20754   
                                    result
25444  20755   
                                }
25445  20756   
                            })
25446  20757   
                            .build_unchecked();
25447  20758   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
25448  20759   
                .await
25449  20760   
                .expect("unable to make an HTTP request");
25450  20761   
            ::pretty_assertions::assert_eq!(
25451  20762   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
25452  20763   
                http_response.status()
25453  20764   
            );
25454  20765   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
25455  20766   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
25456  20767   
                http_response.headers(),
25457  20768   
                expected_headers,
25458  20769   
            ));
25459  20770   
        }
25460  20771   
    }
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
       20772  +
    /// Attempted string coercion should result in SerializationException
       20773  +
    /// Test ID: RestJsonPathBooleanStringCoercion_case7
25464  20774   
    #[::tokio::test]
25465         -
    async fn rest_json_header_timestamp_date_time_rejects_different8601_formats_case9_malformed_request(
25466         -
    ) {
       20775  +
    #[::tracing_test::traced_test]
       20776  +
    async fn rest_json_path_boolean_string_coercion_case7_malformed_request() {
25467  20777   
        {
25468  20778   
            #[allow(unused_mut)]
25469  20779   
            let mut http_request = http::Request::builder()
25470         -
                .uri("/MalformedTimestampHeaderDateTime")
       20780  +
                .uri("/MalformedBoolean/1")
25471  20781   
                .method("POST")
25472         -
                .header("timestamp", "1996-12-19T16:39")
25473  20782   
                .body(::aws_smithy_http_server::body::Body::empty())
25474  20783   
                .unwrap();
25475  20784   
            #[allow(unused_mut)]
25476  20785   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
25477  20786   
            let config = crate::service::RestJsonConfig::builder().build();
25478  20787   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
25479         -
                            .malformed_timestamp_header_date_time(move |input: crate::input::MalformedTimestampHeaderDateTimeInput| {
       20788  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
25480  20789   
                                let sender = sender.clone();
25481  20790   
                                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> };
       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> };
25483  20792   
                                    sender.send(()).await.expect("receiver dropped early");
25484  20793   
                                    result
25485  20794   
                                }
25486  20795   
                            })
25487  20796   
                            .build_unchecked();
25488  20797   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
25489  20798   
                .await
25490  20799   
                .expect("unable to make an HTTP request");
25491  20800   
            ::pretty_assertions::assert_eq!(
25492  20801   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
25493  20802   
                http_response.status()
25494  20803   
            );
25495  20804   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
25496  20805   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
25497  20806   
                http_response.headers(),
25498  20807   
                expected_headers,
25499  20808   
            ));
25500  20809   
        }
25501  20810   
    }
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
       20811  +
    /// Attempted string coercion should result in SerializationException
       20812  +
    /// Test ID: RestJsonPathBooleanStringCoercion_case8
25505  20813   
    #[::tokio::test]
25506         -
    async fn rest_json_header_timestamp_date_time_rejects_different8601_formats_case10_malformed_request(
25507         -
    ) {
       20814  +
    #[::tracing_test::traced_test]
       20815  +
    async fn rest_json_path_boolean_string_coercion_case8_malformed_request() {
25508  20816   
        {
25509  20817   
            #[allow(unused_mut)]
25510  20818   
            let mut http_request = http::Request::builder()
25511         -
                .uri("/MalformedTimestampHeaderDateTime")
       20819  +
                .uri("/MalformedBoolean/on")
25512  20820   
                .method("POST")
25513         -
                .header("timestamp", "1996-12-19T1639")
25514  20821   
                .body(::aws_smithy_http_server::body::Body::empty())
25515  20822   
                .unwrap();
25516  20823   
            #[allow(unused_mut)]
25517  20824   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
25518  20825   
            let config = crate::service::RestJsonConfig::builder().build();
25519  20826   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
25520         -
                            .malformed_timestamp_header_date_time(move |input: crate::input::MalformedTimestampHeaderDateTimeInput| {
       20827  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
25521  20828   
                                let sender = sender.clone();
25522  20829   
                                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> };
       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> };
25524  20831   
                                    sender.send(()).await.expect("receiver dropped early");
25525  20832   
                                    result
25526  20833   
                                }
25527  20834   
                            })
25528  20835   
                            .build_unchecked();
25529  20836   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
25530  20837   
                .await
25531  20838   
                .expect("unable to make an HTTP request");
25532  20839   
            ::pretty_assertions::assert_eq!(
25533  20840   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
25534  20841   
                http_response.status()
25535  20842   
            );
25536  20843   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
25537  20844   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
25538  20845   
                http_response.headers(),
25539  20846   
                expected_headers,
25540  20847   
            ));
25541  20848   
        }
25542  20849   
    }
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
       20850  +
    /// Attempted string coercion should result in SerializationException
       20851  +
    /// Test ID: RestJsonPathBooleanStringCoercion_case9
25546  20852   
    #[::tokio::test]
25547         -
    async fn rest_json_header_timestamp_date_time_rejects_different8601_formats_case11_malformed_request(
25548         -
    ) {
       20853  +
    #[::tracing_test::traced_test]
       20854  +
    async fn rest_json_path_boolean_string_coercion_case9_malformed_request() {
25549  20855   
        {
25550  20856   
            #[allow(unused_mut)]
25551  20857   
            let mut http_request = http::Request::builder()
25552         -
                .uri("/MalformedTimestampHeaderDateTime")
       20858  +
                .uri("/MalformedBoolean/On")
25553  20859   
                .method("POST")
25554         -
                .header("timestamp", "1996-12-19T16Z")
25555  20860   
                .body(::aws_smithy_http_server::body::Body::empty())
25556  20861   
                .unwrap();
25557  20862   
            #[allow(unused_mut)]
25558  20863   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
25559  20864   
            let config = crate::service::RestJsonConfig::builder().build();
25560  20865   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
25561         -
                            .malformed_timestamp_header_date_time(move |input: crate::input::MalformedTimestampHeaderDateTimeInput| {
       20866  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
25562  20867   
                                let sender = sender.clone();
25563  20868   
                                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> };
       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> };
25565  20870   
                                    sender.send(()).await.expect("receiver dropped early");
25566  20871   
                                    result
25567  20872   
                                }
25568  20873   
                            })
25569  20874   
                            .build_unchecked();
25570  20875   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
25571  20876   
                .await
25572  20877   
                .expect("unable to make an HTTP request");
25573  20878   
            ::pretty_assertions::assert_eq!(
25574  20879   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
25575  20880   
                http_response.status()
25576  20881   
            );
25577  20882   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
25578  20883   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
25579  20884   
                http_response.headers(),
25580  20885   
                expected_headers,
25581  20886   
            ));
25582  20887   
        }
25583  20888   
    }
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
       20889  +
    /// Attempted string coercion should result in SerializationException
       20890  +
    /// Test ID: RestJsonPathBooleanStringCoercion_case10
25587  20891   
    #[::tokio::test]
25588         -
    async fn rest_json_header_timestamp_date_time_rejects_different8601_formats_case12_malformed_request(
25589         -
    ) {
       20892  +
    #[::tracing_test::traced_test]
       20893  +
    async fn rest_json_path_boolean_string_coercion_case10_malformed_request() {
25590  20894   
        {
25591  20895   
            #[allow(unused_mut)]
25592  20896   
            let mut http_request = http::Request::builder()
25593         -
                .uri("/MalformedTimestampHeaderDateTime")
       20897  +
                .uri("/MalformedBoolean/ON")
25594  20898   
                .method("POST")
25595         -
                .header("timestamp", "1996-12-19T16")
25596  20899   
                .body(::aws_smithy_http_server::body::Body::empty())
25597  20900   
                .unwrap();
25598  20901   
            #[allow(unused_mut)]
25599  20902   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
25600  20903   
            let config = crate::service::RestJsonConfig::builder().build();
25601  20904   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
25602         -
                            .malformed_timestamp_header_date_time(move |input: crate::input::MalformedTimestampHeaderDateTimeInput| {
       20905  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
25603  20906   
                                let sender = sender.clone();
25604  20907   
                                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> };
       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> };
25606  20909   
                                    sender.send(()).await.expect("receiver dropped early");
25607  20910   
                                    result
25608  20911   
                                }
25609  20912   
                            })
25610  20913   
                            .build_unchecked();
25611  20914   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
25612  20915   
                .await
25613  20916   
                .expect("unable to make an HTTP request");
25614  20917   
            ::pretty_assertions::assert_eq!(
25615  20918   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
25616  20919   
                http_response.status()
25617  20920   
            );
25618  20921   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
25619  20922   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
25620  20923   
                http_response.headers(),
25621  20924   
                expected_headers,
25622  20925   
            ));
25623  20926   
        }
25624  20927   
    }
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
       20928  +
    /// Attempted string coercion should result in SerializationException
       20929  +
    /// Test ID: RestJsonPathBooleanStringCoercion_case11
25628  20930   
    #[::tokio::test]
25629         -
    async fn rest_json_header_timestamp_date_time_rejects_different8601_formats_case13_malformed_request(
25630         -
    ) {
       20931  +
    #[::tracing_test::traced_test]
       20932  +
    async fn rest_json_path_boolean_string_coercion_case11_malformed_request() {
25631  20933   
        {
25632  20934   
            #[allow(unused_mut)]
25633  20935   
            let mut http_request = http::Request::builder()
25634         -
                .uri("/MalformedTimestampHeaderDateTime")
       20936  +
                .uri("/MalformedBoolean/False")
25635  20937   
                .method("POST")
25636         -
                .header("timestamp", "1996-12-19 16:39:57Z")
25637  20938   
                .body(::aws_smithy_http_server::body::Body::empty())
25638  20939   
                .unwrap();
25639  20940   
            #[allow(unused_mut)]
25640  20941   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
25641  20942   
            let config = crate::service::RestJsonConfig::builder().build();
25642  20943   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
25643         -
                            .malformed_timestamp_header_date_time(move |input: crate::input::MalformedTimestampHeaderDateTimeInput| {
       20944  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
25644  20945   
                                let sender = sender.clone();
25645  20946   
                                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> };
       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> };
25647  20948   
                                    sender.send(()).await.expect("receiver dropped early");
25648  20949   
                                    result
25649  20950   
                                }
25650  20951   
                            })
25651  20952   
                            .build_unchecked();
25652  20953   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
25653  20954   
                .await
25654  20955   
                .expect("unable to make an HTTP request");
25655  20956   
            ::pretty_assertions::assert_eq!(
25656  20957   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
25657  20958   
                http_response.status()
25658  20959   
            );
25659  20960   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
25660  20961   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
25661  20962   
                http_response.headers(),
25662  20963   
                expected_headers,
25663  20964   
            ));
25664  20965   
        }
25665  20966   
    }
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
       20967  +
    /// Attempted string coercion should result in SerializationException
       20968  +
    /// Test ID: RestJsonPathBooleanStringCoercion_case12
25669  20969   
    #[::tokio::test]
25670         -
    async fn rest_json_header_timestamp_date_time_rejects_different8601_formats_case14_malformed_request(
25671         -
    ) {
       20970  +
    #[::tracing_test::traced_test]
       20971  +
    async fn rest_json_path_boolean_string_coercion_case12_malformed_request() {
25672  20972   
        {
25673  20973   
            #[allow(unused_mut)]
25674  20974   
            let mut http_request = http::Request::builder()
25675         -
                .uri("/MalformedTimestampHeaderDateTime")
       20975  +
                .uri("/MalformedBoolean/FALSE")
25676  20976   
                .method("POST")
25677         -
                .header("timestamp", "2011-12-03T10:15:30+01:00[Europe/Paris]")
25678  20977   
                .body(::aws_smithy_http_server::body::Body::empty())
25679  20978   
                .unwrap();
25680  20979   
            #[allow(unused_mut)]
25681  20980   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
25682  20981   
            let config = crate::service::RestJsonConfig::builder().build();
25683  20982   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
25684         -
                            .malformed_timestamp_header_date_time(move |input: crate::input::MalformedTimestampHeaderDateTimeInput| {
       20983  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
25685  20984   
                                let sender = sender.clone();
25686  20985   
                                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> };
       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> };
25688  20987   
                                    sender.send(()).await.expect("receiver dropped early");
25689  20988   
                                    result
25690  20989   
                                }
25691  20990   
                            })
25692  20991   
                            .build_unchecked();
25693  20992   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
25694  20993   
                .await
25695  20994   
                .expect("unable to make an HTTP request");
25696  20995   
            ::pretty_assertions::assert_eq!(
25697  20996   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
25698  20997   
                http_response.status()
25699  20998   
            );
25700  20999   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
25701  21000   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
25702  21001   
                http_response.headers(),
25703  21002   
                expected_headers,
25704  21003   
            ));
25705  21004   
        }
25706  21005   
    }
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
       21006  +
    /// Attempted string coercion should result in SerializationException
       21007  +
    /// Test ID: RestJsonPathBooleanStringCoercion_case13
25714  21008   
    #[::tokio::test]
25715         -
    async fn rest_json_header_timestamp_default_rejects_date_time_case0_malformed_request() {
       21009  +
    #[::tracing_test::traced_test]
       21010  +
    async fn rest_json_path_boolean_string_coercion_case13_malformed_request() {
25716  21011   
        {
25717  21012   
            #[allow(unused_mut)]
25718  21013   
            let mut http_request = http::Request::builder()
25719         -
                .uri("/MalformedTimestampHeaderDefault")
       21014  +
                .uri("/MalformedBoolean/n")
25720  21015   
                .method("POST")
25721         -
                .header("timestamp", "1985-04-12T23:20:50.52Z")
25722  21016   
                .body(::aws_smithy_http_server::body::Body::empty())
25723  21017   
                .unwrap();
25724  21018   
            #[allow(unused_mut)]
25725  21019   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
25726  21020   
            let config = crate::service::RestJsonConfig::builder().build();
25727  21021   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
25728         -
                            .malformed_timestamp_header_default(move |input: crate::input::MalformedTimestampHeaderDefaultInput| {
       21022  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
25729  21023   
                                let sender = sender.clone();
25730  21024   
                                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> };
       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> };
25732  21026   
                                    sender.send(()).await.expect("receiver dropped early");
25733  21027   
                                    result
25734  21028   
                                }
25735  21029   
                            })
25736  21030   
                            .build_unchecked();
25737  21031   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
25738  21032   
                .await
25739  21033   
                .expect("unable to make an HTTP request");
25740  21034   
            ::pretty_assertions::assert_eq!(
25741  21035   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
25742  21036   
                http_response.status()
25743  21037   
            );
25744  21038   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
25745  21039   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
25746  21040   
                http_response.headers(),
25747  21041   
                expected_headers,
25748  21042   
            ));
25749  21043   
        }
25750  21044   
    }
25751         -
    /// By default, RFC3339 timestamps are rejected with a
25752         -
    /// 400 SerializationException
25753         -
    /// Test ID: RestJsonHeaderTimestampDefaultRejectsDateTime_case1
       21045  +
    /// Attempted string coercion should result in SerializationException
       21046  +
    /// Test ID: RestJsonPathBooleanStringCoercion_case14
25754  21047   
    #[::tokio::test]
25755         -
    async fn rest_json_header_timestamp_default_rejects_date_time_case1_malformed_request() {
       21048  +
    #[::tracing_test::traced_test]
       21049  +
    async fn rest_json_path_boolean_string_coercion_case14_malformed_request() {
25756  21050   
        {
25757  21051   
            #[allow(unused_mut)]
25758  21052   
            let mut http_request = http::Request::builder()
25759         -
                .uri("/MalformedTimestampHeaderDefault")
       21053  +
                .uri("/MalformedBoolean/N")
25760  21054   
                .method("POST")
25761         -
                .header("timestamp", "1985-04-12T23:20:50Z")
25762  21055   
                .body(::aws_smithy_http_server::body::Body::empty())
25763  21056   
                .unwrap();
25764  21057   
            #[allow(unused_mut)]
25765  21058   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
25766  21059   
            let config = crate::service::RestJsonConfig::builder().build();
25767  21060   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
25768         -
                            .malformed_timestamp_header_default(move |input: crate::input::MalformedTimestampHeaderDefaultInput| {
       21061  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
25769  21062   
                                let sender = sender.clone();
25770  21063   
                                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> };
       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> };
25772  21065   
                                    sender.send(()).await.expect("receiver dropped early");
25773  21066   
                                    result
25774  21067   
                                }
25775  21068   
                            })
25776  21069   
                            .build_unchecked();
25777  21070   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
25778  21071   
                .await
25779  21072   
                .expect("unable to make an HTTP request");
25780  21073   
            ::pretty_assertions::assert_eq!(
25781  21074   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
25782  21075   
                http_response.status()
25783  21076   
            );
25784  21077   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
25785  21078   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
25786  21079   
                http_response.headers(),
25787  21080   
                expected_headers,
25788  21081   
            ));
25789  21082   
        }
25790  21083   
    }
25791         -
    /// By default, RFC3339 timestamps are rejected with a
25792         -
    /// 400 SerializationException
25793         -
    /// Test ID: RestJsonHeaderTimestampDefaultRejectsDateTime_case2
       21084  +
    /// Attempted string coercion should result in SerializationException
       21085  +
    /// Test ID: RestJsonPathBooleanStringCoercion_case15
25794  21086   
    #[::tokio::test]
25795         -
    async fn rest_json_header_timestamp_default_rejects_date_time_case2_malformed_request() {
       21087  +
    #[::tracing_test::traced_test]
       21088  +
    async fn rest_json_path_boolean_string_coercion_case15_malformed_request() {
25796  21089   
        {
25797  21090   
            #[allow(unused_mut)]
25798  21091   
            let mut http_request = http::Request::builder()
25799         -
                .uri("/MalformedTimestampHeaderDefault")
       21092  +
                .uri("/MalformedBoolean/no")
25800  21093   
                .method("POST")
25801         -
                .header("timestamp", "1996-12-19T16:39:57-08:00")
25802  21094   
                .body(::aws_smithy_http_server::body::Body::empty())
25803  21095   
                .unwrap();
25804  21096   
            #[allow(unused_mut)]
25805  21097   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
25806  21098   
            let config = crate::service::RestJsonConfig::builder().build();
25807  21099   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
25808         -
                            .malformed_timestamp_header_default(move |input: crate::input::MalformedTimestampHeaderDefaultInput| {
       21100  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
25809  21101   
                                let sender = sender.clone();
25810  21102   
                                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> };
       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> };
25812  21104   
                                    sender.send(()).await.expect("receiver dropped early");
25813  21105   
                                    result
25814  21106   
                                }
25815  21107   
                            })
25816  21108   
                            .build_unchecked();
25817  21109   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
25818  21110   
                .await
25819  21111   
                .expect("unable to make an HTTP request");
25820  21112   
            ::pretty_assertions::assert_eq!(
25821  21113   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
25822  21114   
                http_response.status()
25823  21115   
            );
25824  21116   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
25825  21117   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
25826  21118   
                http_response.headers(),
25827  21119   
                expected_headers,
25828  21120   
            ));
25829  21121   
        }
25830  21122   
    }
25831         -
    /// By default, epoch second timestamps are rejected with a
25832         -
    /// 400 SerializationException
25833         -
    /// Test ID: RestJsonHeaderTimestampDefaultRejectsEpochSeconds_case0
       21123  +
    /// Attempted string coercion should result in SerializationException
       21124  +
    /// Test ID: RestJsonPathBooleanStringCoercion_case16
25834  21125   
    #[::tokio::test]
25835         -
    async fn rest_json_header_timestamp_default_rejects_epoch_seconds_case0_malformed_request() {
       21126  +
    #[::tracing_test::traced_test]
       21127  +
    async fn rest_json_path_boolean_string_coercion_case16_malformed_request() {
25836  21128   
        {
25837  21129   
            #[allow(unused_mut)]
25838  21130   
            let mut http_request = http::Request::builder()
25839         -
                .uri("/MalformedTimestampHeaderDefault")
       21131  +
                .uri("/MalformedBoolean/No")
25840  21132   
                .method("POST")
25841         -
                .header("timestamp", "1515531081.1234")
25842  21133   
                .body(::aws_smithy_http_server::body::Body::empty())
25843  21134   
                .unwrap();
25844  21135   
            #[allow(unused_mut)]
25845  21136   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
25846  21137   
            let config = crate::service::RestJsonConfig::builder().build();
25847  21138   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
25848         -
                            .malformed_timestamp_header_default(move |input: crate::input::MalformedTimestampHeaderDefaultInput| {
       21139  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
25849  21140   
                                let sender = sender.clone();
25850  21141   
                                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> };
       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> };
25852  21143   
                                    sender.send(()).await.expect("receiver dropped early");
25853  21144   
                                    result
25854  21145   
                                }
25855  21146   
                            })
25856  21147   
                            .build_unchecked();
25857  21148   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
25858  21149   
                .await
25859  21150   
                .expect("unable to make an HTTP request");
25860  21151   
            ::pretty_assertions::assert_eq!(
25861  21152   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
25862  21153   
                http_response.status()
25863  21154   
            );
25864  21155   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
25865  21156   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
25866  21157   
                http_response.headers(),
25867  21158   
                expected_headers,
25868  21159   
            ));
25869  21160   
        }
25870  21161   
    }
25871         -
    /// By default, epoch second timestamps are rejected with a
25872         -
    /// 400 SerializationException
25873         -
    /// Test ID: RestJsonHeaderTimestampDefaultRejectsEpochSeconds_case1
       21162  +
    /// Attempted string coercion should result in SerializationException
       21163  +
    /// Test ID: RestJsonPathBooleanStringCoercion_case17
25874  21164   
    #[::tokio::test]
25875         -
    async fn rest_json_header_timestamp_default_rejects_epoch_seconds_case1_malformed_request() {
       21165  +
    #[::tracing_test::traced_test]
       21166  +
    async fn rest_json_path_boolean_string_coercion_case17_malformed_request() {
25876  21167   
        {
25877  21168   
            #[allow(unused_mut)]
25878  21169   
            let mut http_request = http::Request::builder()
25879         -
                .uri("/MalformedTimestampHeaderDefault")
       21170  +
                .uri("/MalformedBoolean/NO")
25880  21171   
                .method("POST")
25881         -
                .header("timestamp", "1515531081")
25882  21172   
                .body(::aws_smithy_http_server::body::Body::empty())
25883  21173   
                .unwrap();
25884  21174   
            #[allow(unused_mut)]
25885  21175   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
25886  21176   
            let config = crate::service::RestJsonConfig::builder().build();
25887  21177   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
25888         -
                            .malformed_timestamp_header_default(move |input: crate::input::MalformedTimestampHeaderDefaultInput| {
       21178  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
25889  21179   
                                let sender = sender.clone();
25890  21180   
                                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> };
       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> };
25892  21182   
                                    sender.send(()).await.expect("receiver dropped early");
25893  21183   
                                    result
25894  21184   
                                }
25895  21185   
                            })
25896  21186   
                            .build_unchecked();
25897  21187   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
25898  21188   
                .await
25899  21189   
                .expect("unable to make an HTTP request");
25900  21190   
            ::pretty_assertions::assert_eq!(
25901  21191   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
25902  21192   
                http_response.status()
25903  21193   
            );
25904  21194   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
25905  21195   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
25906  21196   
                http_response.headers(),
25907  21197   
                expected_headers,
25908  21198   
            ));
25909  21199   
        }
25910  21200   
    }
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
       21201  +
    /// Attempted string coercion should result in SerializationException
       21202  +
    /// Test ID: RestJsonPathBooleanStringCoercion_case18
25918  21203   
    #[::tokio::test]
25919         -
    async fn rest_json_header_timestamp_epoch_rejects_date_time_case0_malformed_request() {
       21204  +
    #[::tracing_test::traced_test]
       21205  +
    async fn rest_json_path_boolean_string_coercion_case18_malformed_request() {
25920  21206   
        {
25921  21207   
            #[allow(unused_mut)]
25922  21208   
            let mut http_request = http::Request::builder()
25923         -
                .uri("/MalformedTimestampHeaderEpoch")
       21209  +
                .uri("/MalformedBoolean/0")
25924  21210   
                .method("POST")
25925         -
                .header("timestamp", "1985-04-12T23:20:50.52Z")
25926  21211   
                .body(::aws_smithy_http_server::body::Body::empty())
25927  21212   
                .unwrap();
25928  21213   
            #[allow(unused_mut)]
25929  21214   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
25930  21215   
            let config = crate::service::RestJsonConfig::builder().build();
25931  21216   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
25932         -
                            .malformed_timestamp_header_epoch(move |input: crate::input::MalformedTimestampHeaderEpochInput| {
       21217  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
25933  21218   
                                let sender = sender.clone();
25934  21219   
                                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> };
       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> };
25936  21221   
                                    sender.send(()).await.expect("receiver dropped early");
25937  21222   
                                    result
25938  21223   
                                }
25939  21224   
                            })
25940  21225   
                            .build_unchecked();
25941  21226   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
25942  21227   
                .await
25943  21228   
                .expect("unable to make an HTTP request");
25944  21229   
            ::pretty_assertions::assert_eq!(
25945  21230   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
25946  21231   
                http_response.status()
25947  21232   
            );
25948  21233   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
25949  21234   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
25950  21235   
                http_response.headers(),
25951  21236   
                expected_headers,
25952  21237   
            ));
25953  21238   
        }
25954  21239   
    }
25955         -
    /// When the format is epoch-seconds, RFC3339 timestamps are rejected with a
25956         -
    /// 400 SerializationException
25957         -
    /// Test ID: RestJsonHeaderTimestampEpochRejectsDateTime_case1
       21240  +
    /// Attempted string coercion should result in SerializationException
       21241  +
    /// Test ID: RestJsonPathBooleanStringCoercion_case19
25958  21242   
    #[::tokio::test]
25959         -
    async fn rest_json_header_timestamp_epoch_rejects_date_time_case1_malformed_request() {
       21243  +
    #[::tracing_test::traced_test]
       21244  +
    async fn rest_json_path_boolean_string_coercion_case19_malformed_request() {
25960  21245   
        {
25961  21246   
            #[allow(unused_mut)]
25962  21247   
            let mut http_request = http::Request::builder()
25963         -
                .uri("/MalformedTimestampHeaderEpoch")
       21248  +
                .uri("/MalformedBoolean/off")
25964  21249   
                .method("POST")
25965         -
                .header("timestamp", "1985-04-12T23:20:50Z")
25966  21250   
                .body(::aws_smithy_http_server::body::Body::empty())
25967  21251   
                .unwrap();
25968  21252   
            #[allow(unused_mut)]
25969  21253   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
25970  21254   
            let config = crate::service::RestJsonConfig::builder().build();
25971  21255   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
25972         -
                            .malformed_timestamp_header_epoch(move |input: crate::input::MalformedTimestampHeaderEpochInput| {
       21256  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
25973  21257   
                                let sender = sender.clone();
25974  21258   
                                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> };
       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> };
25976  21260   
                                    sender.send(()).await.expect("receiver dropped early");
25977  21261   
                                    result
25978  21262   
                                }
25979  21263   
                            })
25980  21264   
                            .build_unchecked();
25981  21265   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
25982  21266   
                .await
25983  21267   
                .expect("unable to make an HTTP request");
25984  21268   
            ::pretty_assertions::assert_eq!(
25985  21269   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
25986  21270   
                http_response.status()
25987  21271   
            );
25988  21272   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
25989  21273   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
25990  21274   
                http_response.headers(),
25991  21275   
                expected_headers,
25992  21276   
            ));
25993  21277   
        }
25994  21278   
    }
25995         -
    /// When the format is epoch-seconds, RFC3339 timestamps are rejected with a
25996         -
    /// 400 SerializationException
25997         -
    /// Test ID: RestJsonHeaderTimestampEpochRejectsDateTime_case2
       21279  +
    /// Attempted string coercion should result in SerializationException
       21280  +
    /// Test ID: RestJsonPathBooleanStringCoercion_case20
25998  21281   
    #[::tokio::test]
25999         -
    async fn rest_json_header_timestamp_epoch_rejects_date_time_case2_malformed_request() {
       21282  +
    #[::tracing_test::traced_test]
       21283  +
    async fn rest_json_path_boolean_string_coercion_case20_malformed_request() {
26000  21284   
        {
26001  21285   
            #[allow(unused_mut)]
26002  21286   
            let mut http_request = http::Request::builder()
26003         -
                .uri("/MalformedTimestampHeaderEpoch")
       21287  +
                .uri("/MalformedBoolean/Off")
26004  21288   
                .method("POST")
26005         -
                .header("timestamp", "1996-12-19T16:39:57-08:00")
26006  21289   
                .body(::aws_smithy_http_server::body::Body::empty())
26007  21290   
                .unwrap();
26008  21291   
            #[allow(unused_mut)]
26009  21292   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
26010  21293   
            let config = crate::service::RestJsonConfig::builder().build();
26011  21294   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
26012         -
                            .malformed_timestamp_header_epoch(move |input: crate::input::MalformedTimestampHeaderEpochInput| {
       21295  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
26013  21296   
                                let sender = sender.clone();
26014  21297   
                                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> };
       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> };
26016  21299   
                                    sender.send(()).await.expect("receiver dropped early");
26017  21300   
                                    result
26018  21301   
                                }
26019  21302   
                            })
26020  21303   
                            .build_unchecked();
26021  21304   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
26022  21305   
                .await
26023  21306   
                .expect("unable to make an HTTP request");
26024  21307   
            ::pretty_assertions::assert_eq!(
26025  21308   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
26026  21309   
                http_response.status()
26027  21310   
            );
26028  21311   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
26029  21312   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
26030  21313   
                http_response.headers(),
26031  21314   
                expected_headers,
26032  21315   
            ));
26033  21316   
        }
26034  21317   
    }
26035         -
    /// When the format is epoch-seconds, IMF-fixdate timestamps are rejected with a
26036         -
    /// 400 SerializationException
26037         -
    /// Test ID: RestJsonHeaderTimestampEpochRejectsHttpDate_case0
       21318  +
    /// Attempted string coercion should result in SerializationException
       21319  +
    /// Test ID: RestJsonPathBooleanStringCoercion_case21
26038  21320   
    #[::tokio::test]
26039         -
    async fn rest_json_header_timestamp_epoch_rejects_http_date_case0_malformed_request() {
       21321  +
    #[::tracing_test::traced_test]
       21322  +
    async fn rest_json_path_boolean_string_coercion_case21_malformed_request() {
26040  21323   
        {
26041  21324   
            #[allow(unused_mut)]
26042  21325   
            let mut http_request = http::Request::builder()
26043         -
                .uri("/MalformedTimestampHeaderEpoch")
       21326  +
                .uri("/MalformedBoolean/OFF")
26044  21327   
                .method("POST")
26045         -
                .header("timestamp", "Tue, 29 Apr 2014 18:30:38 GMT")
26046  21328   
                .body(::aws_smithy_http_server::body::Body::empty())
26047  21329   
                .unwrap();
26048  21330   
            #[allow(unused_mut)]
26049  21331   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
26050  21332   
            let config = crate::service::RestJsonConfig::builder().build();
26051  21333   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
26052         -
                            .malformed_timestamp_header_epoch(move |input: crate::input::MalformedTimestampHeaderEpochInput| {
       21334  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
26053  21335   
                                let sender = sender.clone();
26054  21336   
                                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> };
       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> };
26056  21338   
                                    sender.send(()).await.expect("receiver dropped early");
26057  21339   
                                    result
26058  21340   
                                }
26059  21341   
                            })
26060  21342   
                            .build_unchecked();
26061  21343   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
26062  21344   
                .await
26063  21345   
                .expect("unable to make an HTTP request");
26064  21346   
            ::pretty_assertions::assert_eq!(
26065  21347   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
26066  21348   
                http_response.status()
26067  21349   
            );
26068  21350   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
26069  21351   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
26070  21352   
                http_response.headers(),
26071  21353   
                expected_headers,
26072  21354   
            ));
26073  21355   
        }
26074  21356   
    }
26075         -
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
26076         -
    /// Test ID: RestJsonHeaderTimestampEpochRejectsMalformedValues_case0
       21357  +
    /// Attempted string coercion should result in SerializationException
       21358  +
    /// Test ID: RestJsonQueryBooleanStringCoercion_case0
26077  21359   
    #[::tokio::test]
26078         -
    async fn rest_json_header_timestamp_epoch_rejects_malformed_values_case0_malformed_request() {
       21360  +
    #[::tracing_test::traced_test]
       21361  +
    async fn rest_json_query_boolean_string_coercion_case0_malformed_request() {
26079  21362   
        {
26080  21363   
            #[allow(unused_mut)]
26081  21364   
            let mut http_request = http::Request::builder()
26082         -
                .uri("/MalformedTimestampHeaderEpoch")
       21365  +
                .uri("/MalformedBoolean/true")
26083  21366   
                .method("POST")
26084         -
                .header("timestamp", "true")
26085  21367   
                .body(::aws_smithy_http_server::body::Body::empty())
26086  21368   
                .unwrap();
       21369  +
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=True"
       21370  +
                .parse()
       21371  +
                .unwrap();
26087  21372   
            #[allow(unused_mut)]
26088  21373   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
26089  21374   
            let config = crate::service::RestJsonConfig::builder().build();
26090  21375   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
26091         -
                            .malformed_timestamp_header_epoch(move |input: crate::input::MalformedTimestampHeaderEpochInput| {
       21376  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
26092  21377   
                                let sender = sender.clone();
26093  21378   
                                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> };
       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> };
26095  21380   
                                    sender.send(()).await.expect("receiver dropped early");
26096  21381   
                                    result
26097  21382   
                                }
26098  21383   
                            })
26099  21384   
                            .build_unchecked();
26100  21385   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
26101  21386   
                .await
26102  21387   
                .expect("unable to make an HTTP request");
26103  21388   
            ::pretty_assertions::assert_eq!(
26104  21389   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
26105  21390   
                http_response.status()
26106  21391   
            );
26107  21392   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
26108  21393   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
26109  21394   
                http_response.headers(),
26110  21395   
                expected_headers,
26111  21396   
            ));
26112  21397   
        }
26113  21398   
    }
26114         -
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
26115         -
    /// Test ID: RestJsonHeaderTimestampEpochRejectsMalformedValues_case1
       21399  +
    /// Attempted string coercion should result in SerializationException
       21400  +
    /// Test ID: RestJsonQueryBooleanStringCoercion_case1
26116  21401   
    #[::tokio::test]
26117         -
    async fn rest_json_header_timestamp_epoch_rejects_malformed_values_case1_malformed_request() {
       21402  +
    #[::tracing_test::traced_test]
       21403  +
    async fn rest_json_query_boolean_string_coercion_case1_malformed_request() {
26118  21404   
        {
26119  21405   
            #[allow(unused_mut)]
26120  21406   
            let mut http_request = http::Request::builder()
26121         -
                .uri("/MalformedTimestampHeaderEpoch")
       21407  +
                .uri("/MalformedBoolean/true")
26122  21408   
                .method("POST")
26123         -
                .header("timestamp", "1515531081ABC")
26124  21409   
                .body(::aws_smithy_http_server::body::Body::empty())
26125  21410   
                .unwrap();
       21411  +
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=TRUE"
       21412  +
                .parse()
       21413  +
                .unwrap();
26126  21414   
            #[allow(unused_mut)]
26127  21415   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
26128  21416   
            let config = crate::service::RestJsonConfig::builder().build();
26129  21417   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
26130         -
                            .malformed_timestamp_header_epoch(move |input: crate::input::MalformedTimestampHeaderEpochInput| {
       21418  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
26131  21419   
                                let sender = sender.clone();
26132  21420   
                                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> };
       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> };
26134  21422   
                                    sender.send(()).await.expect("receiver dropped early");
26135  21423   
                                    result
26136  21424   
                                }
26137  21425   
                            })
26138  21426   
                            .build_unchecked();
26139  21427   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
26140  21428   
                .await
26141  21429   
                .expect("unable to make an HTTP request");
26142  21430   
            ::pretty_assertions::assert_eq!(
26143  21431   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
26144  21432   
                http_response.status()
26145  21433   
            );
26146  21434   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
26147  21435   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
26148  21436   
                http_response.headers(),
26149  21437   
                expected_headers,
26150  21438   
            ));
26151  21439   
        }
26152  21440   
    }
26153         -
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
26154         -
    /// Test ID: RestJsonHeaderTimestampEpochRejectsMalformedValues_case2
       21441  +
    /// Attempted string coercion should result in SerializationException
       21442  +
    /// Test ID: RestJsonQueryBooleanStringCoercion_case2
26155  21443   
    #[::tokio::test]
26156         -
    async fn rest_json_header_timestamp_epoch_rejects_malformed_values_case2_malformed_request() {
       21444  +
    #[::tracing_test::traced_test]
       21445  +
    async fn rest_json_query_boolean_string_coercion_case2_malformed_request() {
26157  21446   
        {
26158  21447   
            #[allow(unused_mut)]
26159  21448   
            let mut http_request = http::Request::builder()
26160         -
                .uri("/MalformedTimestampHeaderEpoch")
       21449  +
                .uri("/MalformedBoolean/true")
26161  21450   
                .method("POST")
26162         -
                .header("timestamp", "0x42")
26163  21451   
                .body(::aws_smithy_http_server::body::Body::empty())
26164  21452   
                .unwrap();
       21453  +
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=y".parse().unwrap();
26165  21454   
            #[allow(unused_mut)]
26166  21455   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
26167  21456   
            let config = crate::service::RestJsonConfig::builder().build();
26168  21457   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
26169         -
                            .malformed_timestamp_header_epoch(move |input: crate::input::MalformedTimestampHeaderEpochInput| {
       21458  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
26170  21459   
                                let sender = sender.clone();
26171  21460   
                                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> };
       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> };
26173  21462   
                                    sender.send(()).await.expect("receiver dropped early");
26174  21463   
                                    result
26175  21464   
                                }
26176  21465   
                            })
26177  21466   
                            .build_unchecked();
26178  21467   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
26179  21468   
                .await
26180  21469   
                .expect("unable to make an HTTP request");
26181  21470   
            ::pretty_assertions::assert_eq!(
26182  21471   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
26183  21472   
                http_response.status()
26184  21473   
            );
26185  21474   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
26186  21475   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
26187  21476   
                http_response.headers(),
26188  21477   
                expected_headers,
26189  21478   
            ));
26190  21479   
        }
26191  21480   
    }
26192         -
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
26193         -
    /// Test ID: RestJsonHeaderTimestampEpochRejectsMalformedValues_case3
       21481  +
    /// Attempted string coercion should result in SerializationException
       21482  +
    /// Test ID: RestJsonQueryBooleanStringCoercion_case3
26194  21483   
    #[::tokio::test]
26195         -
    async fn rest_json_header_timestamp_epoch_rejects_malformed_values_case3_malformed_request() {
       21484  +
    #[::tracing_test::traced_test]
       21485  +
    async fn rest_json_query_boolean_string_coercion_case3_malformed_request() {
26196  21486   
        {
26197  21487   
            #[allow(unused_mut)]
26198  21488   
            let mut http_request = http::Request::builder()
26199         -
                .uri("/MalformedTimestampHeaderEpoch")
       21489  +
                .uri("/MalformedBoolean/true")
26200  21490   
                .method("POST")
26201         -
                .header("timestamp", "1515531081.123.456")
26202  21491   
                .body(::aws_smithy_http_server::body::Body::empty())
26203  21492   
                .unwrap();
       21493  +
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=Y".parse().unwrap();
26204  21494   
            #[allow(unused_mut)]
26205  21495   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
26206  21496   
            let config = crate::service::RestJsonConfig::builder().build();
26207  21497   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
26208         -
                            .malformed_timestamp_header_epoch(move |input: crate::input::MalformedTimestampHeaderEpochInput| {
       21498  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
26209  21499   
                                let sender = sender.clone();
26210  21500   
                                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> };
       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> };
26212  21502   
                                    sender.send(()).await.expect("receiver dropped early");
26213  21503   
                                    result
26214  21504   
                                }
26215  21505   
                            })
26216  21506   
                            .build_unchecked();
26217  21507   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
26218  21508   
                .await
26219  21509   
                .expect("unable to make an HTTP request");
26220  21510   
            ::pretty_assertions::assert_eq!(
26221  21511   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
26222  21512   
                http_response.status()
26223  21513   
            );
26224  21514   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
26225  21515   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
26226  21516   
                http_response.headers(),
26227  21517   
                expected_headers,
26228  21518   
            ));
26229  21519   
        }
26230  21520   
    }
26231         -
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
26232         -
    /// Test ID: RestJsonHeaderTimestampEpochRejectsMalformedValues_case4
       21521  +
    /// Attempted string coercion should result in SerializationException
       21522  +
    /// Test ID: RestJsonQueryBooleanStringCoercion_case4
26233  21523   
    #[::tokio::test]
26234         -
    async fn rest_json_header_timestamp_epoch_rejects_malformed_values_case4_malformed_request() {
       21524  +
    #[::tracing_test::traced_test]
       21525  +
    async fn rest_json_query_boolean_string_coercion_case4_malformed_request() {
26235  21526   
        {
26236  21527   
            #[allow(unused_mut)]
26237  21528   
            let mut http_request = http::Request::builder()
26238         -
                .uri("/MalformedTimestampHeaderEpoch")
       21529  +
                .uri("/MalformedBoolean/true")
26239  21530   
                .method("POST")
26240         -
                .header("timestamp", "Infinity")
26241  21531   
                .body(::aws_smithy_http_server::body::Body::empty())
26242  21532   
                .unwrap();
       21533  +
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=yes".parse().unwrap();
26243  21534   
            #[allow(unused_mut)]
26244  21535   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
26245  21536   
            let config = crate::service::RestJsonConfig::builder().build();
26246  21537   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
26247         -
                            .malformed_timestamp_header_epoch(move |input: crate::input::MalformedTimestampHeaderEpochInput| {
       21538  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
26248  21539   
                                let sender = sender.clone();
26249  21540   
                                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> };
       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> };
26251  21542   
                                    sender.send(()).await.expect("receiver dropped early");
26252  21543   
                                    result
26253  21544   
                                }
26254  21545   
                            })
26255  21546   
                            .build_unchecked();
26256  21547   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
26257  21548   
                .await
26258  21549   
                .expect("unable to make an HTTP request");
26259  21550   
            ::pretty_assertions::assert_eq!(
26260  21551   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
26261  21552   
                http_response.status()
26262  21553   
            );
26263  21554   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
26264  21555   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
26265  21556   
                http_response.headers(),
26266  21557   
                expected_headers,
26267  21558   
            ));
26268  21559   
        }
26269  21560   
    }
26270         -
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
26271         -
    /// Test ID: RestJsonHeaderTimestampEpochRejectsMalformedValues_case5
       21561  +
    /// Attempted string coercion should result in SerializationException
       21562  +
    /// Test ID: RestJsonQueryBooleanStringCoercion_case5
26272  21563   
    #[::tokio::test]
26273         -
    async fn rest_json_header_timestamp_epoch_rejects_malformed_values_case5_malformed_request() {
       21564  +
    #[::tracing_test::traced_test]
       21565  +
    async fn rest_json_query_boolean_string_coercion_case5_malformed_request() {
26274  21566   
        {
26275  21567   
            #[allow(unused_mut)]
26276  21568   
            let mut http_request = http::Request::builder()
26277         -
                .uri("/MalformedTimestampHeaderEpoch")
       21569  +
                .uri("/MalformedBoolean/true")
26278  21570   
                .method("POST")
26279         -
                .header("timestamp", "-Infinity")
26280  21571   
                .body(::aws_smithy_http_server::body::Body::empty())
26281  21572   
                .unwrap();
       21573  +
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=Yes".parse().unwrap();
26282  21574   
            #[allow(unused_mut)]
26283  21575   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
26284  21576   
            let config = crate::service::RestJsonConfig::builder().build();
26285  21577   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
26286         -
                            .malformed_timestamp_header_epoch(move |input: crate::input::MalformedTimestampHeaderEpochInput| {
       21578  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
26287  21579   
                                let sender = sender.clone();
26288  21580   
                                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> };
       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> };
26290  21582   
                                    sender.send(()).await.expect("receiver dropped early");
26291  21583   
                                    result
26292  21584   
                                }
26293  21585   
                            })
26294  21586   
                            .build_unchecked();
26295  21587   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
26296  21588   
                .await
26297  21589   
                .expect("unable to make an HTTP request");
26298  21590   
            ::pretty_assertions::assert_eq!(
26299  21591   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
26300  21592   
                http_response.status()
26301  21593   
            );
26302  21594   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
26303  21595   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
26304  21596   
                http_response.headers(),
26305  21597   
                expected_headers,
26306  21598   
            ));
26307  21599   
        }
26308  21600   
    }
26309         -
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
26310         -
    /// Test ID: RestJsonHeaderTimestampEpochRejectsMalformedValues_case6
       21601  +
    /// Attempted string coercion should result in SerializationException
       21602  +
    /// Test ID: RestJsonQueryBooleanStringCoercion_case6
26311  21603   
    #[::tokio::test]
26312         -
    async fn rest_json_header_timestamp_epoch_rejects_malformed_values_case6_malformed_request() {
       21604  +
    #[::tracing_test::traced_test]
       21605  +
    async fn rest_json_query_boolean_string_coercion_case6_malformed_request() {
26313  21606   
        {
26314  21607   
            #[allow(unused_mut)]
26315  21608   
            let mut http_request = http::Request::builder()
26316         -
                .uri("/MalformedTimestampHeaderEpoch")
       21609  +
                .uri("/MalformedBoolean/true")
26317  21610   
                .method("POST")
26318         -
                .header("timestamp", "NaN")
26319  21611   
                .body(::aws_smithy_http_server::body::Body::empty())
26320  21612   
                .unwrap();
       21613  +
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=YES".parse().unwrap();
26321  21614   
            #[allow(unused_mut)]
26322  21615   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
26323  21616   
            let config = crate::service::RestJsonConfig::builder().build();
26324  21617   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
26325         -
                            .malformed_timestamp_header_epoch(move |input: crate::input::MalformedTimestampHeaderEpochInput| {
       21618  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
26326  21619   
                                let sender = sender.clone();
26327  21620   
                                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> };
       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> };
26329  21622   
                                    sender.send(()).await.expect("receiver dropped early");
26330  21623   
                                    result
26331  21624   
                                }
26332  21625   
                            })
26333  21626   
                            .build_unchecked();
26334  21627   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
26335  21628   
                .await
26336  21629   
                .expect("unable to make an HTTP request");
26337  21630   
            ::pretty_assertions::assert_eq!(
26338  21631   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
26339  21632   
                http_response.status()
26340  21633   
            );
26341  21634   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
26342  21635   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
26343  21636   
                http_response.headers(),
26344  21637   
                expected_headers,
26345  21638   
            ));
26346  21639   
        }
26347  21640   
    }
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
       21641  +
    /// Attempted string coercion should result in SerializationException
       21642  +
    /// Test ID: RestJsonQueryBooleanStringCoercion_case7
26355  21643   
    #[::tokio::test]
26356         -
    async fn rest_json_path_timestamp_default_rejects_http_date_case0_malformed_request() {
       21644  +
    #[::tracing_test::traced_test]
       21645  +
    async fn rest_json_query_boolean_string_coercion_case7_malformed_request() {
26357  21646   
        {
26358  21647   
            #[allow(unused_mut)]
26359  21648   
            let mut http_request = http::Request::builder()
26360         -
                .uri("/MalformedTimestampPathDefault/Tue%2C%2029%20Apr%202014%2018%3A30%3A38%20GMT")
       21649  +
                .uri("/MalformedBoolean/true")
26361  21650   
                .method("POST")
26362  21651   
                .body(::aws_smithy_http_server::body::Body::empty())
26363  21652   
                .unwrap();
       21653  +
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=1".parse().unwrap();
26364  21654   
            #[allow(unused_mut)]
26365  21655   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
26366  21656   
            let config = crate::service::RestJsonConfig::builder().build();
26367  21657   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
26368         -
                            .malformed_timestamp_path_default(move |input: crate::input::MalformedTimestampPathDefaultInput| {
       21658  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
26369  21659   
                                let sender = sender.clone();
26370  21660   
                                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> };
       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> };
26372  21662   
                                    sender.send(()).await.expect("receiver dropped early");
26373  21663   
                                    result
26374  21664   
                                }
26375  21665   
                            })
26376  21666   
                            .build_unchecked();
26377  21667   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
26378  21668   
                .await
26379  21669   
                .expect("unable to make an HTTP request");
26380  21670   
            ::pretty_assertions::assert_eq!(
26381  21671   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
26382  21672   
                http_response.status()
26383  21673   
            );
26384  21674   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
26385  21675   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
26386  21676   
                http_response.headers(),
26387  21677   
                expected_headers,
26388  21678   
            ));
26389  21679   
        }
26390  21680   
    }
26391         -
    /// By default, IMF-fixdate timestamps are rejected with a
26392         -
    /// 400 SerializationException
26393         -
    /// Test ID: RestJsonPathTimestampDefaultRejectsHttpDate_case1
       21681  +
    /// Attempted string coercion should result in SerializationException
       21682  +
    /// Test ID: RestJsonQueryBooleanStringCoercion_case8
26394  21683   
    #[::tokio::test]
26395         -
    async fn rest_json_path_timestamp_default_rejects_http_date_case1_malformed_request() {
       21684  +
    #[::tracing_test::traced_test]
       21685  +
    async fn rest_json_query_boolean_string_coercion_case8_malformed_request() {
26396  21686   
        {
26397  21687   
            #[allow(unused_mut)]
26398         -
                        let mut http_request = http::Request::builder()
26399         -
                            .uri("/MalformedTimestampPathDefault/Sun%2C%2002%20Jan%202000%2020%3A34%3A56.000%20GMT")
26400         -
                            .method("POST")
26401         -
            .body(::aws_smithy_http_server::body::Body::empty()).unwrap();
       21688  +
            let mut http_request = http::Request::builder()
       21689  +
                .uri("/MalformedBoolean/true")
       21690  +
                .method("POST")
       21691  +
                .body(::aws_smithy_http_server::body::Body::empty())
       21692  +
                .unwrap();
       21693  +
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=on".parse().unwrap();
26402  21694   
            #[allow(unused_mut)]
26403  21695   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
26404  21696   
            let config = crate::service::RestJsonConfig::builder().build();
26405  21697   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
26406         -
                            .malformed_timestamp_path_default(move |input: crate::input::MalformedTimestampPathDefaultInput| {
       21698  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
26407  21699   
                                let sender = sender.clone();
26408  21700   
                                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> };
       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> };
26410  21702   
                                    sender.send(()).await.expect("receiver dropped early");
26411  21703   
                                    result
26412  21704   
                                }
26413  21705   
                            })
26414  21706   
                            .build_unchecked();
26415  21707   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
26416  21708   
                .await
26417  21709   
                .expect("unable to make an HTTP request");
26418  21710   
            ::pretty_assertions::assert_eq!(
26419  21711   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
26420  21712   
                http_response.status()
26421  21713   
            );
26422  21714   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
26423  21715   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
26424  21716   
                http_response.headers(),
26425  21717   
                expected_headers,
26426  21718   
            ));
26427  21719   
        }
26428  21720   
    }
26429         -
    /// By default, epoch second timestamps are rejected with a
26430         -
    /// 400 SerializationException
26431         -
    /// Test ID: RestJsonPathTimestampDefaultRejectsEpochSeconds_case0
       21721  +
    /// Attempted string coercion should result in SerializationException
       21722  +
    /// Test ID: RestJsonQueryBooleanStringCoercion_case9
26432  21723   
    #[::tokio::test]
26433         -
    async fn rest_json_path_timestamp_default_rejects_epoch_seconds_case0_malformed_request() {
       21724  +
    #[::tracing_test::traced_test]
       21725  +
    async fn rest_json_query_boolean_string_coercion_case9_malformed_request() {
26434  21726   
        {
26435  21727   
            #[allow(unused_mut)]
26436  21728   
            let mut http_request = http::Request::builder()
26437         -
                .uri("/MalformedTimestampPathDefault/1515531081.1234")
       21729  +
                .uri("/MalformedBoolean/true")
26438  21730   
                .method("POST")
26439  21731   
                .body(::aws_smithy_http_server::body::Body::empty())
26440  21732   
                .unwrap();
       21733  +
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=On".parse().unwrap();
26441  21734   
            #[allow(unused_mut)]
26442  21735   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
26443  21736   
            let config = crate::service::RestJsonConfig::builder().build();
26444  21737   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
26445         -
                            .malformed_timestamp_path_default(move |input: crate::input::MalformedTimestampPathDefaultInput| {
       21738  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
26446  21739   
                                let sender = sender.clone();
26447  21740   
                                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> };
       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> };
26449  21742   
                                    sender.send(()).await.expect("receiver dropped early");
26450  21743   
                                    result
26451  21744   
                                }
26452  21745   
                            })
26453  21746   
                            .build_unchecked();
26454  21747   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
26455  21748   
                .await
26456  21749   
                .expect("unable to make an HTTP request");
26457  21750   
            ::pretty_assertions::assert_eq!(
26458  21751   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
26459  21752   
                http_response.status()
26460  21753   
            );
26461  21754   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
26462  21755   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
26463  21756   
                http_response.headers(),
26464  21757   
                expected_headers,
26465  21758   
            ));
26466  21759   
        }
26467  21760   
    }
26468         -
    /// By default, epoch second timestamps are rejected with a
26469         -
    /// 400 SerializationException
26470         -
    /// Test ID: RestJsonPathTimestampDefaultRejectsEpochSeconds_case1
       21761  +
    /// Attempted string coercion should result in SerializationException
       21762  +
    /// Test ID: RestJsonQueryBooleanStringCoercion_case10
26471  21763   
    #[::tokio::test]
26472         -
    async fn rest_json_path_timestamp_default_rejects_epoch_seconds_case1_malformed_request() {
       21764  +
    #[::tracing_test::traced_test]
       21765  +
    async fn rest_json_query_boolean_string_coercion_case10_malformed_request() {
26473  21766   
        {
26474  21767   
            #[allow(unused_mut)]
26475  21768   
            let mut http_request = http::Request::builder()
26476         -
                .uri("/MalformedTimestampPathDefault/1515531081")
       21769  +
                .uri("/MalformedBoolean/true")
26477  21770   
                .method("POST")
26478  21771   
                .body(::aws_smithy_http_server::body::Body::empty())
26479  21772   
                .unwrap();
       21773  +
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=ON".parse().unwrap();
26480  21774   
            #[allow(unused_mut)]
26481  21775   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
26482  21776   
            let config = crate::service::RestJsonConfig::builder().build();
26483  21777   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
26484         -
                            .malformed_timestamp_path_default(move |input: crate::input::MalformedTimestampPathDefaultInput| {
       21778  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
26485  21779   
                                let sender = sender.clone();
26486  21780   
                                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> };
       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> };
26488  21782   
                                    sender.send(()).await.expect("receiver dropped early");
26489  21783   
                                    result
26490  21784   
                                }
26491  21785   
                            })
26492  21786   
                            .build_unchecked();
26493  21787   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
26494  21788   
                .await
26495  21789   
                .expect("unable to make an HTTP request");
26496  21790   
            ::pretty_assertions::assert_eq!(
26497  21791   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
26498  21792   
                http_response.status()
26499  21793   
            );
26500  21794   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
26501  21795   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
26502  21796   
                http_response.headers(),
26503  21797   
                expected_headers,
26504  21798   
            ));
26505  21799   
        }
26506  21800   
    }
26507         -
    /// UTC offsets must be rejected with a
26508         -
    /// 400 SerializationException
26509         -
    /// Test ID: RestJsonPathTimestampDefaultRejectsUTCOffsets
       21801  +
    /// Attempted string coercion should result in SerializationException
       21802  +
    /// Test ID: RestJsonQueryBooleanStringCoercion_case11
26510  21803   
    #[::tokio::test]
26511         -
    async fn rest_json_path_timestamp_default_rejects_utc_offsets_malformed_request() {
       21804  +
    #[::tracing_test::traced_test]
       21805  +
    async fn rest_json_query_boolean_string_coercion_case11_malformed_request() {
26512  21806   
        {
26513  21807   
            #[allow(unused_mut)]
26514  21808   
            let mut http_request = http::Request::builder()
26515         -
                .uri("/MalformedTimestampPathDefault/1996-12-19T16%3A39%3A57-08%3A00")
       21809  +
                .uri("/MalformedBoolean/true")
26516  21810   
                .method("POST")
26517  21811   
                .body(::aws_smithy_http_server::body::Body::empty())
26518  21812   
                .unwrap();
       21813  +
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=False"
       21814  +
                .parse()
       21815  +
                .unwrap();
26519  21816   
            #[allow(unused_mut)]
26520  21817   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
26521  21818   
            let config = crate::service::RestJsonConfig::builder().build();
26522  21819   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
26523         -
                            .malformed_timestamp_path_default(move |input: crate::input::MalformedTimestampPathDefaultInput| {
       21820  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
26524  21821   
                                let sender = sender.clone();
26525  21822   
                                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> };
       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> };
26527  21824   
                                    sender.send(()).await.expect("receiver dropped early");
26528  21825   
                                    result
26529  21826   
                                }
26530  21827   
                            })
26531  21828   
                            .build_unchecked();
26532  21829   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
26533  21830   
                .await
26534  21831   
                .expect("unable to make an HTTP request");
26535  21832   
            ::pretty_assertions::assert_eq!(
26536  21833   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
26537  21834   
                http_response.status()
26538  21835   
            );
26539  21836   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
26540  21837   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
26541  21838   
                http_response.headers(),
26542  21839   
                expected_headers,
26543  21840   
            ));
26544  21841   
        }
26545  21842   
    }
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
       21843  +
    /// Attempted string coercion should result in SerializationException
       21844  +
    /// Test ID: RestJsonQueryBooleanStringCoercion_case12
26549  21845   
    #[::tokio::test]
26550         -
    async fn rest_json_path_timestamp_default_rejects_different8601_formats_case0_malformed_request(
26551         -
    ) {
       21846  +
    #[::tracing_test::traced_test]
       21847  +
    async fn rest_json_query_boolean_string_coercion_case12_malformed_request() {
26552  21848   
        {
26553  21849   
            #[allow(unused_mut)]
26554  21850   
            let mut http_request = http::Request::builder()
26555         -
                .uri("/MalformedTimestampPathDefault/1996-12-19T16%3A39%3A57%2B00")
       21851  +
                .uri("/MalformedBoolean/true")
26556  21852   
                .method("POST")
26557  21853   
                .body(::aws_smithy_http_server::body::Body::empty())
26558  21854   
                .unwrap();
       21855  +
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=FALSE"
       21856  +
                .parse()
       21857  +
                .unwrap();
26559  21858   
            #[allow(unused_mut)]
26560  21859   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
26561  21860   
            let config = crate::service::RestJsonConfig::builder().build();
26562  21861   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
26563         -
                            .malformed_timestamp_path_default(move |input: crate::input::MalformedTimestampPathDefaultInput| {
       21862  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
26564  21863   
                                let sender = sender.clone();
26565  21864   
                                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> };
       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> };
26567  21866   
                                    sender.send(()).await.expect("receiver dropped early");
26568  21867   
                                    result
26569  21868   
                                }
26570  21869   
                            })
26571  21870   
                            .build_unchecked();
26572  21871   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
26573  21872   
                .await
26574  21873   
                .expect("unable to make an HTTP request");
26575  21874   
            ::pretty_assertions::assert_eq!(
26576  21875   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
26577  21876   
                http_response.status()
26578  21877   
            );
26579  21878   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
26580  21879   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
26581  21880   
                http_response.headers(),
26582  21881   
                expected_headers,
26583  21882   
            ));
26584  21883   
        }
26585  21884   
    }
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
       21885  +
    /// Attempted string coercion should result in SerializationException
       21886  +
    /// Test ID: RestJsonQueryBooleanStringCoercion_case13
26589  21887   
    #[::tokio::test]
26590         -
    async fn rest_json_path_timestamp_default_rejects_different8601_formats_case1_malformed_request(
26591         -
    ) {
       21888  +
    #[::tracing_test::traced_test]
       21889  +
    async fn rest_json_query_boolean_string_coercion_case13_malformed_request() {
26592  21890   
        {
26593  21891   
            #[allow(unused_mut)]
26594  21892   
            let mut http_request = http::Request::builder()
26595         -
                .uri("/MalformedTimestampPathDefault/1996-12-19T16%3A39%3A57%2B00Z")
       21893  +
                .uri("/MalformedBoolean/true")
26596  21894   
                .method("POST")
26597  21895   
                .body(::aws_smithy_http_server::body::Body::empty())
26598  21896   
                .unwrap();
       21897  +
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=n".parse().unwrap();
26599  21898   
            #[allow(unused_mut)]
26600  21899   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
26601  21900   
            let config = crate::service::RestJsonConfig::builder().build();
26602  21901   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
26603         -
                            .malformed_timestamp_path_default(move |input: crate::input::MalformedTimestampPathDefaultInput| {
       21902  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
26604  21903   
                                let sender = sender.clone();
26605  21904   
                                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> };
       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> };
26607  21906   
                                    sender.send(()).await.expect("receiver dropped early");
26608  21907   
                                    result
26609  21908   
                                }
26610  21909   
                            })
26611  21910   
                            .build_unchecked();
26612  21911   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
26613  21912   
                .await
26614  21913   
                .expect("unable to make an HTTP request");
26615  21914   
            ::pretty_assertions::assert_eq!(
26616  21915   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
26617  21916   
                http_response.status()
26618  21917   
            );
26619  21918   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
26620  21919   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
26621  21920   
                http_response.headers(),
26622  21921   
                expected_headers,
26623  21922   
            ));
26624  21923   
        }
26625  21924   
    }
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
       21925  +
    /// Attempted string coercion should result in SerializationException
       21926  +
    /// Test ID: RestJsonQueryBooleanStringCoercion_case14
26629  21927   
    #[::tokio::test]
26630         -
    async fn rest_json_path_timestamp_default_rejects_different8601_formats_case2_malformed_request(
26631         -
    ) {
       21928  +
    #[::tracing_test::traced_test]
       21929  +
    async fn rest_json_query_boolean_string_coercion_case14_malformed_request() {
26632  21930   
        {
26633  21931   
            #[allow(unused_mut)]
26634  21932   
            let mut http_request = http::Request::builder()
26635         -
                .uri("/MalformedTimestampPathDefault/1996-12-19T16%3A39%3A57")
       21933  +
                .uri("/MalformedBoolean/true")
26636  21934   
                .method("POST")
26637  21935   
                .body(::aws_smithy_http_server::body::Body::empty())
26638  21936   
                .unwrap();
       21937  +
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=N".parse().unwrap();
26639  21938   
            #[allow(unused_mut)]
26640  21939   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
26641  21940   
            let config = crate::service::RestJsonConfig::builder().build();
26642  21941   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
26643         -
                            .malformed_timestamp_path_default(move |input: crate::input::MalformedTimestampPathDefaultInput| {
       21942  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
26644  21943   
                                let sender = sender.clone();
26645  21944   
                                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> };
       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> };
26647  21946   
                                    sender.send(()).await.expect("receiver dropped early");
26648  21947   
                                    result
26649  21948   
                                }
26650  21949   
                            })
26651  21950   
                            .build_unchecked();
26652  21951   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
26653  21952   
                .await
26654  21953   
                .expect("unable to make an HTTP request");
26655  21954   
            ::pretty_assertions::assert_eq!(
26656  21955   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
26657  21956   
                http_response.status()
26658  21957   
            );
26659  21958   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
26660  21959   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
26661  21960   
                http_response.headers(),
26662  21961   
                expected_headers,
26663  21962   
            ));
26664  21963   
        }
26665  21964   
    }
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
       21965  +
    /// Attempted string coercion should result in SerializationException
       21966  +
    /// Test ID: RestJsonQueryBooleanStringCoercion_case15
26669  21967   
    #[::tokio::test]
26670         -
    async fn rest_json_path_timestamp_default_rejects_different8601_formats_case3_malformed_request(
26671         -
    ) {
       21968  +
    #[::tracing_test::traced_test]
       21969  +
    async fn rest_json_query_boolean_string_coercion_case15_malformed_request() {
26672  21970   
        {
26673  21971   
            #[allow(unused_mut)]
26674  21972   
            let mut http_request = http::Request::builder()
26675         -
                .uri("/MalformedTimestampPathDefault/1996-12-19T163957")
       21973  +
                .uri("/MalformedBoolean/true")
26676  21974   
                .method("POST")
26677  21975   
                .body(::aws_smithy_http_server::body::Body::empty())
26678  21976   
                .unwrap();
       21977  +
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=no".parse().unwrap();
26679  21978   
            #[allow(unused_mut)]
26680  21979   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
26681  21980   
            let config = crate::service::RestJsonConfig::builder().build();
26682  21981   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
26683         -
                            .malformed_timestamp_path_default(move |input: crate::input::MalformedTimestampPathDefaultInput| {
       21982  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
26684  21983   
                                let sender = sender.clone();
26685  21984   
                                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> };
       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> };
26687  21986   
                                    sender.send(()).await.expect("receiver dropped early");
26688  21987   
                                    result
26689  21988   
                                }
26690  21989   
                            })
26691  21990   
                            .build_unchecked();
26692  21991   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
26693  21992   
                .await
26694  21993   
                .expect("unable to make an HTTP request");
26695  21994   
            ::pretty_assertions::assert_eq!(
26696  21995   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
26697  21996   
                http_response.status()
26698  21997   
            );
26699  21998   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
26700  21999   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
26701  22000   
                http_response.headers(),
26702  22001   
                expected_headers,
26703  22002   
            ));
26704  22003   
        }
26705  22004   
    }
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
       22005  +
    /// Attempted string coercion should result in SerializationException
       22006  +
    /// Test ID: RestJsonQueryBooleanStringCoercion_case16
26709  22007   
    #[::tokio::test]
26710         -
    async fn rest_json_path_timestamp_default_rejects_different8601_formats_case4_malformed_request(
26711         -
    ) {
       22008  +
    #[::tracing_test::traced_test]
       22009  +
    async fn rest_json_query_boolean_string_coercion_case16_malformed_request() {
26712  22010   
        {
26713  22011   
            #[allow(unused_mut)]
26714  22012   
            let mut http_request = http::Request::builder()
26715         -
                .uri("/MalformedTimestampPathDefault/19961219T163957Z")
       22013  +
                .uri("/MalformedBoolean/true")
26716  22014   
                .method("POST")
26717  22015   
                .body(::aws_smithy_http_server::body::Body::empty())
26718  22016   
                .unwrap();
       22017  +
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=No".parse().unwrap();
26719  22018   
            #[allow(unused_mut)]
26720  22019   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
26721  22020   
            let config = crate::service::RestJsonConfig::builder().build();
26722  22021   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
26723         -
                            .malformed_timestamp_path_default(move |input: crate::input::MalformedTimestampPathDefaultInput| {
       22022  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
26724  22023   
                                let sender = sender.clone();
26725  22024   
                                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> };
       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> };
26727  22026   
                                    sender.send(()).await.expect("receiver dropped early");
26728  22027   
                                    result
26729  22028   
                                }
26730  22029   
                            })
26731  22030   
                            .build_unchecked();
26732  22031   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
26733  22032   
                .await
26734  22033   
                .expect("unable to make an HTTP request");
26735  22034   
            ::pretty_assertions::assert_eq!(
26736  22035   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
26737  22036   
                http_response.status()
26738  22037   
            );
26739  22038   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
26740  22039   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
26741  22040   
                http_response.headers(),
26742  22041   
                expected_headers,
26743  22042   
            ));
26744  22043   
        }
26745  22044   
    }
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
       22045  +
    /// Attempted string coercion should result in SerializationException
       22046  +
    /// Test ID: RestJsonQueryBooleanStringCoercion_case17
26749  22047   
    #[::tokio::test]
26750         -
    async fn rest_json_path_timestamp_default_rejects_different8601_formats_case5_malformed_request(
26751         -
    ) {
       22048  +
    #[::tracing_test::traced_test]
       22049  +
    async fn rest_json_query_boolean_string_coercion_case17_malformed_request() {
26752  22050   
        {
26753  22051   
            #[allow(unused_mut)]
26754  22052   
            let mut http_request = http::Request::builder()
26755         -
                .uri("/MalformedTimestampPathDefault/19961219T163957")
       22053  +
                .uri("/MalformedBoolean/true")
26756  22054   
                .method("POST")
26757  22055   
                .body(::aws_smithy_http_server::body::Body::empty())
26758  22056   
                .unwrap();
       22057  +
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=NO".parse().unwrap();
26759  22058   
            #[allow(unused_mut)]
26760  22059   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
26761  22060   
            let config = crate::service::RestJsonConfig::builder().build();
26762  22061   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
26763         -
                            .malformed_timestamp_path_default(move |input: crate::input::MalformedTimestampPathDefaultInput| {
       22062  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
26764  22063   
                                let sender = sender.clone();
26765  22064   
                                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> };
       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> };
26767  22066   
                                    sender.send(()).await.expect("receiver dropped early");
26768  22067   
                                    result
26769  22068   
                                }
26770  22069   
                            })
26771  22070   
                            .build_unchecked();
26772  22071   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
26773  22072   
                .await
26774  22073   
                .expect("unable to make an HTTP request");
26775  22074   
            ::pretty_assertions::assert_eq!(
26776  22075   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
26777  22076   
                http_response.status()
26778  22077   
            );
26779  22078   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
26780  22079   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
26781  22080   
                http_response.headers(),
26782  22081   
                expected_headers,
26783  22082   
            ));
26784  22083   
        }
26785  22084   
    }
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
       22085  +
    /// Attempted string coercion should result in SerializationException
       22086  +
    /// Test ID: RestJsonQueryBooleanStringCoercion_case18
26789  22087   
    #[::tokio::test]
26790         -
    async fn rest_json_path_timestamp_default_rejects_different8601_formats_case6_malformed_request(
26791         -
    ) {
       22088  +
    #[::tracing_test::traced_test]
       22089  +
    async fn rest_json_query_boolean_string_coercion_case18_malformed_request() {
26792  22090   
        {
26793  22091   
            #[allow(unused_mut)]
26794  22092   
            let mut http_request = http::Request::builder()
26795         -
                .uri("/MalformedTimestampPathDefault/19961219T16%3A39%3A57Z")
       22093  +
                .uri("/MalformedBoolean/true")
26796  22094   
                .method("POST")
26797  22095   
                .body(::aws_smithy_http_server::body::Body::empty())
26798  22096   
                .unwrap();
       22097  +
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=0".parse().unwrap();
26799  22098   
            #[allow(unused_mut)]
26800  22099   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
26801  22100   
            let config = crate::service::RestJsonConfig::builder().build();
26802  22101   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
26803         -
                            .malformed_timestamp_path_default(move |input: crate::input::MalformedTimestampPathDefaultInput| {
       22102  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
26804  22103   
                                let sender = sender.clone();
26805  22104   
                                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> };
       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> };
26807  22106   
                                    sender.send(()).await.expect("receiver dropped early");
26808  22107   
                                    result
26809  22108   
                                }
26810  22109   
                            })
26811  22110   
                            .build_unchecked();
26812  22111   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
26813  22112   
                .await
26814  22113   
                .expect("unable to make an HTTP request");
26815  22114   
            ::pretty_assertions::assert_eq!(
26816  22115   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
26817  22116   
                http_response.status()
26818  22117   
            );
26819  22118   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
26820  22119   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
26821  22120   
                http_response.headers(),
26822  22121   
                expected_headers,
26823  22122   
            ));
26824  22123   
        }
26825  22124   
    }
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
       22125  +
    /// Attempted string coercion should result in SerializationException
       22126  +
    /// Test ID: RestJsonQueryBooleanStringCoercion_case19
26829  22127   
    #[::tokio::test]
26830         -
    async fn rest_json_path_timestamp_default_rejects_different8601_formats_case7_malformed_request(
26831         -
    ) {
       22128  +
    #[::tracing_test::traced_test]
       22129  +
    async fn rest_json_query_boolean_string_coercion_case19_malformed_request() {
26832  22130   
        {
26833  22131   
            #[allow(unused_mut)]
26834  22132   
            let mut http_request = http::Request::builder()
26835         -
                .uri("/MalformedTimestampPathDefault/19961219T16%3A39%3A57")
       22133  +
                .uri("/MalformedBoolean/true")
26836  22134   
                .method("POST")
26837  22135   
                .body(::aws_smithy_http_server::body::Body::empty())
26838  22136   
                .unwrap();
       22137  +
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=off".parse().unwrap();
26839  22138   
            #[allow(unused_mut)]
26840  22139   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
26841  22140   
            let config = crate::service::RestJsonConfig::builder().build();
26842  22141   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
26843         -
                            .malformed_timestamp_path_default(move |input: crate::input::MalformedTimestampPathDefaultInput| {
       22142  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
26844  22143   
                                let sender = sender.clone();
26845  22144   
                                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> };
       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> };
26847  22146   
                                    sender.send(()).await.expect("receiver dropped early");
26848  22147   
                                    result
26849  22148   
                                }
26850  22149   
                            })
26851  22150   
                            .build_unchecked();
26852  22151   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
26853  22152   
                .await
26854  22153   
                .expect("unable to make an HTTP request");
26855  22154   
            ::pretty_assertions::assert_eq!(
26856  22155   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
26857  22156   
                http_response.status()
26858  22157   
            );
26859  22158   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
26860  22159   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
26861  22160   
                http_response.headers(),
26862  22161   
                expected_headers,
26863  22162   
            ));
26864  22163   
        }
26865  22164   
    }
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
       22165  +
    /// Attempted string coercion should result in SerializationException
       22166  +
    /// Test ID: RestJsonQueryBooleanStringCoercion_case20
26869  22167   
    #[::tokio::test]
26870         -
    async fn rest_json_path_timestamp_default_rejects_different8601_formats_case8_malformed_request(
26871         -
    ) {
       22168  +
    #[::tracing_test::traced_test]
       22169  +
    async fn rest_json_query_boolean_string_coercion_case20_malformed_request() {
26872  22170   
        {
26873  22171   
            #[allow(unused_mut)]
26874  22172   
            let mut http_request = http::Request::builder()
26875         -
                .uri("/MalformedTimestampPathDefault/1996-12-19T16%3A39Z")
       22173  +
                .uri("/MalformedBoolean/true")
26876  22174   
                .method("POST")
26877  22175   
                .body(::aws_smithy_http_server::body::Body::empty())
26878  22176   
                .unwrap();
       22177  +
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=Off".parse().unwrap();
26879  22178   
            #[allow(unused_mut)]
26880  22179   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
26881  22180   
            let config = crate::service::RestJsonConfig::builder().build();
26882  22181   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
26883         -
                            .malformed_timestamp_path_default(move |input: crate::input::MalformedTimestampPathDefaultInput| {
       22182  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
26884  22183   
                                let sender = sender.clone();
26885  22184   
                                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> };
       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> };
26887  22186   
                                    sender.send(()).await.expect("receiver dropped early");
26888  22187   
                                    result
26889  22188   
                                }
26890  22189   
                            })
26891  22190   
                            .build_unchecked();
26892  22191   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
26893  22192   
                .await
26894  22193   
                .expect("unable to make an HTTP request");
26895  22194   
            ::pretty_assertions::assert_eq!(
26896  22195   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
26897  22196   
                http_response.status()
26898  22197   
            );
26899  22198   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
26900  22199   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
26901  22200   
                http_response.headers(),
26902  22201   
                expected_headers,
26903  22202   
            ));
26904  22203   
        }
26905  22204   
    }
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
       22205  +
    /// Attempted string coercion should result in SerializationException
       22206  +
    /// Test ID: RestJsonQueryBooleanStringCoercion_case21
26909  22207   
    #[::tokio::test]
26910         -
    async fn rest_json_path_timestamp_default_rejects_different8601_formats_case9_malformed_request(
26911         -
    ) {
       22208  +
    #[::tracing_test::traced_test]
       22209  +
    async fn rest_json_query_boolean_string_coercion_case21_malformed_request() {
26912  22210   
        {
26913  22211   
            #[allow(unused_mut)]
26914  22212   
            let mut http_request = http::Request::builder()
26915         -
                .uri("/MalformedTimestampPathDefault/1996-12-19T16%3A39")
       22213  +
                .uri("/MalformedBoolean/true")
26916  22214   
                .method("POST")
26917  22215   
                .body(::aws_smithy_http_server::body::Body::empty())
26918  22216   
                .unwrap();
       22217  +
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=OFF".parse().unwrap();
26919  22218   
            #[allow(unused_mut)]
26920  22219   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
26921  22220   
            let config = crate::service::RestJsonConfig::builder().build();
26922  22221   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
26923         -
                            .malformed_timestamp_path_default(move |input: crate::input::MalformedTimestampPathDefaultInput| {
       22222  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
26924  22223   
                                let sender = sender.clone();
26925  22224   
                                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> };
       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> };
26927  22226   
                                    sender.send(()).await.expect("receiver dropped early");
26928  22227   
                                    result
26929  22228   
                                }
26930  22229   
                            })
26931  22230   
                            .build_unchecked();
26932  22231   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
26933  22232   
                .await
26934  22233   
                .expect("unable to make an HTTP request");
26935  22234   
            ::pretty_assertions::assert_eq!(
26936  22235   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
26937  22236   
                http_response.status()
26938  22237   
            );
26939  22238   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
26940  22239   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
26941  22240   
                http_response.headers(),
26942  22241   
                expected_headers,
26943  22242   
            ));
26944  22243   
        }
26945  22244   
    }
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
       22245  +
    /// Attempted string coercion should result in SerializationException
       22246  +
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case0
26949  22247   
    #[::tokio::test]
26950         -
    async fn rest_json_path_timestamp_default_rejects_different8601_formats_case10_malformed_request(
26951         -
    ) {
       22248  +
    #[::tracing_test::traced_test]
       22249  +
    async fn rest_json_header_boolean_string_coercion_case0_malformed_request() {
26952  22250   
        {
26953  22251   
            #[allow(unused_mut)]
26954  22252   
            let mut http_request = http::Request::builder()
26955         -
                .uri("/MalformedTimestampPathDefault/1996-12-19T1639")
       22253  +
                .uri("/MalformedBoolean/true")
26956  22254   
                .method("POST")
       22255  +
                .header("booleanInHeader", "True")
26957  22256   
                .body(::aws_smithy_http_server::body::Body::empty())
26958  22257   
                .unwrap();
26959  22258   
            #[allow(unused_mut)]
26960  22259   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
26961  22260   
            let config = crate::service::RestJsonConfig::builder().build();
26962  22261   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
26963         -
                            .malformed_timestamp_path_default(move |input: crate::input::MalformedTimestampPathDefaultInput| {
       22262  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
26964  22263   
                                let sender = sender.clone();
26965  22264   
                                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> };
       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> };
26967  22266   
                                    sender.send(()).await.expect("receiver dropped early");
26968  22267   
                                    result
26969  22268   
                                }
26970  22269   
                            })
26971  22270   
                            .build_unchecked();
26972  22271   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
26973  22272   
                .await
26974  22273   
                .expect("unable to make an HTTP request");
26975  22274   
            ::pretty_assertions::assert_eq!(
26976  22275   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
26977  22276   
                http_response.status()
26978  22277   
            );
26979  22278   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
26980  22279   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
26981  22280   
                http_response.headers(),
26982  22281   
                expected_headers,
26983  22282   
            ));
26984  22283   
        }
26985  22284   
    }
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
       22285  +
    /// Attempted string coercion should result in SerializationException
       22286  +
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case1
26989  22287   
    #[::tokio::test]
26990         -
    async fn rest_json_path_timestamp_default_rejects_different8601_formats_case11_malformed_request(
26991         -
    ) {
       22288  +
    #[::tracing_test::traced_test]
       22289  +
    async fn rest_json_header_boolean_string_coercion_case1_malformed_request() {
26992  22290   
        {
26993  22291   
            #[allow(unused_mut)]
26994  22292   
            let mut http_request = http::Request::builder()
26995         -
                .uri("/MalformedTimestampPathDefault/1996-12-19T16Z")
       22293  +
                .uri("/MalformedBoolean/true")
26996  22294   
                .method("POST")
       22295  +
                .header("booleanInHeader", "TRUE")
26997  22296   
                .body(::aws_smithy_http_server::body::Body::empty())
26998  22297   
                .unwrap();
26999  22298   
            #[allow(unused_mut)]
27000  22299   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
27001  22300   
            let config = crate::service::RestJsonConfig::builder().build();
27002  22301   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
27003         -
                            .malformed_timestamp_path_default(move |input: crate::input::MalformedTimestampPathDefaultInput| {
       22302  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
27004  22303   
                                let sender = sender.clone();
27005  22304   
                                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> };
       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> };
27007  22306   
                                    sender.send(()).await.expect("receiver dropped early");
27008  22307   
                                    result
27009  22308   
                                }
27010  22309   
                            })
27011  22310   
                            .build_unchecked();
27012  22311   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
27013  22312   
                .await
27014  22313   
                .expect("unable to make an HTTP request");
27015  22314   
            ::pretty_assertions::assert_eq!(
27016  22315   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
27017  22316   
                http_response.status()
27018  22317   
            );
27019  22318   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
27020  22319   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
27021  22320   
                http_response.headers(),
27022  22321   
                expected_headers,
27023  22322   
            ));
27024  22323   
        }
27025  22324   
    }
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
       22325  +
    /// Attempted string coercion should result in SerializationException
       22326  +
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case2
27029  22327   
    #[::tokio::test]
27030         -
    async fn rest_json_path_timestamp_default_rejects_different8601_formats_case12_malformed_request(
27031         -
    ) {
       22328  +
    #[::tracing_test::traced_test]
       22329  +
    async fn rest_json_header_boolean_string_coercion_case2_malformed_request() {
27032  22330   
        {
27033  22331   
            #[allow(unused_mut)]
27034  22332   
            let mut http_request = http::Request::builder()
27035         -
                .uri("/MalformedTimestampPathDefault/1996-12-19T16")
       22333  +
                .uri("/MalformedBoolean/true")
27036  22334   
                .method("POST")
       22335  +
                .header("booleanInHeader", "y")
27037  22336   
                .body(::aws_smithy_http_server::body::Body::empty())
27038  22337   
                .unwrap();
27039  22338   
            #[allow(unused_mut)]
27040  22339   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
27041  22340   
            let config = crate::service::RestJsonConfig::builder().build();
27042  22341   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
27043         -
                            .malformed_timestamp_path_default(move |input: crate::input::MalformedTimestampPathDefaultInput| {
       22342  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
27044  22343   
                                let sender = sender.clone();
27045  22344   
                                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> };
       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> };
27047  22346   
                                    sender.send(()).await.expect("receiver dropped early");
27048  22347   
                                    result
27049  22348   
                                }
27050  22349   
                            })
27051  22350   
                            .build_unchecked();
27052  22351   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
27053  22352   
                .await
27054  22353   
                .expect("unable to make an HTTP request");
27055  22354   
            ::pretty_assertions::assert_eq!(
27056  22355   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
27057  22356   
                http_response.status()
27058  22357   
            );
27059  22358   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
27060  22359   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
27061  22360   
                http_response.headers(),
27062  22361   
                expected_headers,
27063  22362   
            ));
27064  22363   
        }
27065  22364   
    }
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
       22365  +
    /// Attempted string coercion should result in SerializationException
       22366  +
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case3
27069  22367   
    #[::tokio::test]
27070         -
    async fn rest_json_path_timestamp_default_rejects_different8601_formats_case13_malformed_request(
27071         -
    ) {
       22368  +
    #[::tracing_test::traced_test]
       22369  +
    async fn rest_json_header_boolean_string_coercion_case3_malformed_request() {
27072  22370   
        {
27073  22371   
            #[allow(unused_mut)]
27074  22372   
            let mut http_request = http::Request::builder()
27075         -
                .uri("/MalformedTimestampPathDefault/1996-12-19%2016%3A39%3A57Z")
       22373  +
                .uri("/MalformedBoolean/true")
27076  22374   
                .method("POST")
       22375  +
                .header("booleanInHeader", "Y")
27077  22376   
                .body(::aws_smithy_http_server::body::Body::empty())
27078  22377   
                .unwrap();
27079  22378   
            #[allow(unused_mut)]
27080  22379   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
27081  22380   
            let config = crate::service::RestJsonConfig::builder().build();
27082  22381   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
27083         -
                            .malformed_timestamp_path_default(move |input: crate::input::MalformedTimestampPathDefaultInput| {
       22382  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
27084  22383   
                                let sender = sender.clone();
27085  22384   
                                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> };
       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> };
27087  22386   
                                    sender.send(()).await.expect("receiver dropped early");
27088  22387   
                                    result
27089  22388   
                                }
27090  22389   
                            })
27091  22390   
                            .build_unchecked();
27092  22391   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
27093  22392   
                .await
27094  22393   
                .expect("unable to make an HTTP request");
27095  22394   
            ::pretty_assertions::assert_eq!(
27096  22395   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
27097  22396   
                http_response.status()
27098  22397   
            );
27099  22398   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
27100  22399   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
27101  22400   
                http_response.headers(),
27102  22401   
                expected_headers,
27103  22402   
            ));
27104  22403   
        }
27105  22404   
    }
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
       22405  +
    /// Attempted string coercion should result in SerializationException
       22406  +
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case4
27109  22407   
    #[::tokio::test]
27110         -
    async fn rest_json_path_timestamp_default_rejects_different8601_formats_case14_malformed_request(
27111         -
    ) {
       22408  +
    #[::tracing_test::traced_test]
       22409  +
    async fn rest_json_header_boolean_string_coercion_case4_malformed_request() {
27112  22410   
        {
27113  22411   
            #[allow(unused_mut)]
27114         -
                        let mut http_request = http::Request::builder()
27115         -
                            .uri("/MalformedTimestampPathDefault/2011-12-03T10%3A15%3A30%2B01%3A00%5BEurope%2FParis%5D")
27116         -
                            .method("POST")
27117         -
            .body(::aws_smithy_http_server::body::Body::empty()).unwrap();
       22412  +
            let mut http_request = http::Request::builder()
       22413  +
                .uri("/MalformedBoolean/true")
       22414  +
                .method("POST")
       22415  +
                .header("booleanInHeader", "yes")
       22416  +
                .body(::aws_smithy_http_server::body::Body::empty())
       22417  +
                .unwrap();
27118  22418   
            #[allow(unused_mut)]
27119  22419   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
27120  22420   
            let config = crate::service::RestJsonConfig::builder().build();
27121  22421   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
27122         -
                            .malformed_timestamp_path_default(move |input: crate::input::MalformedTimestampPathDefaultInput| {
       22422  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
27123  22423   
                                let sender = sender.clone();
27124  22424   
                                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> };
       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> };
27126  22426   
                                    sender.send(()).await.expect("receiver dropped early");
27127  22427   
                                    result
27128  22428   
                                }
27129  22429   
                            })
27130  22430   
                            .build_unchecked();
27131  22431   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
27132  22432   
                .await
27133  22433   
                .expect("unable to make an HTTP request");
27134  22434   
            ::pretty_assertions::assert_eq!(
27135  22435   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
27136  22436   
                http_response.status()
27137  22437   
            );
27138  22438   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
27139  22439   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
27140  22440   
                http_response.headers(),
27141  22441   
                expected_headers,
27142  22442   
            ));
27143  22443   
        }
27144  22444   
    }
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
       22445  +
    /// Attempted string coercion should result in SerializationException
       22446  +
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case5
27152  22447   
    #[::tokio::test]
27153         -
    async fn rest_json_path_timestamp_epoch_rejects_date_time_case0_malformed_request() {
       22448  +
    #[::tracing_test::traced_test]
       22449  +
    async fn rest_json_header_boolean_string_coercion_case5_malformed_request() {
27154  22450   
        {
27155  22451   
            #[allow(unused_mut)]
27156  22452   
            let mut http_request = http::Request::builder()
27157         -
                .uri("/MalformedTimestampPathEpoch/1985-04-12T23%3A20%3A50.52Z")
       22453  +
                .uri("/MalformedBoolean/true")
27158  22454   
                .method("POST")
       22455  +
                .header("booleanInHeader", "Yes")
27159  22456   
                .body(::aws_smithy_http_server::body::Body::empty())
27160  22457   
                .unwrap();
27161  22458   
            #[allow(unused_mut)]
27162  22459   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
27163  22460   
            let config = crate::service::RestJsonConfig::builder().build();
27164  22461   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
27165         -
                            .malformed_timestamp_path_epoch(move |input: crate::input::MalformedTimestampPathEpochInput| {
       22462  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
27166  22463   
                                let sender = sender.clone();
27167  22464   
                                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> };
       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> };
27169  22466   
                                    sender.send(()).await.expect("receiver dropped early");
27170  22467   
                                    result
27171  22468   
                                }
27172  22469   
                            })
27173  22470   
                            .build_unchecked();
27174  22471   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
27175  22472   
                .await
27176  22473   
                .expect("unable to make an HTTP request");
27177  22474   
            ::pretty_assertions::assert_eq!(
27178  22475   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
27179  22476   
                http_response.status()
27180  22477   
            );
27181  22478   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
27182  22479   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
27183  22480   
                http_response.headers(),
27184  22481   
                expected_headers,
27185  22482   
            ));
27186  22483   
        }
27187  22484   
    }
27188         -
    /// When the format is epoch-seconds, RFC3339 timestamps are rejected with a
27189         -
    /// 400 SerializationException
27190         -
    /// Test ID: RestJsonPathTimestampEpochRejectsDateTime_case1
       22485  +
    /// Attempted string coercion should result in SerializationException
       22486  +
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case6
27191  22487   
    #[::tokio::test]
27192         -
    async fn rest_json_path_timestamp_epoch_rejects_date_time_case1_malformed_request() {
       22488  +
    #[::tracing_test::traced_test]
       22489  +
    async fn rest_json_header_boolean_string_coercion_case6_malformed_request() {
27193  22490   
        {
27194  22491   
            #[allow(unused_mut)]
27195  22492   
            let mut http_request = http::Request::builder()
27196         -
                .uri("/MalformedTimestampPathEpoch/1985-04-12T23%3A20%3A50Z")
       22493  +
                .uri("/MalformedBoolean/true")
27197  22494   
                .method("POST")
       22495  +
                .header("booleanInHeader", "YES")
27198  22496   
                .body(::aws_smithy_http_server::body::Body::empty())
27199  22497   
                .unwrap();
27200  22498   
            #[allow(unused_mut)]
27201  22499   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
27202  22500   
            let config = crate::service::RestJsonConfig::builder().build();
27203  22501   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
27204         -
                            .malformed_timestamp_path_epoch(move |input: crate::input::MalformedTimestampPathEpochInput| {
       22502  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
27205  22503   
                                let sender = sender.clone();
27206  22504   
                                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> };
       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> };
27208  22506   
                                    sender.send(()).await.expect("receiver dropped early");
27209  22507   
                                    result
27210  22508   
                                }
27211  22509   
                            })
27212  22510   
                            .build_unchecked();
27213  22511   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
27214  22512   
                .await
27215  22513   
                .expect("unable to make an HTTP request");
27216  22514   
            ::pretty_assertions::assert_eq!(
27217  22515   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
27218  22516   
                http_response.status()
27219  22517   
            );
27220  22518   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
27221  22519   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
27222  22520   
                http_response.headers(),
27223  22521   
                expected_headers,
27224  22522   
            ));
27225  22523   
        }
27226  22524   
    }
27227         -
    /// When the format is epoch-seconds, RFC3339 timestamps are rejected with a
27228         -
    /// 400 SerializationException
27229         -
    /// Test ID: RestJsonPathTimestampEpochRejectsDateTime_case2
       22525  +
    /// Attempted string coercion should result in SerializationException
       22526  +
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case7
27230  22527   
    #[::tokio::test]
27231         -
    async fn rest_json_path_timestamp_epoch_rejects_date_time_case2_malformed_request() {
       22528  +
    #[::tracing_test::traced_test]
       22529  +
    async fn rest_json_header_boolean_string_coercion_case7_malformed_request() {
27232  22530   
        {
27233  22531   
            #[allow(unused_mut)]
27234  22532   
            let mut http_request = http::Request::builder()
27235         -
                .uri("/MalformedTimestampPathEpoch/1996-12-19T16%3A39%3A57-08%3A00")
       22533  +
                .uri("/MalformedBoolean/true")
27236  22534   
                .method("POST")
       22535  +
                .header("booleanInHeader", "1")
27237  22536   
                .body(::aws_smithy_http_server::body::Body::empty())
27238  22537   
                .unwrap();
27239  22538   
            #[allow(unused_mut)]
27240  22539   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
27241  22540   
            let config = crate::service::RestJsonConfig::builder().build();
27242  22541   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
27243         -
                            .malformed_timestamp_path_epoch(move |input: crate::input::MalformedTimestampPathEpochInput| {
       22542  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
27244  22543   
                                let sender = sender.clone();
27245  22544   
                                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> };
       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> };
27247  22546   
                                    sender.send(()).await.expect("receiver dropped early");
27248  22547   
                                    result
27249  22548   
                                }
27250  22549   
                            })
27251  22550   
                            .build_unchecked();
27252  22551   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
27253  22552   
                .await
27254  22553   
                .expect("unable to make an HTTP request");
27255  22554   
            ::pretty_assertions::assert_eq!(
27256  22555   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
27257  22556   
                http_response.status()
27258  22557   
            );
27259  22558   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
27260  22559   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
27261  22560   
                http_response.headers(),
27262  22561   
                expected_headers,
27263  22562   
            ));
27264  22563   
        }
27265  22564   
    }
27266         -
    /// When the format is epoch-seconds, IMF-fixdate timestamps are rejected with a
27267         -
    /// 400 SerializationException
27268         -
    /// Test ID: RestJsonPathTimestampEpochRejectsHttpDate_case0
       22565  +
    /// Attempted string coercion should result in SerializationException
       22566  +
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case8
27269  22567   
    #[::tokio::test]
27270         -
    async fn rest_json_path_timestamp_epoch_rejects_http_date_case0_malformed_request() {
       22568  +
    #[::tracing_test::traced_test]
       22569  +
    async fn rest_json_header_boolean_string_coercion_case8_malformed_request() {
27271  22570   
        {
27272  22571   
            #[allow(unused_mut)]
27273  22572   
            let mut http_request = http::Request::builder()
27274         -
                .uri("/MalformedTimestampPathEpoch/Tue%2C%2029%20Apr%202014%2018%3A30%3A38%20GMT")
       22573  +
                .uri("/MalformedBoolean/true")
27275  22574   
                .method("POST")
       22575  +
                .header("booleanInHeader", "on")
27276  22576   
                .body(::aws_smithy_http_server::body::Body::empty())
27277  22577   
                .unwrap();
27278  22578   
            #[allow(unused_mut)]
27279  22579   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
27280  22580   
            let config = crate::service::RestJsonConfig::builder().build();
27281  22581   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
27282         -
                            .malformed_timestamp_path_epoch(move |input: crate::input::MalformedTimestampPathEpochInput| {
       22582  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
27283  22583   
                                let sender = sender.clone();
27284  22584   
                                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> };
       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> };
27286  22586   
                                    sender.send(()).await.expect("receiver dropped early");
27287  22587   
                                    result
27288  22588   
                                }
27289  22589   
                            })
27290  22590   
                            .build_unchecked();
27291  22591   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
27292  22592   
                .await
27293  22593   
                .expect("unable to make an HTTP request");
27294  22594   
            ::pretty_assertions::assert_eq!(
27295  22595   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
27296  22596   
                http_response.status()
27297  22597   
            );
27298  22598   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
27299  22599   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
27300  22600   
                http_response.headers(),
27301  22601   
                expected_headers,
27302  22602   
            ));
27303  22603   
        }
27304  22604   
    }
27305         -
    /// When the format is epoch-seconds, IMF-fixdate timestamps are rejected with a
27306         -
    /// 400 SerializationException
27307         -
    /// Test ID: RestJsonPathTimestampEpochRejectsHttpDate_case1
       22605  +
    /// Attempted string coercion should result in SerializationException
       22606  +
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case9
27308  22607   
    #[::tokio::test]
27309         -
    async fn rest_json_path_timestamp_epoch_rejects_http_date_case1_malformed_request() {
       22608  +
    #[::tracing_test::traced_test]
       22609  +
    async fn rest_json_header_boolean_string_coercion_case9_malformed_request() {
27310  22610   
        {
27311  22611   
            #[allow(unused_mut)]
27312         -
                        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();
       22612  +
            let mut http_request = http::Request::builder()
       22613  +
                .uri("/MalformedBoolean/true")
       22614  +
                .method("POST")
       22615  +
                .header("booleanInHeader", "On")
       22616  +
                .body(::aws_smithy_http_server::body::Body::empty())
       22617  +
                .unwrap();
27316  22618   
            #[allow(unused_mut)]
27317  22619   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
27318  22620   
            let config = crate::service::RestJsonConfig::builder().build();
27319  22621   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
27320         -
                            .malformed_timestamp_path_epoch(move |input: crate::input::MalformedTimestampPathEpochInput| {
       22622  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
27321  22623   
                                let sender = sender.clone();
27322  22624   
                                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> };
       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> };
27324  22626   
                                    sender.send(()).await.expect("receiver dropped early");
27325  22627   
                                    result
27326  22628   
                                }
27327  22629   
                            })
27328  22630   
                            .build_unchecked();
27329  22631   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
27330  22632   
                .await
27331  22633   
                .expect("unable to make an HTTP request");
27332  22634   
            ::pretty_assertions::assert_eq!(
27333  22635   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
27334  22636   
                http_response.status()
27335  22637   
            );
27336  22638   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
27337  22639   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
27338  22640   
                http_response.headers(),
27339  22641   
                expected_headers,
27340  22642   
            ));
27341  22643   
        }
27342  22644   
    }
27343         -
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
27344         -
    /// Test ID: RestJsonPathTimestampEpochRejectsMalformedValues_case0
       22645  +
    /// Attempted string coercion should result in SerializationException
       22646  +
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case10
27345  22647   
    #[::tokio::test]
27346         -
    async fn rest_json_path_timestamp_epoch_rejects_malformed_values_case0_malformed_request() {
       22648  +
    #[::tracing_test::traced_test]
       22649  +
    async fn rest_json_header_boolean_string_coercion_case10_malformed_request() {
27347  22650   
        {
27348  22651   
            #[allow(unused_mut)]
27349  22652   
            let mut http_request = http::Request::builder()
27350         -
                .uri("/MalformedTimestampPathEpoch/true")
       22653  +
                .uri("/MalformedBoolean/true")
27351  22654   
                .method("POST")
       22655  +
                .header("booleanInHeader", "ON")
27352  22656   
                .body(::aws_smithy_http_server::body::Body::empty())
27353  22657   
                .unwrap();
27354  22658   
            #[allow(unused_mut)]
27355  22659   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
27356  22660   
            let config = crate::service::RestJsonConfig::builder().build();
27357  22661   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
27358         -
                            .malformed_timestamp_path_epoch(move |input: crate::input::MalformedTimestampPathEpochInput| {
       22662  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
27359  22663   
                                let sender = sender.clone();
27360  22664   
                                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> };
       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> };
27362  22666   
                                    sender.send(()).await.expect("receiver dropped early");
27363  22667   
                                    result
27364  22668   
                                }
27365  22669   
                            })
27366  22670   
                            .build_unchecked();
27367  22671   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
27368  22672   
                .await
27369  22673   
                .expect("unable to make an HTTP request");
27370  22674   
            ::pretty_assertions::assert_eq!(
27371  22675   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
27372  22676   
                http_response.status()
27373  22677   
            );
27374  22678   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
27375  22679   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
27376  22680   
                http_response.headers(),
27377  22681   
                expected_headers,
27378  22682   
            ));
27379  22683   
        }
27380  22684   
    }
27381         -
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
27382         -
    /// Test ID: RestJsonPathTimestampEpochRejectsMalformedValues_case1
       22685  +
    /// Attempted string coercion should result in SerializationException
       22686  +
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case11
27383  22687   
    #[::tokio::test]
27384         -
    async fn rest_json_path_timestamp_epoch_rejects_malformed_values_case1_malformed_request() {
       22688  +
    #[::tracing_test::traced_test]
       22689  +
    async fn rest_json_header_boolean_string_coercion_case11_malformed_request() {
27385  22690   
        {
27386  22691   
            #[allow(unused_mut)]
27387  22692   
            let mut http_request = http::Request::builder()
27388         -
                .uri("/MalformedTimestampPathEpoch/1515531081ABC")
       22693  +
                .uri("/MalformedBoolean/true")
27389  22694   
                .method("POST")
       22695  +
                .header("booleanInHeader", "False")
27390  22696   
                .body(::aws_smithy_http_server::body::Body::empty())
27391  22697   
                .unwrap();
27392  22698   
            #[allow(unused_mut)]
27393  22699   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
27394  22700   
            let config = crate::service::RestJsonConfig::builder().build();
27395  22701   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
27396         -
                            .malformed_timestamp_path_epoch(move |input: crate::input::MalformedTimestampPathEpochInput| {
       22702  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
27397  22703   
                                let sender = sender.clone();
27398  22704   
                                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> };
       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> };
27400  22706   
                                    sender.send(()).await.expect("receiver dropped early");
27401  22707   
                                    result
27402  22708   
                                }
27403  22709   
                            })
27404  22710   
                            .build_unchecked();
27405  22711   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
27406  22712   
                .await
27407  22713   
                .expect("unable to make an HTTP request");
27408  22714   
            ::pretty_assertions::assert_eq!(
27409  22715   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
27410  22716   
                http_response.status()
27411  22717   
            );
27412  22718   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
27413  22719   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
27414  22720   
                http_response.headers(),
27415  22721   
                expected_headers,
27416  22722   
            ));
27417  22723   
        }
27418  22724   
    }
27419         -
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
27420         -
    /// Test ID: RestJsonPathTimestampEpochRejectsMalformedValues_case2
       22725  +
    /// Attempted string coercion should result in SerializationException
       22726  +
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case12
27421  22727   
    #[::tokio::test]
27422         -
    async fn rest_json_path_timestamp_epoch_rejects_malformed_values_case2_malformed_request() {
       22728  +
    #[::tracing_test::traced_test]
       22729  +
    async fn rest_json_header_boolean_string_coercion_case12_malformed_request() {
27423  22730   
        {
27424  22731   
            #[allow(unused_mut)]
27425  22732   
            let mut http_request = http::Request::builder()
27426         -
                .uri("/MalformedTimestampPathEpoch/0x42")
       22733  +
                .uri("/MalformedBoolean/true")
27427  22734   
                .method("POST")
       22735  +
                .header("booleanInHeader", "FALSE")
27428  22736   
                .body(::aws_smithy_http_server::body::Body::empty())
27429  22737   
                .unwrap();
27430  22738   
            #[allow(unused_mut)]
27431  22739   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
27432  22740   
            let config = crate::service::RestJsonConfig::builder().build();
27433  22741   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
27434         -
                            .malformed_timestamp_path_epoch(move |input: crate::input::MalformedTimestampPathEpochInput| {
       22742  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
27435  22743   
                                let sender = sender.clone();
27436  22744   
                                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> };
       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> };
27438  22746   
                                    sender.send(()).await.expect("receiver dropped early");
27439  22747   
                                    result
27440  22748   
                                }
27441  22749   
                            })
27442  22750   
                            .build_unchecked();
27443  22751   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
27444  22752   
                .await
27445  22753   
                .expect("unable to make an HTTP request");
27446  22754   
            ::pretty_assertions::assert_eq!(
27447  22755   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
27448  22756   
                http_response.status()
27449  22757   
            );
27450  22758   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
27451  22759   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
27452  22760   
                http_response.headers(),
27453  22761   
                expected_headers,
27454  22762   
            ));
27455  22763   
        }
27456  22764   
    }
27457         -
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
27458         -
    /// Test ID: RestJsonPathTimestampEpochRejectsMalformedValues_case3
       22765  +
    /// Attempted string coercion should result in SerializationException
       22766  +
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case13
27459  22767   
    #[::tokio::test]
27460         -
    async fn rest_json_path_timestamp_epoch_rejects_malformed_values_case3_malformed_request() {
       22768  +
    #[::tracing_test::traced_test]
       22769  +
    async fn rest_json_header_boolean_string_coercion_case13_malformed_request() {
27461  22770   
        {
27462  22771   
            #[allow(unused_mut)]
27463  22772   
            let mut http_request = http::Request::builder()
27464         -
                .uri("/MalformedTimestampPathEpoch/1515531081.123.456")
       22773  +
                .uri("/MalformedBoolean/true")
27465  22774   
                .method("POST")
       22775  +
                .header("booleanInHeader", "n")
27466  22776   
                .body(::aws_smithy_http_server::body::Body::empty())
27467  22777   
                .unwrap();
27468  22778   
            #[allow(unused_mut)]
27469  22779   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
27470  22780   
            let config = crate::service::RestJsonConfig::builder().build();
27471  22781   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
27472         -
                            .malformed_timestamp_path_epoch(move |input: crate::input::MalformedTimestampPathEpochInput| {
       22782  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
27473  22783   
                                let sender = sender.clone();
27474  22784   
                                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> };
       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> };
27476  22786   
                                    sender.send(()).await.expect("receiver dropped early");
27477  22787   
                                    result
27478  22788   
                                }
27479  22789   
                            })
27480  22790   
                            .build_unchecked();
27481  22791   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
27482  22792   
                .await
27483  22793   
                .expect("unable to make an HTTP request");
27484  22794   
            ::pretty_assertions::assert_eq!(
27485  22795   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
27486  22796   
                http_response.status()
27487  22797   
            );
27488  22798   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
27489  22799   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
27490  22800   
                http_response.headers(),
27491  22801   
                expected_headers,
27492  22802   
            ));
27493  22803   
        }
27494  22804   
    }
27495         -
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
27496         -
    /// Test ID: RestJsonPathTimestampEpochRejectsMalformedValues_case4
       22805  +
    /// Attempted string coercion should result in SerializationException
       22806  +
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case14
27497  22807   
    #[::tokio::test]
27498         -
    async fn rest_json_path_timestamp_epoch_rejects_malformed_values_case4_malformed_request() {
       22808  +
    #[::tracing_test::traced_test]
       22809  +
    async fn rest_json_header_boolean_string_coercion_case14_malformed_request() {
27499  22810   
        {
27500  22811   
            #[allow(unused_mut)]
27501  22812   
            let mut http_request = http::Request::builder()
27502         -
                .uri("/MalformedTimestampPathEpoch/Infinity")
       22813  +
                .uri("/MalformedBoolean/true")
27503  22814   
                .method("POST")
       22815  +
                .header("booleanInHeader", "N")
27504  22816   
                .body(::aws_smithy_http_server::body::Body::empty())
27505  22817   
                .unwrap();
27506  22818   
            #[allow(unused_mut)]
27507  22819   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
27508  22820   
            let config = crate::service::RestJsonConfig::builder().build();
27509  22821   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
27510         -
                            .malformed_timestamp_path_epoch(move |input: crate::input::MalformedTimestampPathEpochInput| {
       22822  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
27511  22823   
                                let sender = sender.clone();
27512  22824   
                                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> };
       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> };
27514  22826   
                                    sender.send(()).await.expect("receiver dropped early");
27515  22827   
                                    result
27516  22828   
                                }
27517  22829   
                            })
27518  22830   
                            .build_unchecked();
27519  22831   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
27520  22832   
                .await
27521  22833   
                .expect("unable to make an HTTP request");
27522  22834   
            ::pretty_assertions::assert_eq!(
27523  22835   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
27524  22836   
                http_response.status()
27525  22837   
            );
27526  22838   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
27527  22839   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
27528  22840   
                http_response.headers(),
27529  22841   
                expected_headers,
27530  22842   
            ));
27531  22843   
        }
27532  22844   
    }
27533         -
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
27534         -
    /// Test ID: RestJsonPathTimestampEpochRejectsMalformedValues_case5
       22845  +
    /// Attempted string coercion should result in SerializationException
       22846  +
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case15
27535  22847   
    #[::tokio::test]
27536         -
    async fn rest_json_path_timestamp_epoch_rejects_malformed_values_case5_malformed_request() {
       22848  +
    #[::tracing_test::traced_test]
       22849  +
    async fn rest_json_header_boolean_string_coercion_case15_malformed_request() {
27537  22850   
        {
27538  22851   
            #[allow(unused_mut)]
27539  22852   
            let mut http_request = http::Request::builder()
27540         -
                .uri("/MalformedTimestampPathEpoch/-Infinity")
       22853  +
                .uri("/MalformedBoolean/true")
27541  22854   
                .method("POST")
       22855  +
                .header("booleanInHeader", "no")
27542  22856   
                .body(::aws_smithy_http_server::body::Body::empty())
27543  22857   
                .unwrap();
27544  22858   
            #[allow(unused_mut)]
27545  22859   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
27546  22860   
            let config = crate::service::RestJsonConfig::builder().build();
27547  22861   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
27548         -
                            .malformed_timestamp_path_epoch(move |input: crate::input::MalformedTimestampPathEpochInput| {
       22862  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
27549  22863   
                                let sender = sender.clone();
27550  22864   
                                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> };
       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> };
27552  22866   
                                    sender.send(()).await.expect("receiver dropped early");
27553  22867   
                                    result
27554  22868   
                                }
27555  22869   
                            })
27556  22870   
                            .build_unchecked();
27557  22871   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
27558  22872   
                .await
27559  22873   
                .expect("unable to make an HTTP request");
27560  22874   
            ::pretty_assertions::assert_eq!(
27561  22875   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
27562  22876   
                http_response.status()
27563  22877   
            );
27564  22878   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
27565  22879   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
27566  22880   
                http_response.headers(),
27567  22881   
                expected_headers,
27568  22882   
            ));
27569  22883   
        }
27570  22884   
    }
27571         -
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
27572         -
    /// Test ID: RestJsonPathTimestampEpochRejectsMalformedValues_case6
       22885  +
    /// Attempted string coercion should result in SerializationException
       22886  +
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case16
27573  22887   
    #[::tokio::test]
27574         -
    async fn rest_json_path_timestamp_epoch_rejects_malformed_values_case6_malformed_request() {
       22888  +
    #[::tracing_test::traced_test]
       22889  +
    async fn rest_json_header_boolean_string_coercion_case16_malformed_request() {
27575  22890   
        {
27576  22891   
            #[allow(unused_mut)]
27577  22892   
            let mut http_request = http::Request::builder()
27578         -
                .uri("/MalformedTimestampPathEpoch/NaN")
       22893  +
                .uri("/MalformedBoolean/true")
27579  22894   
                .method("POST")
       22895  +
                .header("booleanInHeader", "No")
27580  22896   
                .body(::aws_smithy_http_server::body::Body::empty())
27581  22897   
                .unwrap();
27582  22898   
            #[allow(unused_mut)]
27583  22899   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
27584  22900   
            let config = crate::service::RestJsonConfig::builder().build();
27585  22901   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
27586         -
                            .malformed_timestamp_path_epoch(move |input: crate::input::MalformedTimestampPathEpochInput| {
       22902  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
27587  22903   
                                let sender = sender.clone();
27588  22904   
                                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> };
       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> };
27590  22906   
                                    sender.send(()).await.expect("receiver dropped early");
27591  22907   
                                    result
27592  22908   
                                }
27593  22909   
                            })
27594  22910   
                            .build_unchecked();
27595  22911   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
27596  22912   
                .await
27597  22913   
                .expect("unable to make an HTTP request");
27598  22914   
            ::pretty_assertions::assert_eq!(
27599  22915   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
27600  22916   
                http_response.status()
27601  22917   
            );
27602  22918   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
27603  22919   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
27604  22920   
                http_response.headers(),
27605  22921   
                expected_headers,
27606  22922   
            ));
27607  22923   
        }
27608  22924   
    }
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
       22925  +
    /// Attempted string coercion should result in SerializationException
       22926  +
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case17
27616  22927   
    #[::tokio::test]
27617         -
    async fn rest_json_path_timestamp_http_date_rejects_date_time_case0_malformed_request() {
       22928  +
    #[::tracing_test::traced_test]
       22929  +
    async fn rest_json_header_boolean_string_coercion_case17_malformed_request() {
27618  22930   
        {
27619  22931   
            #[allow(unused_mut)]
27620  22932   
            let mut http_request = http::Request::builder()
27621         -
                .uri("/MalformedTimestampPathHttpDate/1985-04-12T23%3A20%3A50.52Z")
       22933  +
                .uri("/MalformedBoolean/true")
27622  22934   
                .method("POST")
       22935  +
                .header("booleanInHeader", "NO")
27623  22936   
                .body(::aws_smithy_http_server::body::Body::empty())
27624  22937   
                .unwrap();
27625  22938   
            #[allow(unused_mut)]
27626  22939   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
27627  22940   
            let config = crate::service::RestJsonConfig::builder().build();
27628  22941   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
27629         -
                            .malformed_timestamp_path_http_date(move |input: crate::input::MalformedTimestampPathHttpDateInput| {
       22942  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
27630  22943   
                                let sender = sender.clone();
27631  22944   
                                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> };
       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> };
27633  22946   
                                    sender.send(()).await.expect("receiver dropped early");
27634  22947   
                                    result
27635  22948   
                                }
27636  22949   
                            })
27637  22950   
                            .build_unchecked();
27638  22951   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
27639  22952   
                .await
27640  22953   
                .expect("unable to make an HTTP request");
27641  22954   
            ::pretty_assertions::assert_eq!(
27642  22955   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
27643  22956   
                http_response.status()
27644  22957   
            );
27645  22958   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
27646  22959   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
27647  22960   
                http_response.headers(),
27648  22961   
                expected_headers,
27649  22962   
            ));
27650  22963   
        }
27651  22964   
    }
27652         -
    /// When the format is http-date, RFC3339 timestamps are rejected with a
27653         -
    /// 400 SerializationException
27654         -
    /// Test ID: RestJsonPathTimestampHttpDateRejectsDateTime_case1
       22965  +
    /// Attempted string coercion should result in SerializationException
       22966  +
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case18
27655  22967   
    #[::tokio::test]
27656         -
    async fn rest_json_path_timestamp_http_date_rejects_date_time_case1_malformed_request() {
       22968  +
    #[::tracing_test::traced_test]
       22969  +
    async fn rest_json_header_boolean_string_coercion_case18_malformed_request() {
27657  22970   
        {
27658  22971   
            #[allow(unused_mut)]
27659  22972   
            let mut http_request = http::Request::builder()
27660         -
                .uri("/MalformedTimestampPathHttpDate/1985-04-12T23%3A20%3A50Z")
       22973  +
                .uri("/MalformedBoolean/true")
27661  22974   
                .method("POST")
       22975  +
                .header("booleanInHeader", "0")
27662  22976   
                .body(::aws_smithy_http_server::body::Body::empty())
27663  22977   
                .unwrap();
27664  22978   
            #[allow(unused_mut)]
27665  22979   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
27666  22980   
            let config = crate::service::RestJsonConfig::builder().build();
27667  22981   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
27668         -
                            .malformed_timestamp_path_http_date(move |input: crate::input::MalformedTimestampPathHttpDateInput| {
       22982  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
27669  22983   
                                let sender = sender.clone();
27670  22984   
                                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> };
       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> };
27672  22986   
                                    sender.send(()).await.expect("receiver dropped early");
27673  22987   
                                    result
27674  22988   
                                }
27675  22989   
                            })
27676  22990   
                            .build_unchecked();
27677  22991   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
27678  22992   
                .await
27679  22993   
                .expect("unable to make an HTTP request");
27680  22994   
            ::pretty_assertions::assert_eq!(
27681  22995   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
27682  22996   
                http_response.status()
27683  22997   
            );
27684  22998   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
27685  22999   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
27686  23000   
                http_response.headers(),
27687  23001   
                expected_headers,
27688  23002   
            ));
27689  23003   
        }
27690  23004   
    }
27691         -
    /// When the format is http-date, RFC3339 timestamps are rejected with a
27692         -
    /// 400 SerializationException
27693         -
    /// Test ID: RestJsonPathTimestampHttpDateRejectsDateTime_case2
       23005  +
    /// Attempted string coercion should result in SerializationException
       23006  +
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case19
27694  23007   
    #[::tokio::test]
27695         -
    async fn rest_json_path_timestamp_http_date_rejects_date_time_case2_malformed_request() {
       23008  +
    #[::tracing_test::traced_test]
       23009  +
    async fn rest_json_header_boolean_string_coercion_case19_malformed_request() {
27696  23010   
        {
27697  23011   
            #[allow(unused_mut)]
27698  23012   
            let mut http_request = http::Request::builder()
27699         -
                .uri("/MalformedTimestampPathHttpDate/1996-12-19T16%3A39%3A57-08%3A00")
       23013  +
                .uri("/MalformedBoolean/true")
27700  23014   
                .method("POST")
       23015  +
                .header("booleanInHeader", "off")
27701  23016   
                .body(::aws_smithy_http_server::body::Body::empty())
27702  23017   
                .unwrap();
27703  23018   
            #[allow(unused_mut)]
27704  23019   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
27705  23020   
            let config = crate::service::RestJsonConfig::builder().build();
27706  23021   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
27707         -
                            .malformed_timestamp_path_http_date(move |input: crate::input::MalformedTimestampPathHttpDateInput| {
       23022  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
27708  23023   
                                let sender = sender.clone();
27709  23024   
                                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> };
       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> };
27711  23026   
                                    sender.send(()).await.expect("receiver dropped early");
27712  23027   
                                    result
27713  23028   
                                }
27714  23029   
                            })
27715  23030   
                            .build_unchecked();
27716  23031   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
27717  23032   
                .await
27718  23033   
                .expect("unable to make an HTTP request");
27719  23034   
            ::pretty_assertions::assert_eq!(
27720  23035   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
27721  23036   
                http_response.status()
27722  23037   
            );
27723  23038   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
27724  23039   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
27725  23040   
                http_response.headers(),
27726  23041   
                expected_headers,
27727  23042   
            ));
27728  23043   
        }
27729  23044   
    }
27730         -
    /// When the format is http-date,  epoch second timestamps are rejected with a
27731         -
    /// 400 SerializationException
27732         -
    /// Test ID: RestJsonPathTimestampHttpDateRejectsEpochSeconds_case0
       23045  +
    /// Attempted string coercion should result in SerializationException
       23046  +
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case20
27733  23047   
    #[::tokio::test]
27734         -
    async fn rest_json_path_timestamp_http_date_rejects_epoch_seconds_case0_malformed_request() {
       23048  +
    #[::tracing_test::traced_test]
       23049  +
    async fn rest_json_header_boolean_string_coercion_case20_malformed_request() {
27735  23050   
        {
27736  23051   
            #[allow(unused_mut)]
27737  23052   
            let mut http_request = http::Request::builder()
27738         -
                .uri("/MalformedTimestampPathHttpDate/1515531081.1234")
       23053  +
                .uri("/MalformedBoolean/true")
27739  23054   
                .method("POST")
       23055  +
                .header("booleanInHeader", "Off")
27740  23056   
                .body(::aws_smithy_http_server::body::Body::empty())
27741  23057   
                .unwrap();
27742  23058   
            #[allow(unused_mut)]
27743  23059   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
27744  23060   
            let config = crate::service::RestJsonConfig::builder().build();
27745  23061   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
27746         -
                            .malformed_timestamp_path_http_date(move |input: crate::input::MalformedTimestampPathHttpDateInput| {
       23062  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
27747  23063   
                                let sender = sender.clone();
27748  23064   
                                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> };
       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> };
27750  23066   
                                    sender.send(()).await.expect("receiver dropped early");
27751  23067   
                                    result
27752  23068   
                                }
27753  23069   
                            })
27754  23070   
                            .build_unchecked();
27755  23071   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
27756  23072   
                .await
27757  23073   
                .expect("unable to make an HTTP request");
27758  23074   
            ::pretty_assertions::assert_eq!(
27759  23075   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
27760  23076   
                http_response.status()
27761  23077   
            );
27762  23078   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
27763  23079   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
27764  23080   
                http_response.headers(),
27765  23081   
                expected_headers,
27766  23082   
            ));
27767  23083   
        }
27768  23084   
    }
27769         -
    /// When the format is http-date,  epoch second timestamps are rejected with a
27770         -
    /// 400 SerializationException
27771         -
    /// Test ID: RestJsonPathTimestampHttpDateRejectsEpochSeconds_case1
       23085  +
    /// Attempted string coercion should result in SerializationException
       23086  +
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case21
27772  23087   
    #[::tokio::test]
27773         -
    async fn rest_json_path_timestamp_http_date_rejects_epoch_seconds_case1_malformed_request() {
       23088  +
    #[::tracing_test::traced_test]
       23089  +
    async fn rest_json_header_boolean_string_coercion_case21_malformed_request() {
27774  23090   
        {
27775  23091   
            #[allow(unused_mut)]
27776  23092   
            let mut http_request = http::Request::builder()
27777         -
                .uri("/MalformedTimestampPathHttpDate/1515531081")
       23093  +
                .uri("/MalformedBoolean/true")
27778  23094   
                .method("POST")
       23095  +
                .header("booleanInHeader", "OFF")
27779  23096   
                .body(::aws_smithy_http_server::body::Body::empty())
27780  23097   
                .unwrap();
27781  23098   
            #[allow(unused_mut)]
27782  23099   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
27783  23100   
            let config = crate::service::RestJsonConfig::builder().build();
27784  23101   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
27785         -
                            .malformed_timestamp_path_http_date(move |input: crate::input::MalformedTimestampPathHttpDateInput| {
       23102  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
27786  23103   
                                let sender = sender.clone();
27787  23104   
                                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> };
       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> };
27789  23106   
                                    sender.send(()).await.expect("receiver dropped early");
27790  23107   
                                    result
27791  23108   
                                }
27792  23109   
                            })
27793  23110   
                            .build_unchecked();
27794  23111   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
27795  23112   
                .await
27796  23113   
                .expect("unable to make an HTTP request");
27797  23114   
            ::pretty_assertions::assert_eq!(
27798  23115   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
27799  23116   
                http_response.status()
27800  23117   
            );
27801  23118   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
27802  23119   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
27803  23120   
                http_response.headers(),
27804  23121   
                expected_headers,
27805  23122   
            ));
27806  23123   
        }
27807  23124   
    }
27808  23125   
}
27809         -
#[cfg(test)]
       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,
       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  +
27810  23210   
#[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
       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
27815  23217   
    #[::tokio::test]
27816         -
    async fn rest_json_query_timestamp_default_rejects_http_date_case0_malformed_request() {
       23218  +
    #[::tracing_test::traced_test]
       23219  +
    async fn rest_json_malformed_union_multiple_fields_set_malformed_request() {
27817  23220   
        {
27818  23221   
            #[allow(unused_mut)]
27819  23222   
            let mut http_request = http::Request::builder()
27820         -
                .uri("/MalformedTimestampQueryDefault")
       23223  +
                .uri("/MalformedUnion")
27821  23224   
                .method("POST")
27822         -
                .body(::aws_smithy_http_server::body::Body::empty())
       23225  +
                .header("content-type", "application/json")
       23226  +
                .body(::aws_smithy_http_server::body::Body::from(
       23227  +
                    ::bytes::Bytes::from_static(
       23228  +
                        "{ \"union\" : { \"int\": 2, \"string\": \"three\" } }".as_bytes(),
       23229  +
                    ),
       23230  +
                ))
27823  23231   
                .unwrap();
27824         -
            *http_request.uri_mut() = "/MalformedTimestampQueryDefault?timestamp=Tue%2C%2029%20Apr%202014%2018%3A30%3A38%20GMT".parse().unwrap();
27825  23232   
            #[allow(unused_mut)]
27826  23233   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
27827  23234   
            let config = crate::service::RestJsonConfig::builder().build();
27828  23235   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
27829         -
                            .malformed_timestamp_query_default(move |input: crate::input::MalformedTimestampQueryDefaultInput| {
       23236  +
                            .malformed_union(move |input: crate::input::MalformedUnionInput| {
27830  23237   
                                let sender = sender.clone();
27831  23238   
                                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> };
       23239  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedUnionOutput };
27833  23240   
                                    sender.send(()).await.expect("receiver dropped early");
27834  23241   
                                    result
27835  23242   
                                }
27836  23243   
                            })
27837  23244   
                            .build_unchecked();
27838  23245   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
27839  23246   
                .await
27840  23247   
                .expect("unable to make an HTTP request");
27841  23248   
            ::pretty_assertions::assert_eq!(
27842  23249   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
27843  23250   
                http_response.status()
27844  23251   
            );
27845  23252   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
27846  23253   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
27847  23254   
                http_response.headers(),
27848  23255   
                expected_headers,
27849  23256   
            ));
27850  23257   
        }
27851  23258   
    }
27852         -
    /// By default, IMF-fixdate timestamps are rejected with a
27853         -
    /// 400 SerializationException
27854         -
    /// Test ID: RestJsonQueryTimestampDefaultRejectsHttpDate_case1
       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
27855  23262   
    #[::tokio::test]
27856         -
    async fn rest_json_query_timestamp_default_rejects_http_date_case1_malformed_request() {
       23263  +
    #[::tracing_test::traced_test]
       23264  +
    async fn rest_json_malformed_union_known_and_unknown_fields_set_malformed_request() {
27857  23265   
        {
27858  23266   
            #[allow(unused_mut)]
27859  23267   
            let mut http_request = http::Request::builder()
27860         -
                .uri("/MalformedTimestampQueryDefault")
       23268  +
                .uri("/MalformedUnion")
27861  23269   
                .method("POST")
27862         -
                .body(::aws_smithy_http_server::body::Body::empty())
       23270  +
                .header("content-type", "application/json")
       23271  +
                .body(::aws_smithy_http_server::body::Body::from(
       23272  +
                    ::bytes::Bytes::from_static(
       23273  +
                        "{ \"union\" : { \"int\": 2, \"unknownField\": \"three\" } }".as_bytes(),
       23274  +
                    ),
       23275  +
                ))
27863  23276   
                .unwrap();
27864         -
            *http_request.uri_mut() = "/MalformedTimestampQueryDefault?timestamp=Sun%2C%2002%20Jan%202000%2020%3A34%3A56.000%20GMT".parse().unwrap();
27865  23277   
            #[allow(unused_mut)]
27866  23278   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
27867  23279   
            let config = crate::service::RestJsonConfig::builder().build();
27868  23280   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
27869         -
                            .malformed_timestamp_query_default(move |input: crate::input::MalformedTimestampQueryDefaultInput| {
       23281  +
                            .malformed_union(move |input: crate::input::MalformedUnionInput| {
27870  23282   
                                let sender = sender.clone();
27871  23283   
                                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> };
       23284  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedUnionOutput };
27873  23285   
                                    sender.send(()).await.expect("receiver dropped early");
27874  23286   
                                    result
27875  23287   
                                }
27876  23288   
                            })
27877  23289   
                            .build_unchecked();
27878  23290   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
27879  23291   
                .await
27880  23292   
                .expect("unable to make an HTTP request");
27881  23293   
            ::pretty_assertions::assert_eq!(
27882  23294   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
27883  23295   
                http_response.status()
27884  23296   
            );
27885  23297   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
27886  23298   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
27887  23299   
                http_response.headers(),
27888  23300   
                expected_headers,
27889  23301   
            ));
27890  23302   
        }
27891  23303   
    }
27892         -
    /// By default, epoch second timestamps are rejected with a
27893         -
    /// 400 SerializationException
27894         -
    /// Test ID: RestJsonQueryTimestampDefaultRejectsEpochSeconds_case0
       23304  +
    /// When the union has no fields set, the response should be a 400
       23305  +
    /// SerializationException.
       23306  +
    /// Test ID: RestJsonMalformedUnionNoFieldsSet
27895  23307   
    #[::tokio::test]
27896         -
    async fn rest_json_query_timestamp_default_rejects_epoch_seconds_case0_malformed_request() {
       23308  +
    #[::tracing_test::traced_test]
       23309  +
    async fn rest_json_malformed_union_no_fields_set_malformed_request() {
27897  23310   
        {
27898  23311   
            #[allow(unused_mut)]
27899  23312   
            let mut http_request = http::Request::builder()
27900         -
                .uri("/MalformedTimestampQueryDefault")
       23313  +
                .uri("/MalformedUnion")
27901  23314   
                .method("POST")
27902         -
                .body(::aws_smithy_http_server::body::Body::empty())
27903         -
                .unwrap();
27904         -
            *http_request.uri_mut() = "/MalformedTimestampQueryDefault?timestamp=1515531081.1234"
27905         -
                .parse()
       23315  +
                .header("content-type", "application/json")
       23316  +
                .body(::aws_smithy_http_server::body::Body::from(
       23317  +
                    ::bytes::Bytes::from_static("{ \"union\" : { \"int\": null } }".as_bytes()),
       23318  +
                ))
27906  23319   
                .unwrap();
27907  23320   
            #[allow(unused_mut)]
27908  23321   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
27909  23322   
            let config = crate::service::RestJsonConfig::builder().build();
27910  23323   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
27911         -
                            .malformed_timestamp_query_default(move |input: crate::input::MalformedTimestampQueryDefaultInput| {
       23324  +
                            .malformed_union(move |input: crate::input::MalformedUnionInput| {
27912  23325   
                                let sender = sender.clone();
27913  23326   
                                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> };
       23327  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedUnionOutput };
27915  23328   
                                    sender.send(()).await.expect("receiver dropped early");
27916  23329   
                                    result
27917  23330   
                                }
27918  23331   
                            })
27919  23332   
                            .build_unchecked();
27920  23333   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
27921  23334   
                .await
27922  23335   
                .expect("unable to make an HTTP request");
27923  23336   
            ::pretty_assertions::assert_eq!(
27924  23337   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
27925  23338   
                http_response.status()
27926  23339   
            );
27927  23340   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
27928  23341   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
27929  23342   
                http_response.headers(),
27930  23343   
                expected_headers,
27931  23344   
            ));
27932  23345   
        }
27933  23346   
    }
27934         -
    /// By default, epoch second timestamps are rejected with a
27935         -
    /// 400 SerializationException
27936         -
    /// Test ID: RestJsonQueryTimestampDefaultRejectsEpochSeconds_case1
       23347  +
    /// When the union value is actually an array, the response should be a 400
       23348  +
    /// SerializationException.
       23349  +
    /// Test ID: RestJsonMalformedUnionValueIsArray
27937  23350   
    #[::tokio::test]
27938         -
    async fn rest_json_query_timestamp_default_rejects_epoch_seconds_case1_malformed_request() {
       23351  +
    #[::tracing_test::traced_test]
       23352  +
    async fn rest_json_malformed_union_value_is_array_malformed_request() {
27939  23353   
        {
27940  23354   
            #[allow(unused_mut)]
27941  23355   
            let mut http_request = http::Request::builder()
27942         -
                .uri("/MalformedTimestampQueryDefault")
       23356  +
                .uri("/MalformedUnion")
27943  23357   
                .method("POST")
27944         -
                .body(::aws_smithy_http_server::body::Body::empty())
27945         -
                .unwrap();
27946         -
            *http_request.uri_mut() = "/MalformedTimestampQueryDefault?timestamp=1515531081"
27947         -
                .parse()
       23358  +
                .header("content-type", "application/json")
       23359  +
                .body(::aws_smithy_http_server::body::Body::from(
       23360  +
                    ::bytes::Bytes::from_static("{ \"union\" : [\"int\"] }".as_bytes()),
       23361  +
                ))
27948  23362   
                .unwrap();
27949  23363   
            #[allow(unused_mut)]
27950  23364   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
27951  23365   
            let config = crate::service::RestJsonConfig::builder().build();
27952  23366   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
27953         -
                            .malformed_timestamp_query_default(move |input: crate::input::MalformedTimestampQueryDefaultInput| {
       23367  +
                            .malformed_union(move |input: crate::input::MalformedUnionInput| {
27954  23368   
                                let sender = sender.clone();
27955  23369   
                                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> };
       23370  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedUnionOutput };
27957  23371   
                                    sender.send(()).await.expect("receiver dropped early");
27958  23372   
                                    result
27959  23373   
                                }
27960  23374   
                            })
27961  23375   
                            .build_unchecked();
27962  23376   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
27963  23377   
                .await
27964  23378   
                .expect("unable to make an HTTP request");
27965  23379   
            ::pretty_assertions::assert_eq!(
27966  23380   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
27967  23381   
                http_response.status()
27968  23382   
            );
27969  23383   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
27970  23384   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
27971  23385   
                http_response.headers(),
27972  23386   
                expected_headers,
27973  23387   
            ));
27974  23388   
        }
27975  23389   
    }
27976         -
    /// UTC offsets must be rejected with a
27977         -
    /// 400 SerializationException
27978         -
    /// Test ID: RestJsonQueryTimestampDefaultRejectsUTCOffsets
       23390  +
    /// When an unknown union member is received, the response should be a 400
       23391  +
    /// SerializationException.
       23392  +
    /// Test ID: RestJsonMalformedUnionUnknownMember
27979  23393   
    #[::tokio::test]
27980         -
    async fn rest_json_query_timestamp_default_rejects_utc_offsets_malformed_request() {
       23394  +
    #[::tracing_test::traced_test]
       23395  +
    async fn rest_json_malformed_union_unknown_member_malformed_request() {
27981  23396   
        {
27982  23397   
            #[allow(unused_mut)]
27983  23398   
            let mut http_request = http::Request::builder()
27984         -
                .uri("/MalformedTimestampQueryDefault")
       23399  +
                .uri("/MalformedUnion")
27985  23400   
                .method("POST")
27986         -
                .body(::aws_smithy_http_server::body::Body::empty())
27987         -
                .unwrap();
27988         -
            *http_request.uri_mut() = "/MalformedTimestampQueryDefault?timestamp=$value:L"
27989         -
                .parse()
       23401  +
                .header("content-type", "application/json")
       23402  +
                .body(::aws_smithy_http_server::body::Body::from(
       23403  +
                    ::bytes::Bytes::from_static(
       23404  +
                        "{\n    \"union\": {\n        \"unknown\": \"hello\"\n    }\n}".as_bytes(),
       23405  +
                    ),
       23406  +
                ))
27990  23407   
                .unwrap();
27991  23408   
            #[allow(unused_mut)]
27992  23409   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
27993  23410   
            let config = crate::service::RestJsonConfig::builder().build();
27994  23411   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
27995         -
                            .malformed_timestamp_query_default(move |input: crate::input::MalformedTimestampQueryDefaultInput| {
       23412  +
                            .malformed_union(move |input: crate::input::MalformedUnionInput| {
27996  23413   
                                let sender = sender.clone();
27997  23414   
                                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> };
       23415  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedUnionOutput };
27999  23416   
                                    sender.send(()).await.expect("receiver dropped early");
28000  23417   
                                    result
28001  23418   
                                }
28002  23419   
                            })
28003  23420   
                            .build_unchecked();
28004  23421   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
28005  23422   
                .await
28006  23423   
                .expect("unable to make an HTTP request");
28007  23424   
            ::pretty_assertions::assert_eq!(
28008  23425   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
28009  23426   
                http_response.status()
28010  23427   
            );
28011  23428   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
28012  23429   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
28013  23430   
                http_response.headers(),
28014  23431   
                expected_headers,
28015  23432   
            ));
28016  23433   
        }
28017  23434   
    }
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
       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,
       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
28021  23551   
    #[::tokio::test]
28022         -
    async fn rest_json_query_timestamp_default_rejects_different8601_formats_case0_malformed_request(
28023         -
    ) {
       23552  +
    #[::tracing_test::traced_test]
       23553  +
    async fn rest_json_body_integer_underflow_overflow_case0_malformed_request() {
28024  23554   
        {
28025  23555   
            #[allow(unused_mut)]
28026  23556   
            let mut http_request = http::Request::builder()
28027         -
                .uri("/MalformedTimestampQueryDefault")
       23557  +
                .uri("/MalformedInteger/1")
28028  23558   
                .method("POST")
28029         -
                .body(::aws_smithy_http_server::body::Body::empty())
       23559  +
                .header("content-type", "application/json")
       23560  +
                .body(::aws_smithy_http_server::body::Body::from(
       23561  +
                    ::bytes::Bytes::from_static(
       23562  +
                        "{ \"integerInBody\" : -9223372000000000000 }".as_bytes(),
       23563  +
                    ),
       23564  +
                ))
28030  23565   
                .unwrap();
28031         -
            *http_request.uri_mut() =
28032         -
                "/MalformedTimestampQueryDefault?timestamp=1996-12-19T16:39:57+00"
28033         -
                    .parse()
28034         -
                    .unwrap();
28035  23566   
            #[allow(unused_mut)]
28036  23567   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
28037  23568   
            let config = crate::service::RestJsonConfig::builder().build();
28038  23569   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
28039         -
                            .malformed_timestamp_query_default(move |input: crate::input::MalformedTimestampQueryDefaultInput| {
       23570  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
28040  23571   
                                let sender = sender.clone();
28041  23572   
                                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> };
       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> };
28043  23574   
                                    sender.send(()).await.expect("receiver dropped early");
28044  23575   
                                    result
28045  23576   
                                }
28046  23577   
                            })
28047  23578   
                            .build_unchecked();
28048  23579   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
28049  23580   
                .await
28050  23581   
                .expect("unable to make an HTTP request");
28051  23582   
            ::pretty_assertions::assert_eq!(
28052  23583   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
28053  23584   
                http_response.status()
28054  23585   
            );
28055  23586   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
28056  23587   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
28057  23588   
                http_response.headers(),
28058  23589   
                expected_headers,
28059  23590   
            ));
28060  23591   
        }
28061  23592   
    }
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
       23593  +
    /// Underflow or overflow should result in SerializationException
       23594  +
    /// Test ID: RestJsonBodyIntegerUnderflowOverflow_case1
28065  23595   
    #[::tokio::test]
28066         -
    async fn rest_json_query_timestamp_default_rejects_different8601_formats_case1_malformed_request(
28067         -
    ) {
       23596  +
    #[::tracing_test::traced_test]
       23597  +
    async fn rest_json_body_integer_underflow_overflow_case1_malformed_request() {
28068  23598   
        {
28069  23599   
            #[allow(unused_mut)]
28070  23600   
            let mut http_request = http::Request::builder()
28071         -
                .uri("/MalformedTimestampQueryDefault")
       23601  +
                .uri("/MalformedInteger/1")
28072  23602   
                .method("POST")
28073         -
                .body(::aws_smithy_http_server::body::Body::empty())
       23603  +
                .header("content-type", "application/json")
       23604  +
                .body(::aws_smithy_http_server::body::Body::from(
       23605  +
                    ::bytes::Bytes::from_static(
       23606  +
                        "{ \"integerInBody\" : 9223372000000000000 }".as_bytes(),
       23607  +
                    ),
       23608  +
                ))
28074  23609   
                .unwrap();
28075         -
            *http_request.uri_mut() =
28076         -
                "/MalformedTimestampQueryDefault?timestamp=1996-12-19T16:39:57+00Z"
28077         -
                    .parse()
28078         -
                    .unwrap();
28079  23610   
            #[allow(unused_mut)]
28080  23611   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
28081  23612   
            let config = crate::service::RestJsonConfig::builder().build();
28082  23613   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
28083         -
                            .malformed_timestamp_query_default(move |input: crate::input::MalformedTimestampQueryDefaultInput| {
       23614  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
28084  23615   
                                let sender = sender.clone();
28085  23616   
                                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> };
       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> };
28087  23618   
                                    sender.send(()).await.expect("receiver dropped early");
28088  23619   
                                    result
28089  23620   
                                }
28090  23621   
                            })
28091  23622   
                            .build_unchecked();
28092  23623   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
28093  23624   
                .await
28094  23625   
                .expect("unable to make an HTTP request");
28095  23626   
            ::pretty_assertions::assert_eq!(
28096  23627   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
28097  23628   
                http_response.status()
28098  23629   
            );
28099  23630   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
28100  23631   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
28101  23632   
                http_response.headers(),
28102  23633   
                expected_headers,
28103  23634   
            ));
28104  23635   
        }
28105  23636   
    }
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
       23637  +
    /// Underflow or overflow should result in SerializationException
       23638  +
    /// Test ID: RestJsonBodyIntegerUnderflowOverflow_case2
28109  23639   
    #[::tokio::test]
28110         -
    async fn rest_json_query_timestamp_default_rejects_different8601_formats_case2_malformed_request(
28111         -
    ) {
       23640  +
    #[::tracing_test::traced_test]
       23641  +
    async fn rest_json_body_integer_underflow_overflow_case2_malformed_request() {
28112  23642   
        {
28113  23643   
            #[allow(unused_mut)]
28114  23644   
            let mut http_request = http::Request::builder()
28115         -
                .uri("/MalformedTimestampQueryDefault")
       23645  +
                .uri("/MalformedInteger/1")
28116  23646   
                .method("POST")
28117         -
                .body(::aws_smithy_http_server::body::Body::empty())
       23647  +
                .header("content-type", "application/json")
       23648  +
                .body(::aws_smithy_http_server::body::Body::from(
       23649  +
                    ::bytes::Bytes::from_static(
       23650  +
                        "{ \"integerInBody\" : 123000000000000000000000 }".as_bytes(),
       23651  +
                    ),
       23652  +
                ))
28118  23653   
                .unwrap();
28119         -
            *http_request.uri_mut() =
28120         -
                "/MalformedTimestampQueryDefault?timestamp=1996-12-19T16:39:57"
28121         -
                    .parse()
28122         -
                    .unwrap();
28123  23654   
            #[allow(unused_mut)]
28124  23655   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
28125  23656   
            let config = crate::service::RestJsonConfig::builder().build();
28126  23657   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
28127         -
                            .malformed_timestamp_query_default(move |input: crate::input::MalformedTimestampQueryDefaultInput| {
       23658  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
28128  23659   
                                let sender = sender.clone();
28129  23660   
                                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> };
       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> };
28131  23662   
                                    sender.send(()).await.expect("receiver dropped early");
28132  23663   
                                    result
28133  23664   
                                }
28134  23665   
                            })
28135  23666   
                            .build_unchecked();
28136  23667   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
28137  23668   
                .await
28138  23669   
                .expect("unable to make an HTTP request");
28139  23670   
            ::pretty_assertions::assert_eq!(
28140  23671   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
28141  23672   
                http_response.status()
28142  23673   
            );
28143  23674   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
28144  23675   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
28145  23676   
                http_response.headers(),
28146  23677   
                expected_headers,
28147  23678   
            ));
28148         -
        }
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
       23679  +
        }
       23680  +
    }
       23681  +
    /// Underflow or overflow should result in SerializationException
       23682  +
    /// Test ID: RestJsonPathIntegerUnderflowOverflow_case0
28153  23683   
    #[::tokio::test]
28154         -
    async fn rest_json_query_timestamp_default_rejects_different8601_formats_case3_malformed_request(
28155         -
    ) {
       23684  +
    #[::tracing_test::traced_test]
       23685  +
    async fn rest_json_path_integer_underflow_overflow_case0_malformed_request() {
28156  23686   
        {
28157  23687   
            #[allow(unused_mut)]
28158  23688   
            let mut http_request = http::Request::builder()
28159         -
                .uri("/MalformedTimestampQueryDefault")
       23689  +
                .uri("/MalformedInteger/-9223372000000000000")
28160  23690   
                .method("POST")
28161  23691   
                .body(::aws_smithy_http_server::body::Body::empty())
28162  23692   
                .unwrap();
28163         -
            *http_request.uri_mut() = "/MalformedTimestampQueryDefault?timestamp=1996-12-19T163957"
28164         -
                .parse()
28165         -
                .unwrap();
28166  23693   
            #[allow(unused_mut)]
28167  23694   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
28168  23695   
            let config = crate::service::RestJsonConfig::builder().build();
28169  23696   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
28170         -
                            .malformed_timestamp_query_default(move |input: crate::input::MalformedTimestampQueryDefaultInput| {
       23697  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
28171  23698   
                                let sender = sender.clone();
28172  23699   
                                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> };
       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> };
28174  23701   
                                    sender.send(()).await.expect("receiver dropped early");
28175  23702   
                                    result
28176  23703   
                                }
28177  23704   
                            })
28178  23705   
                            .build_unchecked();
28179  23706   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
28180  23707   
                .await
28181  23708   
                .expect("unable to make an HTTP request");
28182  23709   
            ::pretty_assertions::assert_eq!(
28183  23710   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
28184  23711   
                http_response.status()
28185  23712   
            );
28186  23713   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
28187  23714   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
28188  23715   
                http_response.headers(),
28189  23716   
                expected_headers,
28190  23717   
            ));
28191  23718   
        }
28192  23719   
    }
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
       23720  +
    /// Underflow or overflow should result in SerializationException
       23721  +
    /// Test ID: RestJsonPathIntegerUnderflowOverflow_case1
28196  23722   
    #[::tokio::test]
28197         -
    async fn rest_json_query_timestamp_default_rejects_different8601_formats_case4_malformed_request(
28198         -
    ) {
       23723  +
    #[::tracing_test::traced_test]
       23724  +
    async fn rest_json_path_integer_underflow_overflow_case1_malformed_request() {
28199  23725   
        {
28200  23726   
            #[allow(unused_mut)]
28201  23727   
            let mut http_request = http::Request::builder()
28202         -
                .uri("/MalformedTimestampQueryDefault")
       23728  +
                .uri("/MalformedInteger/9223372000000000000")
28203  23729   
                .method("POST")
28204  23730   
                .body(::aws_smithy_http_server::body::Body::empty())
28205  23731   
                .unwrap();
28206         -
            *http_request.uri_mut() = "/MalformedTimestampQueryDefault?timestamp=19961219T163957Z"
28207         -
                .parse()
28208         -
                .unwrap();
28209  23732   
            #[allow(unused_mut)]
28210  23733   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
28211  23734   
            let config = crate::service::RestJsonConfig::builder().build();
28212  23735   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
28213         -
                            .malformed_timestamp_query_default(move |input: crate::input::MalformedTimestampQueryDefaultInput| {
       23736  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
28214  23737   
                                let sender = sender.clone();
28215  23738   
                                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> };
       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> };
28217  23740   
                                    sender.send(()).await.expect("receiver dropped early");
28218  23741   
                                    result
28219  23742   
                                }
28220  23743   
                            })
28221  23744   
                            .build_unchecked();
28222  23745   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
28223  23746   
                .await
28224  23747   
                .expect("unable to make an HTTP request");
28225  23748   
            ::pretty_assertions::assert_eq!(
28226  23749   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
28227  23750   
                http_response.status()
28228  23751   
            );
28229  23752   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
28230  23753   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
28231  23754   
                http_response.headers(),
28232  23755   
                expected_headers,
28233  23756   
            ));
28234  23757   
        }
28235  23758   
    }
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
       23759  +
    /// Underflow or overflow should result in SerializationException
       23760  +
    /// Test ID: RestJsonPathIntegerUnderflowOverflow_case2
28239  23761   
    #[::tokio::test]
28240         -
    async fn rest_json_query_timestamp_default_rejects_different8601_formats_case5_malformed_request(
28241         -
    ) {
       23762  +
    #[::tracing_test::traced_test]
       23763  +
    async fn rest_json_path_integer_underflow_overflow_case2_malformed_request() {
28242  23764   
        {
28243  23765   
            #[allow(unused_mut)]
28244  23766   
            let mut http_request = http::Request::builder()
28245         -
                .uri("/MalformedTimestampQueryDefault")
       23767  +
                .uri("/MalformedInteger/123000000000000000000000")
28246  23768   
                .method("POST")
28247  23769   
                .body(::aws_smithy_http_server::body::Body::empty())
28248  23770   
                .unwrap();
28249         -
            *http_request.uri_mut() = "/MalformedTimestampQueryDefault?timestamp=19961219T163957"
28250         -
                .parse()
28251         -
                .unwrap();
28252  23771   
            #[allow(unused_mut)]
28253  23772   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
28254  23773   
            let config = crate::service::RestJsonConfig::builder().build();
28255  23774   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
28256         -
                            .malformed_timestamp_query_default(move |input: crate::input::MalformedTimestampQueryDefaultInput| {
       23775  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
28257  23776   
                                let sender = sender.clone();
28258  23777   
                                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> };
       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> };
28260  23779   
                                    sender.send(()).await.expect("receiver dropped early");
28261  23780   
                                    result
28262  23781   
                                }
28263  23782   
                            })
28264  23783   
                            .build_unchecked();
28265  23784   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
28266  23785   
                .await
28267  23786   
                .expect("unable to make an HTTP request");
28268  23787   
            ::pretty_assertions::assert_eq!(
28269  23788   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
28270  23789   
                http_response.status()
28271  23790   
            );
28272  23791   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
28273  23792   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
28274  23793   
                http_response.headers(),
28275  23794   
                expected_headers,
28276  23795   
            ));
28277  23796   
        }
28278  23797   
    }
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
       23798  +
    /// Underflow or overflow should result in SerializationException
       23799  +
    /// Test ID: RestJsonQueryIntegerUnderflowOverflow_case0
28282  23800   
    #[::tokio::test]
28283         -
    async fn rest_json_query_timestamp_default_rejects_different8601_formats_case6_malformed_request(
28284         -
    ) {
       23801  +
    #[::tracing_test::traced_test]
       23802  +
    async fn rest_json_query_integer_underflow_overflow_case0_malformed_request() {
28285  23803   
        {
28286  23804   
            #[allow(unused_mut)]
28287  23805   
            let mut http_request = http::Request::builder()
28288         -
                .uri("/MalformedTimestampQueryDefault")
       23806  +
                .uri("/MalformedInteger/1")
28289  23807   
                .method("POST")
28290  23808   
                .body(::aws_smithy_http_server::body::Body::empty())
28291  23809   
                .unwrap();
28292         -
            *http_request.uri_mut() =
28293         -
                "/MalformedTimestampQueryDefault?timestamp=19961219T16:39:57Z"
28294         -
                    .parse()
28295         -
                    .unwrap();
       23810  +
            *http_request.uri_mut() = "/MalformedInteger/1?integerInQuery=-9223372000000000000"
       23811  +
                .parse()
       23812  +
                .unwrap();
28296  23813   
            #[allow(unused_mut)]
28297  23814   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
28298  23815   
            let config = crate::service::RestJsonConfig::builder().build();
28299  23816   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
28300         -
                            .malformed_timestamp_query_default(move |input: crate::input::MalformedTimestampQueryDefaultInput| {
       23817  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
28301  23818   
                                let sender = sender.clone();
28302  23819   
                                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> };
       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> };
28304  23821   
                                    sender.send(()).await.expect("receiver dropped early");
28305  23822   
                                    result
28306  23823   
                                }
28307  23824   
                            })
28308  23825   
                            .build_unchecked();
28309  23826   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
28310  23827   
                .await
28311  23828   
                .expect("unable to make an HTTP request");
28312  23829   
            ::pretty_assertions::assert_eq!(
28313  23830   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
28314  23831   
                http_response.status()
28315  23832   
            );
28316  23833   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
28317  23834   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
28318  23835   
                http_response.headers(),
28319  23836   
                expected_headers,
28320  23837   
            ));
28321  23838   
        }
28322  23839   
    }
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
       23840  +
    /// Underflow or overflow should result in SerializationException
       23841  +
    /// Test ID: RestJsonQueryIntegerUnderflowOverflow_case1
28326  23842   
    #[::tokio::test]
28327         -
    async fn rest_json_query_timestamp_default_rejects_different8601_formats_case7_malformed_request(
28328         -
    ) {
       23843  +
    #[::tracing_test::traced_test]
       23844  +
    async fn rest_json_query_integer_underflow_overflow_case1_malformed_request() {
28329  23845   
        {
28330  23846   
            #[allow(unused_mut)]
28331  23847   
            let mut http_request = http::Request::builder()
28332         -
                .uri("/MalformedTimestampQueryDefault")
       23848  +
                .uri("/MalformedInteger/1")
28333  23849   
                .method("POST")
28334  23850   
                .body(::aws_smithy_http_server::body::Body::empty())
28335  23851   
                .unwrap();
28336         -
            *http_request.uri_mut() = "/MalformedTimestampQueryDefault?timestamp=19961219T16:39:57"
       23852  +
            *http_request.uri_mut() = "/MalformedInteger/1?integerInQuery=9223372000000000000"
28337  23853   
                .parse()
28338  23854   
                .unwrap();
28339  23855   
            #[allow(unused_mut)]
28340  23856   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
28341  23857   
            let config = crate::service::RestJsonConfig::builder().build();
28342  23858   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
28343         -
                            .malformed_timestamp_query_default(move |input: crate::input::MalformedTimestampQueryDefaultInput| {
       23859  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
28344  23860   
                                let sender = sender.clone();
28345  23861   
                                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> };
       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> };
28347  23863   
                                    sender.send(()).await.expect("receiver dropped early");
28348  23864   
                                    result
28349  23865   
                                }
28350  23866   
                            })
28351  23867   
                            .build_unchecked();
28352  23868   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
28353  23869   
                .await
28354  23870   
                .expect("unable to make an HTTP request");
28355  23871   
            ::pretty_assertions::assert_eq!(
28356  23872   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
28357  23873   
                http_response.status()
28358  23874   
            );
28359  23875   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
28360  23876   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
28361  23877   
                http_response.headers(),
28362  23878   
                expected_headers,
28363  23879   
            ));
28364  23880   
        }
28365  23881   
    }
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
       23882  +
    /// Underflow or overflow should result in SerializationException
       23883  +
    /// Test ID: RestJsonQueryIntegerUnderflowOverflow_case2
28369  23884   
    #[::tokio::test]
28370         -
    async fn rest_json_query_timestamp_default_rejects_different8601_formats_case8_malformed_request(
28371         -
    ) {
       23885  +
    #[::tracing_test::traced_test]
       23886  +
    async fn rest_json_query_integer_underflow_overflow_case2_malformed_request() {
28372  23887   
        {
28373  23888   
            #[allow(unused_mut)]
28374  23889   
            let mut http_request = http::Request::builder()
28375         -
                .uri("/MalformedTimestampQueryDefault")
       23890  +
                .uri("/MalformedInteger/1")
28376  23891   
                .method("POST")
28377  23892   
                .body(::aws_smithy_http_server::body::Body::empty())
28378  23893   
                .unwrap();
28379         -
            *http_request.uri_mut() = "/MalformedTimestampQueryDefault?timestamp=1996-12-19T16:39Z"
       23894  +
            *http_request.uri_mut() = "/MalformedInteger/1?integerInQuery=123000000000000000000000"
28380  23895   
                .parse()
28381  23896   
                .unwrap();
28382  23897   
            #[allow(unused_mut)]
28383  23898   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
28384  23899   
            let config = crate::service::RestJsonConfig::builder().build();
28385  23900   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
28386         -
                            .malformed_timestamp_query_default(move |input: crate::input::MalformedTimestampQueryDefaultInput| {
       23901  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
28387  23902   
                                let sender = sender.clone();
28388  23903   
                                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> };
       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> };
28390  23905   
                                    sender.send(()).await.expect("receiver dropped early");
28391  23906   
                                    result
28392  23907   
                                }
28393  23908   
                            })
28394  23909   
                            .build_unchecked();
28395  23910   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
28396  23911   
                .await
28397  23912   
                .expect("unable to make an HTTP request");
28398  23913   
            ::pretty_assertions::assert_eq!(
28399  23914   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
28400  23915   
                http_response.status()
28401  23916   
            );
28402  23917   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
28403  23918   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
28404  23919   
                http_response.headers(),
28405  23920   
                expected_headers,
28406  23921   
            ));
28407  23922   
        }
28408  23923   
    }
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
       23924  +
    /// Underflow or overflow should result in SerializationException
       23925  +
    /// Test ID: RestJsonHeaderIntegerUnderflowOverflow_case0
28412  23926   
    #[::tokio::test]
28413         -
    async fn rest_json_query_timestamp_default_rejects_different8601_formats_case9_malformed_request(
28414         -
    ) {
       23927  +
    #[::tracing_test::traced_test]
       23928  +
    async fn rest_json_header_integer_underflow_overflow_case0_malformed_request() {
28415  23929   
        {
28416  23930   
            #[allow(unused_mut)]
28417  23931   
            let mut http_request = http::Request::builder()
28418         -
                .uri("/MalformedTimestampQueryDefault")
       23932  +
                .uri("/MalformedInteger/1")
28419  23933   
                .method("POST")
       23934  +
                .header("integerInHeader", "-9223372000000000000")
28420  23935   
                .body(::aws_smithy_http_server::body::Body::empty())
28421  23936   
                .unwrap();
28422         -
            *http_request.uri_mut() = "/MalformedTimestampQueryDefault?timestamp=1996-12-19T16:39"
28423         -
                .parse()
28424         -
                .unwrap();
28425  23937   
            #[allow(unused_mut)]
28426  23938   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
28427  23939   
            let config = crate::service::RestJsonConfig::builder().build();
28428  23940   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
28429         -
                            .malformed_timestamp_query_default(move |input: crate::input::MalformedTimestampQueryDefaultInput| {
       23941  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
28430  23942   
                                let sender = sender.clone();
28431  23943   
                                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> };
       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> };
28433  23945   
                                    sender.send(()).await.expect("receiver dropped early");
28434  23946   
                                    result
28435  23947   
                                }
28436  23948   
                            })
28437  23949   
                            .build_unchecked();
28438  23950   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
28439  23951   
                .await
28440  23952   
                .expect("unable to make an HTTP request");
28441  23953   
            ::pretty_assertions::assert_eq!(
28442  23954   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
28443  23955   
                http_response.status()
28444  23956   
            );
28445  23957   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
28446  23958   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
28447  23959   
                http_response.headers(),
28448  23960   
                expected_headers,
28449  23961   
            ));
28450  23962   
        }
28451  23963   
    }
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
       23964  +
    /// Underflow or overflow should result in SerializationException
       23965  +
    /// Test ID: RestJsonHeaderIntegerUnderflowOverflow_case1
28455  23966   
    #[::tokio::test]
28456         -
    async fn rest_json_query_timestamp_default_rejects_different8601_formats_case10_malformed_request(
28457         -
    ) {
       23967  +
    #[::tracing_test::traced_test]
       23968  +
    async fn rest_json_header_integer_underflow_overflow_case1_malformed_request() {
28458  23969   
        {
28459  23970   
            #[allow(unused_mut)]
28460  23971   
            let mut http_request = http::Request::builder()
28461         -
                .uri("/MalformedTimestampQueryDefault")
       23972  +
                .uri("/MalformedInteger/1")
28462  23973   
                .method("POST")
       23974  +
                .header("integerInHeader", "9223372000000000000")
28463  23975   
                .body(::aws_smithy_http_server::body::Body::empty())
28464  23976   
                .unwrap();
28465         -
            *http_request.uri_mut() = "/MalformedTimestampQueryDefault?timestamp=1996-12-19T1639"
28466         -
                .parse()
28467         -
                .unwrap();
28468  23977   
            #[allow(unused_mut)]
28469  23978   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
28470  23979   
            let config = crate::service::RestJsonConfig::builder().build();
28471  23980   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
28472         -
                            .malformed_timestamp_query_default(move |input: crate::input::MalformedTimestampQueryDefaultInput| {
       23981  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
28473  23982   
                                let sender = sender.clone();
28474  23983   
                                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> };
       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> };
28476  23985   
                                    sender.send(()).await.expect("receiver dropped early");
28477  23986   
                                    result
28478  23987   
                                }
28479  23988   
                            })
28480  23989   
                            .build_unchecked();
28481  23990   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
28482  23991   
                .await
28483  23992   
                .expect("unable to make an HTTP request");
28484  23993   
            ::pretty_assertions::assert_eq!(
28485  23994   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
28486  23995   
                http_response.status()
28487  23996   
            );
28488  23997   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
28489  23998   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
28490  23999   
                http_response.headers(),
28491  24000   
                expected_headers,
28492  24001   
            ));
28493  24002   
        }
28494  24003   
    }
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
       24004  +
    /// Underflow or overflow should result in SerializationException
       24005  +
    /// Test ID: RestJsonHeaderIntegerUnderflowOverflow_case2
28498  24006   
    #[::tokio::test]
28499         -
    async fn rest_json_query_timestamp_default_rejects_different8601_formats_case11_malformed_request(
28500         -
    ) {
       24007  +
    #[::tracing_test::traced_test]
       24008  +
    async fn rest_json_header_integer_underflow_overflow_case2_malformed_request() {
28501  24009   
        {
28502  24010   
            #[allow(unused_mut)]
28503  24011   
            let mut http_request = http::Request::builder()
28504         -
                .uri("/MalformedTimestampQueryDefault")
       24012  +
                .uri("/MalformedInteger/1")
28505  24013   
                .method("POST")
       24014  +
                .header("integerInHeader", "123000000000000000000000")
28506  24015   
                .body(::aws_smithy_http_server::body::Body::empty())
28507  24016   
                .unwrap();
28508         -
            *http_request.uri_mut() = "/MalformedTimestampQueryDefault?timestamp=1996-12-19T16Z"
28509         -
                .parse()
28510         -
                .unwrap();
28511  24017   
            #[allow(unused_mut)]
28512  24018   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
28513  24019   
            let config = crate::service::RestJsonConfig::builder().build();
28514  24020   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
28515         -
                            .malformed_timestamp_query_default(move |input: crate::input::MalformedTimestampQueryDefaultInput| {
       24021  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
28516  24022   
                                let sender = sender.clone();
28517  24023   
                                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> };
       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> };
28519  24025   
                                    sender.send(()).await.expect("receiver dropped early");
28520  24026   
                                    result
28521  24027   
                                }
28522  24028   
                            })
28523  24029   
                            .build_unchecked();
28524  24030   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
28525  24031   
                .await
28526  24032   
                .expect("unable to make an HTTP request");
28527  24033   
            ::pretty_assertions::assert_eq!(
28528  24034   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
28529  24035   
                http_response.status()
28530  24036   
            );
28531  24037   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
28532  24038   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
28533  24039   
                http_response.headers(),
28534  24040   
                expected_headers,
28535  24041   
            ));
28536  24042   
        }
28537  24043   
    }
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
       24044  +
    /// Malformed values in the body should be rejected
       24045  +
    /// Test ID: RestJsonBodyIntegerMalformedValueRejected_case0
28541  24046   
    #[::tokio::test]
28542         -
    async fn rest_json_query_timestamp_default_rejects_different8601_formats_case12_malformed_request(
28543         -
    ) {
       24047  +
    #[::tracing_test::traced_test]
       24048  +
    async fn rest_json_body_integer_malformed_value_rejected_case0_malformed_request() {
28544  24049   
        {
28545  24050   
            #[allow(unused_mut)]
28546  24051   
            let mut http_request = http::Request::builder()
28547         -
                .uri("/MalformedTimestampQueryDefault")
       24052  +
                .uri("/MalformedInteger/1")
28548  24053   
                .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()
       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  +
                ))
28553  24058   
                .unwrap();
28554  24059   
            #[allow(unused_mut)]
28555  24060   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
28556  24061   
            let config = crate::service::RestJsonConfig::builder().build();
28557  24062   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
28558         -
                            .malformed_timestamp_query_default(move |input: crate::input::MalformedTimestampQueryDefaultInput| {
       24063  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
28559  24064   
                                let sender = sender.clone();
28560  24065   
                                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> };
       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> };
28562  24067   
                                    sender.send(()).await.expect("receiver dropped early");
28563  24068   
                                    result
28564  24069   
                                }
28565  24070   
                            })
28566  24071   
                            .build_unchecked();
28567  24072   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
28568  24073   
                .await
28569  24074   
                .expect("unable to make an HTTP request");
28570  24075   
            ::pretty_assertions::assert_eq!(
28571  24076   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
28572  24077   
                http_response.status()
28573  24078   
            );
28574  24079   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
28575  24080   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
28576  24081   
                http_response.headers(),
28577  24082   
                expected_headers,
28578  24083   
            ));
28579  24084   
        }
28580  24085   
    }
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
       24086  +
    /// Malformed values in the body should be rejected
       24087  +
    /// Test ID: RestJsonBodyIntegerMalformedValueRejected_case1
28584  24088   
    #[::tokio::test]
28585         -
    async fn rest_json_query_timestamp_default_rejects_different8601_formats_case13_malformed_request(
28586         -
    ) {
       24089  +
    #[::tracing_test::traced_test]
       24090  +
    async fn rest_json_body_integer_malformed_value_rejected_case1_malformed_request() {
28587  24091   
        {
28588  24092   
            #[allow(unused_mut)]
28589  24093   
            let mut http_request = http::Request::builder()
28590         -
                .uri("/MalformedTimestampQueryDefault")
       24094  +
                .uri("/MalformedInteger/1")
28591  24095   
                .method("POST")
28592         -
                .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  +
                ))
28593  24100   
                .unwrap();
28594         -
            *http_request.uri_mut() =
28595         -
                "/MalformedTimestampQueryDefault?timestamp=1996-12-19%2016:39:57Z"
28596         -
                    .parse()
28597         -
                    .unwrap();
28598  24101   
            #[allow(unused_mut)]
28599  24102   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
28600  24103   
            let config = crate::service::RestJsonConfig::builder().build();
28601  24104   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
28602         -
                            .malformed_timestamp_query_default(move |input: crate::input::MalformedTimestampQueryDefaultInput| {
       24105  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
28603  24106   
                                let sender = sender.clone();
28604  24107   
                                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> };
       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> };
28606  24109   
                                    sender.send(()).await.expect("receiver dropped early");
28607  24110   
                                    result
28608  24111   
                                }
28609  24112   
                            })
28610  24113   
                            .build_unchecked();
28611  24114   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
28612  24115   
                .await
28613  24116   
                .expect("unable to make an HTTP request");
28614  24117   
            ::pretty_assertions::assert_eq!(
28615  24118   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
28616  24119   
                http_response.status()
28617  24120   
            );
28618  24121   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
28619  24122   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
28620  24123   
                http_response.headers(),
28621  24124   
                expected_headers,
28622  24125   
            ));
28623  24126   
        }
28624  24127   
    }
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
       24128  +
    /// Malformed values in the body should be rejected
       24129  +
    /// Test ID: RestJsonBodyIntegerMalformedValueRejected_case2
28628  24130   
    #[::tokio::test]
28629         -
    async fn rest_json_query_timestamp_default_rejects_different8601_formats_case14_malformed_request(
28630         -
    ) {
       24131  +
    #[::tracing_test::traced_test]
       24132  +
    async fn rest_json_body_integer_malformed_value_rejected_case2_malformed_request() {
28631  24133   
        {
28632  24134   
            #[allow(unused_mut)]
28633  24135   
            let mut http_request = http::Request::builder()
28634         -
                .uri("/MalformedTimestampQueryDefault")
       24136  +
                .uri("/MalformedInteger/1")
28635  24137   
                .method("POST")
28636         -
                .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  +
                ))
28637  24142   
                .unwrap();
28638         -
            *http_request.uri_mut() =
28639         -
                "/MalformedTimestampQueryDefault?timestamp=2011-12-03T10:15:30+01:00[Europe/Paris]"
28640         -
                    .parse()
28641         -
                    .unwrap();
28642  24143   
            #[allow(unused_mut)]
28643  24144   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
28644  24145   
            let config = crate::service::RestJsonConfig::builder().build();
28645  24146   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
28646         -
                            .malformed_timestamp_query_default(move |input: crate::input::MalformedTimestampQueryDefaultInput| {
       24147  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
28647  24148   
                                let sender = sender.clone();
28648  24149   
                                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> };
       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> };
28650  24151   
                                    sender.send(()).await.expect("receiver dropped early");
28651  24152   
                                    result
28652  24153   
                                }
28653  24154   
                            })
28654  24155   
                            .build_unchecked();
28655  24156   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
28656  24157   
                .await
28657  24158   
                .expect("unable to make an HTTP request");
28658  24159   
            ::pretty_assertions::assert_eq!(
28659  24160   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
28660  24161   
                http_response.status()
28661  24162   
            );
28662  24163   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
28663  24164   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
28664  24165   
                http_response.headers(),
28665  24166   
                expected_headers,
28666  24167   
            ));
28667  24168   
        }
28668  24169   
    }
28669         -
}
28670         -
#[cfg(test)]
28671         -
#[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
       24170  +
    /// Malformed values in the body should be rejected
       24171  +
    /// Test ID: RestJsonBodyIntegerMalformedValueRejected_case3
28676  24172   
    #[::tokio::test]
28677         -
    async fn rest_json_query_timestamp_epoch_rejects_date_time_case0_malformed_request() {
       24173  +
    #[::tracing_test::traced_test]
       24174  +
    async fn rest_json_body_integer_malformed_value_rejected_case3_malformed_request() {
28678  24175   
        {
28679  24176   
            #[allow(unused_mut)]
28680  24177   
            let mut http_request = http::Request::builder()
28681         -
                .uri("/MalformedTimestampQueryEpoch")
       24178  +
                .uri("/MalformedInteger/1")
28682  24179   
                .method("POST")
28683         -
                .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  +
                ))
28684  24184   
                .unwrap();
28685         -
            *http_request.uri_mut() =
28686         -
                "/MalformedTimestampQueryEpoch?timestamp=1985-04-12T23%3A20%3A50.52Z"
28687         -
                    .parse()
28688         -
                    .unwrap();
28689  24185   
            #[allow(unused_mut)]
28690  24186   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
28691  24187   
            let config = crate::service::RestJsonConfig::builder().build();
28692  24188   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
28693         -
                            .malformed_timestamp_query_epoch(move |input: crate::input::MalformedTimestampQueryEpochInput| {
       24189  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
28694  24190   
                                let sender = sender.clone();
28695  24191   
                                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> };
       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> };
28697  24193   
                                    sender.send(()).await.expect("receiver dropped early");
28698  24194   
                                    result
28699  24195   
                                }
28700  24196   
                            })
28701  24197   
                            .build_unchecked();
28702  24198   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
28703  24199   
                .await
28704  24200   
                .expect("unable to make an HTTP request");
28705  24201   
            ::pretty_assertions::assert_eq!(
28706  24202   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
28707  24203   
                http_response.status()
28708  24204   
            );
28709  24205   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
28710  24206   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
28711  24207   
                http_response.headers(),
28712  24208   
                expected_headers,
28713  24209   
            ));
28714  24210   
        }
28715  24211   
    }
28716         -
    /// When the format is epoch-seconds, RFC3339 timestamps are rejected with a
28717         -
    /// 400 SerializationException
28718         -
    /// Test ID: RestJsonQueryTimestampEpochRejectsDateTime_case1
       24212  +
    /// Malformed values in the body should be rejected
       24213  +
    /// Test ID: RestJsonBodyIntegerMalformedValueRejected_case4
28719  24214   
    #[::tokio::test]
28720         -
    async fn rest_json_query_timestamp_epoch_rejects_date_time_case1_malformed_request() {
       24215  +
    #[::tracing_test::traced_test]
       24216  +
    async fn rest_json_body_integer_malformed_value_rejected_case4_malformed_request() {
28721  24217   
        {
28722  24218   
            #[allow(unused_mut)]
28723  24219   
            let mut http_request = http::Request::builder()
28724         -
                .uri("/MalformedTimestampQueryEpoch")
       24220  +
                .uri("/MalformedInteger/1")
28725  24221   
                .method("POST")
28726         -
                .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  +
                ))
28727  24226   
                .unwrap();
28728         -
            *http_request.uri_mut() =
28729         -
                "/MalformedTimestampQueryEpoch?timestamp=1985-04-12T23%3A20%3A50Z"
28730         -
                    .parse()
28731         -
                    .unwrap();
28732  24227   
            #[allow(unused_mut)]
28733  24228   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
28734  24229   
            let config = crate::service::RestJsonConfig::builder().build();
28735  24230   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
28736         -
                            .malformed_timestamp_query_epoch(move |input: crate::input::MalformedTimestampQueryEpochInput| {
       24231  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
28737  24232   
                                let sender = sender.clone();
28738  24233   
                                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> };
       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> };
28740  24235   
                                    sender.send(()).await.expect("receiver dropped early");
28741  24236   
                                    result
28742  24237   
                                }
28743  24238   
                            })
28744  24239   
                            .build_unchecked();
28745  24240   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
28746  24241   
                .await
28747  24242   
                .expect("unable to make an HTTP request");
28748  24243   
            ::pretty_assertions::assert_eq!(
28749  24244   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
28750  24245   
                http_response.status()
28751  24246   
            );
28752  24247   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
28753  24248   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
28754  24249   
                http_response.headers(),
28755  24250   
                expected_headers,
28756  24251   
            ));
28757  24252   
        }
28758  24253   
    }
28759         -
    /// When the format is epoch-seconds, RFC3339 timestamps are rejected with a
28760         -
    /// 400 SerializationException
28761         -
    /// Test ID: RestJsonQueryTimestampEpochRejectsDateTime_case2
       24254  +
    /// Malformed values in the body should be rejected
       24255  +
    /// Test ID: RestJsonBodyIntegerMalformedValueRejected_case5
28762  24256   
    #[::tokio::test]
28763         -
    async fn rest_json_query_timestamp_epoch_rejects_date_time_case2_malformed_request() {
       24257  +
    #[::tracing_test::traced_test]
       24258  +
    async fn rest_json_body_integer_malformed_value_rejected_case5_malformed_request() {
28764  24259   
        {
28765  24260   
            #[allow(unused_mut)]
28766  24261   
            let mut http_request = http::Request::builder()
28767         -
                .uri("/MalformedTimestampQueryEpoch")
       24262  +
                .uri("/MalformedInteger/1")
28768  24263   
                .method("POST")
28769         -
                .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  +
                ))
28770  24268   
                .unwrap();
28771         -
            *http_request.uri_mut() =
28772         -
                "/MalformedTimestampQueryEpoch?timestamp=1996-12-19T16%3A39%3A57-08%3A00"
28773         -
                    .parse()
28774         -
                    .unwrap();
28775  24269   
            #[allow(unused_mut)]
28776  24270   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
28777  24271   
            let config = crate::service::RestJsonConfig::builder().build();
28778  24272   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
28779         -
                            .malformed_timestamp_query_epoch(move |input: crate::input::MalformedTimestampQueryEpochInput| {
       24273  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
28780  24274   
                                let sender = sender.clone();
28781  24275   
                                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> };
       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> };
28783  24277   
                                    sender.send(()).await.expect("receiver dropped early");
28784  24278   
                                    result
28785  24279   
                                }
28786  24280   
                            })
28787  24281   
                            .build_unchecked();
28788  24282   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
28789  24283   
                .await
28790  24284   
                .expect("unable to make an HTTP request");
28791  24285   
            ::pretty_assertions::assert_eq!(
28792  24286   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
28793  24287   
                http_response.status()
28794  24288   
            );
28795  24289   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
28796  24290   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
28797  24291   
                http_response.headers(),
28798  24292   
                expected_headers,
28799  24293   
            ));
28800  24294   
        }
28801  24295   
    }
28802         -
    /// When the format is epoch-seconds, IMF-fixdate timestamps are rejected with a
28803         -
    /// 400 SerializationException
28804         -
    /// Test ID: RestJsonQueryTimestampEpochRejectsHttpDate_case0
       24296  +
    /// Malformed values in the body should be rejected
       24297  +
    /// Test ID: RestJsonBodyIntegerMalformedValueRejected_case6
28805  24298   
    #[::tokio::test]
28806         -
    async fn rest_json_query_timestamp_epoch_rejects_http_date_case0_malformed_request() {
       24299  +
    #[::tracing_test::traced_test]
       24300  +
    async fn rest_json_body_integer_malformed_value_rejected_case6_malformed_request() {
28807  24301   
        {
28808  24302   
            #[allow(unused_mut)]
28809  24303   
            let mut http_request = http::Request::builder()
28810         -
                .uri("/MalformedTimestampQueryEpoch")
       24304  +
                .uri("/MalformedInteger/1")
28811  24305   
                .method("POST")
28812         -
                .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  +
                ))
28813  24310   
                .unwrap();
28814         -
            *http_request.uri_mut() = "/MalformedTimestampQueryEpoch?timestamp=Tue%2C%2029%20Apr%202014%2018%3A30%3A38%20GMT".parse().unwrap();
28815  24311   
            #[allow(unused_mut)]
28816  24312   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
28817  24313   
            let config = crate::service::RestJsonConfig::builder().build();
28818  24314   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
28819         -
                            .malformed_timestamp_query_epoch(move |input: crate::input::MalformedTimestampQueryEpochInput| {
       24315  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
28820  24316   
                                let sender = sender.clone();
28821  24317   
                                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> };
       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> };
28823  24319   
                                    sender.send(()).await.expect("receiver dropped early");
28824  24320   
                                    result
28825  24321   
                                }
28826  24322   
                            })
28827  24323   
                            .build_unchecked();
28828  24324   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
28829  24325   
                .await
28830  24326   
                .expect("unable to make an HTTP request");
28831  24327   
            ::pretty_assertions::assert_eq!(
28832  24328   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
28833  24329   
                http_response.status()
28834  24330   
            );
28835  24331   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
28836  24332   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
28837  24333   
                http_response.headers(),
28838  24334   
                expected_headers,
28839  24335   
            ));
28840  24336   
        }
28841  24337   
    }
28842         -
    /// When the format is epoch-seconds, IMF-fixdate timestamps are rejected with a
28843         -
    /// 400 SerializationException
28844         -
    /// Test ID: RestJsonQueryTimestampEpochRejectsHttpDate_case1
       24338  +
    /// Malformed values in the body should be rejected
       24339  +
    /// Test ID: RestJsonBodyIntegerMalformedValueRejected_case7
28845  24340   
    #[::tokio::test]
28846         -
    async fn rest_json_query_timestamp_epoch_rejects_http_date_case1_malformed_request() {
       24341  +
    #[::tracing_test::traced_test]
       24342  +
    async fn rest_json_body_integer_malformed_value_rejected_case7_malformed_request() {
28847  24343   
        {
28848  24344   
            #[allow(unused_mut)]
28849  24345   
            let mut http_request = http::Request::builder()
28850         -
                .uri("/MalformedTimestampQueryEpoch")
       24346  +
                .uri("/MalformedInteger/1")
28851  24347   
                .method("POST")
28852         -
                .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  +
                ))
28853  24352   
                .unwrap();
28854         -
            *http_request.uri_mut() = "/MalformedTimestampQueryEpoch?timestamp=Sun%2C%2002%20Jan%202000%2020%3A34%3A56.000%20GMT".parse().unwrap();
28855  24353   
            #[allow(unused_mut)]
28856  24354   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
28857  24355   
            let config = crate::service::RestJsonConfig::builder().build();
28858  24356   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
28859         -
                            .malformed_timestamp_query_epoch(move |input: crate::input::MalformedTimestampQueryEpochInput| {
       24357  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
28860  24358   
                                let sender = sender.clone();
28861  24359   
                                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> };
       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> };
28863  24361   
                                    sender.send(()).await.expect("receiver dropped early");
28864  24362   
                                    result
28865  24363   
                                }
28866  24364   
                            })
28867  24365   
                            .build_unchecked();
28868  24366   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
28869  24367   
                .await
28870  24368   
                .expect("unable to make an HTTP request");
28871  24369   
            ::pretty_assertions::assert_eq!(
28872  24370   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
28873  24371   
                http_response.status()
28874  24372   
            );
28875  24373   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
28876  24374   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
28877  24375   
                http_response.headers(),
28878  24376   
                expected_headers,
28879  24377   
            ));
28880  24378   
        }
28881  24379   
    }
28882         -
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
28883         -
    /// Test ID: RestJsonQueryTimestampEpochRejectsMalformedValues_case0
       24380  +
    /// Malformed values in the body should be rejected
       24381  +
    /// Test ID: RestJsonBodyIntegerMalformedValueRejected_case8
28884  24382   
    #[::tokio::test]
28885         -
    async fn rest_json_query_timestamp_epoch_rejects_malformed_values_case0_malformed_request() {
       24383  +
    #[::tracing_test::traced_test]
       24384  +
    async fn rest_json_body_integer_malformed_value_rejected_case8_malformed_request() {
28886  24385   
        {
28887  24386   
            #[allow(unused_mut)]
28888  24387   
            let mut http_request = http::Request::builder()
28889         -
                .uri("/MalformedTimestampQueryEpoch")
       24388  +
                .uri("/MalformedInteger/1")
28890  24389   
                .method("POST")
28891         -
                .body(::aws_smithy_http_server::body::Body::empty())
28892         -
                .unwrap();
28893         -
            *http_request.uri_mut() = "/MalformedTimestampQueryEpoch?timestamp=true"
28894         -
                .parse()
       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  +
                ))
28895  24394   
                .unwrap();
28896  24395   
            #[allow(unused_mut)]
28897  24396   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
28898  24397   
            let config = crate::service::RestJsonConfig::builder().build();
28899  24398   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
28900         -
                            .malformed_timestamp_query_epoch(move |input: crate::input::MalformedTimestampQueryEpochInput| {
       24399  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
28901  24400   
                                let sender = sender.clone();
28902  24401   
                                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> };
       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> };
28904  24403   
                                    sender.send(()).await.expect("receiver dropped early");
28905  24404   
                                    result
28906  24405   
                                }
28907  24406   
                            })
28908  24407   
                            .build_unchecked();
28909  24408   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
28910  24409   
                .await
28911  24410   
                .expect("unable to make an HTTP request");
28912  24411   
            ::pretty_assertions::assert_eq!(
28913  24412   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
28914  24413   
                http_response.status()
28915  24414   
            );
28916  24415   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
28917  24416   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
28918  24417   
                http_response.headers(),
28919  24418   
                expected_headers,
28920  24419   
            ));
28921  24420   
        }
28922  24421   
    }
28923         -
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
28924         -
    /// Test ID: RestJsonQueryTimestampEpochRejectsMalformedValues_case1
       24422  +
    /// Malformed values in the body should be rejected
       24423  +
    /// Test ID: RestJsonBodyIntegerMalformedValueRejected_case9
28925  24424   
    #[::tokio::test]
28926         -
    async fn rest_json_query_timestamp_epoch_rejects_malformed_values_case1_malformed_request() {
       24425  +
    #[::tracing_test::traced_test]
       24426  +
    async fn rest_json_body_integer_malformed_value_rejected_case9_malformed_request() {
28927  24427   
        {
28928  24428   
            #[allow(unused_mut)]
28929  24429   
            let mut http_request = http::Request::builder()
28930         -
                .uri("/MalformedTimestampQueryEpoch")
       24430  +
                .uri("/MalformedInteger/1")
28931  24431   
                .method("POST")
28932         -
                .body(::aws_smithy_http_server::body::Body::empty())
28933         -
                .unwrap();
28934         -
            *http_request.uri_mut() = "/MalformedTimestampQueryEpoch?timestamp=1515531081ABC"
28935         -
                .parse()
       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  +
                ))
28936  24436   
                .unwrap();
28937  24437   
            #[allow(unused_mut)]
28938  24438   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
28939  24439   
            let config = crate::service::RestJsonConfig::builder().build();
28940  24440   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
28941         -
                            .malformed_timestamp_query_epoch(move |input: crate::input::MalformedTimestampQueryEpochInput| {
       24441  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
28942  24442   
                                let sender = sender.clone();
28943  24443   
                                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> };
       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> };
28945  24445   
                                    sender.send(()).await.expect("receiver dropped early");
28946  24446   
                                    result
28947  24447   
                                }
28948  24448   
                            })
28949  24449   
                            .build_unchecked();
28950  24450   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
28951  24451   
                .await
28952  24452   
                .expect("unable to make an HTTP request");
28953  24453   
            ::pretty_assertions::assert_eq!(
28954  24454   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
28955  24455   
                http_response.status()
28956  24456   
            );
28957  24457   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
28958  24458   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
28959  24459   
                http_response.headers(),
28960  24460   
                expected_headers,
28961  24461   
            ));
28962  24462   
        }
28963  24463   
    }
28964         -
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
28965         -
    /// Test ID: RestJsonQueryTimestampEpochRejectsMalformedValues_case2
       24464  +
    /// Malformed values in the body should be rejected
       24465  +
    /// Test ID: RestJsonBodyIntegerMalformedValueRejected_case10
28966  24466   
    #[::tokio::test]
28967         -
    async fn rest_json_query_timestamp_epoch_rejects_malformed_values_case2_malformed_request() {
       24467  +
    #[::tracing_test::traced_test]
       24468  +
    async fn rest_json_body_integer_malformed_value_rejected_case10_malformed_request() {
28968  24469   
        {
28969  24470   
            #[allow(unused_mut)]
28970  24471   
            let mut http_request = http::Request::builder()
28971         -
                .uri("/MalformedTimestampQueryEpoch")
       24472  +
                .uri("/MalformedInteger/1")
28972  24473   
                .method("POST")
28973         -
                .body(::aws_smithy_http_server::body::Body::empty())
28974         -
                .unwrap();
28975         -
            *http_request.uri_mut() = "/MalformedTimestampQueryEpoch?timestamp=0x42"
28976         -
                .parse()
       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  +
                ))
28977  24478   
                .unwrap();
28978  24479   
            #[allow(unused_mut)]
28979  24480   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
28980  24481   
            let config = crate::service::RestJsonConfig::builder().build();
28981  24482   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
28982         -
                            .malformed_timestamp_query_epoch(move |input: crate::input::MalformedTimestampQueryEpochInput| {
       24483  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
28983  24484   
                                let sender = sender.clone();
28984  24485   
                                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> };
       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> };
28986  24487   
                                    sender.send(()).await.expect("receiver dropped early");
28987  24488   
                                    result
28988  24489   
                                }
28989  24490   
                            })
28990  24491   
                            .build_unchecked();
28991  24492   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
28992  24493   
                .await
28993  24494   
                .expect("unable to make an HTTP request");
28994  24495   
            ::pretty_assertions::assert_eq!(
28995  24496   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
28996  24497   
                http_response.status()
28997  24498   
            );
28998  24499   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
28999  24500   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
29000  24501   
                http_response.headers(),
29001  24502   
                expected_headers,
29002  24503   
            ));
29003  24504   
        }
29004  24505   
    }
29005         -
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
29006         -
    /// Test ID: RestJsonQueryTimestampEpochRejectsMalformedValues_case3
       24506  +
    /// Malformed values in the path should be rejected
       24507  +
    /// Test ID: RestJsonPathIntegerMalformedValueRejected_case0
29007  24508   
    #[::tokio::test]
29008         -
    async fn rest_json_query_timestamp_epoch_rejects_malformed_values_case3_malformed_request() {
       24509  +
    #[::tracing_test::traced_test]
       24510  +
    async fn rest_json_path_integer_malformed_value_rejected_case0_malformed_request() {
29009  24511   
        {
29010  24512   
            #[allow(unused_mut)]
29011  24513   
            let mut http_request = http::Request::builder()
29012         -
                .uri("/MalformedTimestampQueryEpoch")
       24514  +
                .uri("/MalformedInteger/true")
29013  24515   
                .method("POST")
29014  24516   
                .body(::aws_smithy_http_server::body::Body::empty())
29015  24517   
                .unwrap();
29016         -
            *http_request.uri_mut() = "/MalformedTimestampQueryEpoch?timestamp=1515531081.123.456"
29017         -
                .parse()
29018         -
                .unwrap();
29019  24518   
            #[allow(unused_mut)]
29020  24519   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
29021  24520   
            let config = crate::service::RestJsonConfig::builder().build();
29022  24521   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
29023         -
                            .malformed_timestamp_query_epoch(move |input: crate::input::MalformedTimestampQueryEpochInput| {
       24522  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
29024  24523   
                                let sender = sender.clone();
29025  24524   
                                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> };
       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> };
29027  24526   
                                    sender.send(()).await.expect("receiver dropped early");
29028  24527   
                                    result
29029  24528   
                                }
29030  24529   
                            })
29031  24530   
                            .build_unchecked();
29032  24531   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
29033  24532   
                .await
29034  24533   
                .expect("unable to make an HTTP request");
29035  24534   
            ::pretty_assertions::assert_eq!(
29036  24535   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
29037  24536   
                http_response.status()
29038  24537   
            );
29039  24538   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
29040  24539   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
29041  24540   
                http_response.headers(),
29042  24541   
                expected_headers,
29043  24542   
            ));
29044  24543   
        }
29045  24544   
    }
29046         -
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
29047         -
    /// Test ID: RestJsonQueryTimestampEpochRejectsMalformedValues_case4
       24545  +
    /// Malformed values in the path should be rejected
       24546  +
    /// Test ID: RestJsonPathIntegerMalformedValueRejected_case1
29048  24547   
    #[::tokio::test]
29049         -
    async fn rest_json_query_timestamp_epoch_rejects_malformed_values_case4_malformed_request() {
       24548  +
    #[::tracing_test::traced_test]
       24549  +
    async fn rest_json_path_integer_malformed_value_rejected_case1_malformed_request() {
29050  24550   
        {
29051  24551   
            #[allow(unused_mut)]
29052  24552   
            let mut http_request = http::Request::builder()
29053         -
                .uri("/MalformedTimestampQueryEpoch")
       24553  +
                .uri("/MalformedInteger/1.001")
29054  24554   
                .method("POST")
29055  24555   
                .body(::aws_smithy_http_server::body::Body::empty())
29056  24556   
                .unwrap();
29057         -
            *http_request.uri_mut() = "/MalformedTimestampQueryEpoch?timestamp=Infinity"
29058         -
                .parse()
29059         -
                .unwrap();
29060  24557   
            #[allow(unused_mut)]
29061  24558   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
29062  24559   
            let config = crate::service::RestJsonConfig::builder().build();
29063  24560   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
29064         -
                            .malformed_timestamp_query_epoch(move |input: crate::input::MalformedTimestampQueryEpochInput| {
       24561  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
29065  24562   
                                let sender = sender.clone();
29066  24563   
                                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> };
       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> };
29068  24565   
                                    sender.send(()).await.expect("receiver dropped early");
29069  24566   
                                    result
29070  24567   
                                }
29071  24568   
                            })
29072  24569   
                            .build_unchecked();
29073  24570   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
29074  24571   
                .await
29075  24572   
                .expect("unable to make an HTTP request");
29076  24573   
            ::pretty_assertions::assert_eq!(
29077  24574   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
29078  24575   
                http_response.status()
29079  24576   
            );
29080  24577   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
29081  24578   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
29082  24579   
                http_response.headers(),
29083  24580   
                expected_headers,
29084  24581   
            ));
29085  24582   
        }
29086  24583   
    }
29087         -
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
29088         -
    /// Test ID: RestJsonQueryTimestampEpochRejectsMalformedValues_case5
       24584  +
    /// Malformed values in the path should be rejected
       24585  +
    /// Test ID: RestJsonPathIntegerMalformedValueRejected_case2
29089  24586   
    #[::tokio::test]
29090         -
    async fn rest_json_query_timestamp_epoch_rejects_malformed_values_case5_malformed_request() {
       24587  +
    #[::tracing_test::traced_test]
       24588  +
    async fn rest_json_path_integer_malformed_value_rejected_case2_malformed_request() {
29091  24589   
        {
29092  24590   
            #[allow(unused_mut)]
29093  24591   
            let mut http_request = http::Request::builder()
29094         -
                .uri("/MalformedTimestampQueryEpoch")
       24592  +
                .uri("/MalformedInteger/2ABC")
29095  24593   
                .method("POST")
29096  24594   
                .body(::aws_smithy_http_server::body::Body::empty())
29097  24595   
                .unwrap();
29098         -
            *http_request.uri_mut() = "/MalformedTimestampQueryEpoch?timestamp=-Infinity"
29099         -
                .parse()
29100         -
                .unwrap();
29101  24596   
            #[allow(unused_mut)]
29102  24597   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
29103  24598   
            let config = crate::service::RestJsonConfig::builder().build();
29104  24599   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
29105         -
                            .malformed_timestamp_query_epoch(move |input: crate::input::MalformedTimestampQueryEpochInput| {
       24600  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
29106  24601   
                                let sender = sender.clone();
29107  24602   
                                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> };
       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> };
29109  24604   
                                    sender.send(()).await.expect("receiver dropped early");
29110  24605   
                                    result
29111  24606   
                                }
29112  24607   
                            })
29113  24608   
                            .build_unchecked();
29114  24609   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
29115  24610   
                .await
29116  24611   
                .expect("unable to make an HTTP request");
29117  24612   
            ::pretty_assertions::assert_eq!(
29118  24613   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
29119  24614   
                http_response.status()
29120  24615   
            );
29121  24616   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
29122  24617   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
29123  24618   
                http_response.headers(),
29124  24619   
                expected_headers,
29125  24620   
            ));
29126  24621   
        }
29127  24622   
    }
29128         -
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
29129         -
    /// Test ID: RestJsonQueryTimestampEpochRejectsMalformedValues_case6
       24623  +
    /// Malformed values in the path should be rejected
       24624  +
    /// Test ID: RestJsonPathIntegerMalformedValueRejected_case3
29130  24625   
    #[::tokio::test]
29131         -
    async fn rest_json_query_timestamp_epoch_rejects_malformed_values_case6_malformed_request() {
       24626  +
    #[::tracing_test::traced_test]
       24627  +
    async fn rest_json_path_integer_malformed_value_rejected_case3_malformed_request() {
29132  24628   
        {
29133  24629   
            #[allow(unused_mut)]
29134  24630   
            let mut http_request = http::Request::builder()
29135         -
                .uri("/MalformedTimestampQueryEpoch")
       24631  +
                .uri("/MalformedInteger/0x42")
29136  24632   
                .method("POST")
29137  24633   
                .body(::aws_smithy_http_server::body::Body::empty())
29138  24634   
                .unwrap();
29139         -
            *http_request.uri_mut() = "/MalformedTimestampQueryEpoch?timestamp=NaN"
29140         -
                .parse()
29141         -
                .unwrap();
29142  24635   
            #[allow(unused_mut)]
29143  24636   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
29144  24637   
            let config = crate::service::RestJsonConfig::builder().build();
29145  24638   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
29146         -
                            .malformed_timestamp_query_epoch(move |input: crate::input::MalformedTimestampQueryEpochInput| {
       24639  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
29147  24640   
                                let sender = sender.clone();
29148  24641   
                                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> };
       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> };
29150  24643   
                                    sender.send(()).await.expect("receiver dropped early");
29151  24644   
                                    result
29152  24645   
                                }
29153  24646   
                            })
29154  24647   
                            .build_unchecked();
29155  24648   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
29156  24649   
                .await
29157  24650   
                .expect("unable to make an HTTP request");
29158  24651   
            ::pretty_assertions::assert_eq!(
29159  24652   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
29160  24653   
                http_response.status()
29161  24654   
            );
29162  24655   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
29163  24656   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
29164  24657   
                http_response.headers(),
29165  24658   
                expected_headers,
29166  24659   
            ));
29167  24660   
        }
29168  24661   
    }
29169         -
}
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
       24662  +
    /// Malformed values in the path should be rejected
       24663  +
    /// Test ID: RestJsonPathIntegerMalformedValueRejected_case4
29176  24664   
    #[::tokio::test]
29177         -
    async fn rest_json_query_timestamp_http_date_rejects_date_time_case0_malformed_request() {
       24665  +
    #[::tracing_test::traced_test]
       24666  +
    async fn rest_json_path_integer_malformed_value_rejected_case4_malformed_request() {
29178  24667   
        {
29179  24668   
            #[allow(unused_mut)]
29180  24669   
            let mut http_request = http::Request::builder()
29181         -
                .uri("/MalformedTimestampQueryHttpDate")
       24670  +
                .uri("/MalformedInteger/Infinity")
29182  24671   
                .method("POST")
29183  24672   
                .body(::aws_smithy_http_server::body::Body::empty())
29184  24673   
                .unwrap();
29185         -
            *http_request.uri_mut() =
29186         -
                "/MalformedTimestampQueryHttpDate?timestamp=1985-04-12T23%3A20%3A50.52Z"
29187         -
                    .parse()
29188         -
                    .unwrap();
29189  24674   
            #[allow(unused_mut)]
29190  24675   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
29191  24676   
            let config = crate::service::RestJsonConfig::builder().build();
29192  24677   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
29193         -
                            .malformed_timestamp_query_http_date(move |input: crate::input::MalformedTimestampQueryHttpDateInput| {
       24678  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
29194  24679   
                                let sender = sender.clone();
29195  24680   
                                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> };
       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> };
29197  24682   
                                    sender.send(()).await.expect("receiver dropped early");
29198  24683   
                                    result
29199  24684   
                                }
29200  24685   
                            })
29201  24686   
                            .build_unchecked();
29202  24687   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
29203  24688   
                .await
29204  24689   
                .expect("unable to make an HTTP request");
29205  24690   
            ::pretty_assertions::assert_eq!(
29206  24691   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
29207  24692   
                http_response.status()
29208  24693   
            );
29209  24694   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
29210  24695   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
29211  24696   
                http_response.headers(),
29212  24697   
                expected_headers,
29213  24698   
            ));
29214  24699   
        }
29215  24700   
    }
29216         -
    /// When the format is http-date, RFC3339 timestamps are rejected with a
29217         -
    /// 400 SerializationException
29218         -
    /// Test ID: RestJsonQueryTimestampHttpDateRejectsDateTime_case1
       24701  +
    /// Malformed values in the path should be rejected
       24702  +
    /// Test ID: RestJsonPathIntegerMalformedValueRejected_case5
29219  24703   
    #[::tokio::test]
29220         -
    async fn rest_json_query_timestamp_http_date_rejects_date_time_case1_malformed_request() {
       24704  +
    #[::tracing_test::traced_test]
       24705  +
    async fn rest_json_path_integer_malformed_value_rejected_case5_malformed_request() {
29221  24706   
        {
29222  24707   
            #[allow(unused_mut)]
29223  24708   
            let mut http_request = http::Request::builder()
29224         -
                .uri("/MalformedTimestampQueryHttpDate")
       24709  +
                .uri("/MalformedInteger/-Infinity")
29225  24710   
                .method("POST")
29226  24711   
                .body(::aws_smithy_http_server::body::Body::empty())
29227  24712   
                .unwrap();
29228         -
            *http_request.uri_mut() =
29229         -
                "/MalformedTimestampQueryHttpDate?timestamp=1985-04-12T23%3A20%3A50Z"
29230         -
                    .parse()
29231         -
                    .unwrap();
29232  24713   
            #[allow(unused_mut)]
29233  24714   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
29234  24715   
            let config = crate::service::RestJsonConfig::builder().build();
29235  24716   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
29236         -
                            .malformed_timestamp_query_http_date(move |input: crate::input::MalformedTimestampQueryHttpDateInput| {
       24717  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
29237  24718   
                                let sender = sender.clone();
29238  24719   
                                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> };
       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> };
29240  24721   
                                    sender.send(()).await.expect("receiver dropped early");
29241  24722   
                                    result
29242  24723   
                                }
29243  24724   
                            })
29244  24725   
                            .build_unchecked();
29245  24726   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
29246  24727   
                .await
29247  24728   
                .expect("unable to make an HTTP request");
29248  24729   
            ::pretty_assertions::assert_eq!(
29249  24730   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
29250  24731   
                http_response.status()
29251  24732   
            );
29252  24733   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
29253  24734   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
29254  24735   
                http_response.headers(),
29255  24736   
                expected_headers,
29256  24737   
            ));
29257  24738   
        }
29258  24739   
    }
29259         -
    /// When the format is http-date, RFC3339 timestamps are rejected with a
29260         -
    /// 400 SerializationException
29261         -
    /// Test ID: RestJsonQueryTimestampHttpDateRejectsDateTime_case2
       24740  +
    /// Malformed values in the path should be rejected
       24741  +
    /// Test ID: RestJsonPathIntegerMalformedValueRejected_case6
29262  24742   
    #[::tokio::test]
29263         -
    async fn rest_json_query_timestamp_http_date_rejects_date_time_case2_malformed_request() {
       24743  +
    #[::tracing_test::traced_test]
       24744  +
    async fn rest_json_path_integer_malformed_value_rejected_case6_malformed_request() {
29264  24745   
        {
29265  24746   
            #[allow(unused_mut)]
29266  24747   
            let mut http_request = http::Request::builder()
29267         -
                .uri("/MalformedTimestampQueryHttpDate")
       24748  +
                .uri("/MalformedInteger/NaN")
29268  24749   
                .method("POST")
29269  24750   
                .body(::aws_smithy_http_server::body::Body::empty())
29270  24751   
                .unwrap();
29271         -
            *http_request.uri_mut() =
29272         -
                "/MalformedTimestampQueryHttpDate?timestamp=1996-12-19T16%3A39%3A57-08%3A00"
29273         -
                    .parse()
29274         -
                    .unwrap();
29275  24752   
            #[allow(unused_mut)]
29276  24753   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
29277  24754   
            let config = crate::service::RestJsonConfig::builder().build();
29278  24755   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
29279         -
                            .malformed_timestamp_query_http_date(move |input: crate::input::MalformedTimestampQueryHttpDateInput| {
       24756  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
29280  24757   
                                let sender = sender.clone();
29281  24758   
                                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> };
       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> };
29283  24760   
                                    sender.send(()).await.expect("receiver dropped early");
29284  24761   
                                    result
29285  24762   
                                }
29286  24763   
                            })
29287  24764   
                            .build_unchecked();
29288  24765   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
29289  24766   
                .await
29290  24767   
                .expect("unable to make an HTTP request");
29291  24768   
            ::pretty_assertions::assert_eq!(
29292  24769   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
29293  24770   
                http_response.status()
29294  24771   
            );
29295  24772   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
29296  24773   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
29297  24774   
                http_response.headers(),
29298  24775   
                expected_headers,
29299  24776   
            ));
29300  24777   
        }
29301  24778   
    }
29302         -
    /// When the format is http-date, epoch second timestamps are rejected with a
29303         -
    /// 400 SerializationException
29304         -
    /// Test ID: RestJsonQueryTimestampHttpDateRejectsEpochSeconds_case0
       24779  +
    /// Malformed values in query parameters should be rejected
       24780  +
    /// Test ID: RestJsonQueryIntegerMalformedValueRejected_case0
29305  24781   
    #[::tokio::test]
29306         -
    async fn rest_json_query_timestamp_http_date_rejects_epoch_seconds_case0_malformed_request() {
       24782  +
    #[::tracing_test::traced_test]
       24783  +
    async fn rest_json_query_integer_malformed_value_rejected_case0_malformed_request() {
29307  24784   
        {
29308  24785   
            #[allow(unused_mut)]
29309  24786   
            let mut http_request = http::Request::builder()
29310         -
                .uri("/MalformedTimestampQueryHttpDate")
       24787  +
                .uri("/MalformedInteger/1")
29311  24788   
                .method("POST")
29312  24789   
                .body(::aws_smithy_http_server::body::Body::empty())
29313  24790   
                .unwrap();
29314         -
            *http_request.uri_mut() = "/MalformedTimestampQueryHttpDate?timestamp=1515531081.1234"
29315         -
                .parse()
29316         -
                .unwrap();
       24791  +
            *http_request.uri_mut() = "/MalformedInteger/1?integerInQuery=true".parse().unwrap();
29317  24792   
            #[allow(unused_mut)]
29318  24793   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
29319  24794   
            let config = crate::service::RestJsonConfig::builder().build();
29320  24795   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
29321         -
                            .malformed_timestamp_query_http_date(move |input: crate::input::MalformedTimestampQueryHttpDateInput| {
       24796  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
29322  24797   
                                let sender = sender.clone();
29323  24798   
                                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> };
       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> };
29325  24800   
                                    sender.send(()).await.expect("receiver dropped early");
29326  24801   
                                    result
29327  24802   
                                }
29328  24803   
                            })
29329  24804   
                            .build_unchecked();
29330  24805   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
29331  24806   
                .await
29332  24807   
                .expect("unable to make an HTTP request");
29333  24808   
            ::pretty_assertions::assert_eq!(
29334  24809   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
29335  24810   
                http_response.status()
29336  24811   
            );
29337  24812   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
29338  24813   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
29339  24814   
                http_response.headers(),
29340  24815   
                expected_headers,
29341  24816   
            ));
29342  24817   
        }
29343  24818   
    }
29344         -
    /// When the format is http-date, epoch second timestamps are rejected with a
29345         -
    /// 400 SerializationException
29346         -
    /// Test ID: RestJsonQueryTimestampHttpDateRejectsEpochSeconds_case1
       24819  +
    /// Malformed values in query parameters should be rejected
       24820  +
    /// Test ID: RestJsonQueryIntegerMalformedValueRejected_case1
29347  24821   
    #[::tokio::test]
29348         -
    async fn rest_json_query_timestamp_http_date_rejects_epoch_seconds_case1_malformed_request() {
       24822  +
    #[::tracing_test::traced_test]
       24823  +
    async fn rest_json_query_integer_malformed_value_rejected_case1_malformed_request() {
29349  24824   
        {
29350  24825   
            #[allow(unused_mut)]
29351  24826   
            let mut http_request = http::Request::builder()
29352         -
                .uri("/MalformedTimestampQueryHttpDate")
       24827  +
                .uri("/MalformedInteger/1")
29353  24828   
                .method("POST")
29354  24829   
                .body(::aws_smithy_http_server::body::Body::empty())
29355  24830   
                .unwrap();
29356         -
            *http_request.uri_mut() = "/MalformedTimestampQueryHttpDate?timestamp=1515531081"
29357         -
                .parse()
29358         -
                .unwrap();
       24831  +
            *http_request.uri_mut() = "/MalformedInteger/1?integerInQuery=1.001".parse().unwrap();
29359  24832   
            #[allow(unused_mut)]
29360  24833   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
29361  24834   
            let config = crate::service::RestJsonConfig::builder().build();
29362  24835   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
29363         -
                            .malformed_timestamp_query_http_date(move |input: crate::input::MalformedTimestampQueryHttpDateInput| {
       24836  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
29364  24837   
                                let sender = sender.clone();
29365  24838   
                                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> };
       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> };
29367  24840   
                                    sender.send(()).await.expect("receiver dropped early");
29368  24841   
                                    result
29369  24842   
                                }
29370  24843   
                            })
29371  24844   
                            .build_unchecked();
29372  24845   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
29373  24846   
                .await
29374  24847   
                .expect("unable to make an HTTP request");
29375  24848   
            ::pretty_assertions::assert_eq!(
29376  24849   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
29377  24850   
                http_response.status()
29378  24851   
            );
29379  24852   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
29380  24853   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
29381  24854   
                http_response.headers(),
29382  24855   
                expected_headers,
29383  24856   
            ));
29384  24857   
        }
29385  24858   
    }
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
       24859  +
    /// Malformed values in query parameters should be rejected
       24860  +
    /// Test ID: RestJsonQueryIntegerMalformedValueRejected_case2
29393  24861   
    #[::tokio::test]
29394         -
    async fn rest_json_malformed_union_multiple_fields_set_malformed_request() {
       24862  +
    #[::tracing_test::traced_test]
       24863  +
    async fn rest_json_query_integer_malformed_value_rejected_case2_malformed_request() {
29395  24864   
        {
29396  24865   
            #[allow(unused_mut)]
29397  24866   
            let mut http_request = http::Request::builder()
29398         -
                .uri("/MalformedUnion")
       24867  +
                .uri("/MalformedInteger/1")
29399  24868   
                .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         -
                ))
       24869  +
                .body(::aws_smithy_http_server::body::Body::empty())
29406  24870   
                .unwrap();
       24871  +
            *http_request.uri_mut() = "/MalformedInteger/1?integerInQuery=2ABC".parse().unwrap();
29407  24872   
            #[allow(unused_mut)]
29408  24873   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
29409  24874   
            let config = crate::service::RestJsonConfig::builder().build();
29410  24875   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
29411         -
                            .malformed_union(move |input: crate::input::MalformedUnionInput| {
       24876  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
29412  24877   
                                let sender = sender.clone();
29413  24878   
                                async move {
29414         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedUnionOutput };
       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> };
29415  24880   
                                    sender.send(()).await.expect("receiver dropped early");
29416  24881   
                                    result
29417  24882   
                                }
29418  24883   
                            })
29419  24884   
                            .build_unchecked();
29420  24885   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
29421  24886   
                .await
29422  24887   
                .expect("unable to make an HTTP request");
29423  24888   
            ::pretty_assertions::assert_eq!(
29424  24889   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
29425  24890   
                http_response.status()
29426  24891   
            );
29427  24892   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
29428  24893   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
29429  24894   
                http_response.headers(),
29430  24895   
                expected_headers,
29431  24896   
            ));
29432  24897   
        }
29433  24898   
    }
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
       24899  +
    /// Malformed values in query parameters should be rejected
       24900  +
    /// Test ID: RestJsonQueryIntegerMalformedValueRejected_case3
29437  24901   
    #[::tokio::test]
29438         -
    async fn rest_json_malformed_union_known_and_unknown_fields_set_malformed_request() {
       24902  +
    #[::tracing_test::traced_test]
       24903  +
    async fn rest_json_query_integer_malformed_value_rejected_case3_malformed_request() {
29439  24904   
        {
29440  24905   
            #[allow(unused_mut)]
29441  24906   
            let mut http_request = http::Request::builder()
29442         -
                .uri("/MalformedUnion")
       24907  +
                .uri("/MalformedInteger/1")
29443  24908   
                .method("POST")
29444         -
                .header("content-type", "application/json")
29445         -
                .body(::aws_smithy_http_server::body::Body::from(
29446         -
                    ::bytes::Bytes::from_static(
29447         -
                        "{ \"union\" : { \"int\": 2, \"unknownField\": \"three\" } }".as_bytes(),
29448         -
                    ),
29449         -
                ))
       24909  +
                .body(::aws_smithy_http_server::body::Body::empty())
29450  24910   
                .unwrap();
       24911  +
            *http_request.uri_mut() = "/MalformedInteger/1?integerInQuery=0x42".parse().unwrap();
29451  24912   
            #[allow(unused_mut)]
29452  24913   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
29453  24914   
            let config = crate::service::RestJsonConfig::builder().build();
29454  24915   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
29455         -
                            .malformed_union(move |input: crate::input::MalformedUnionInput| {
       24916  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
29456  24917   
                                let sender = sender.clone();
29457  24918   
                                async move {
29458         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedUnionOutput };
       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> };
29459  24920   
                                    sender.send(()).await.expect("receiver dropped early");
29460  24921   
                                    result
29461  24922   
                                }
29462  24923   
                            })
29463  24924   
                            .build_unchecked();
29464  24925   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
29465  24926   
                .await
29466  24927   
                .expect("unable to make an HTTP request");
29467  24928   
            ::pretty_assertions::assert_eq!(
29468  24929   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
29469  24930   
                http_response.status()
29470  24931   
            );
29471  24932   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
29472  24933   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
29473  24934   
                http_response.headers(),
29474  24935   
                expected_headers,
29475  24936   
            ));
29476  24937   
        }
29477  24938   
    }
29478         -
    /// When the union has no fields set, the response should be a 400
29479         -
    /// SerializationException.
29480         -
    /// Test ID: RestJsonMalformedUnionNoFieldsSet
       24939  +
    /// Malformed values in query parameters should be rejected
       24940  +
    /// Test ID: RestJsonQueryIntegerMalformedValueRejected_case4
29481  24941   
    #[::tokio::test]
29482         -
    async fn rest_json_malformed_union_no_fields_set_malformed_request() {
       24942  +
    #[::tracing_test::traced_test]
       24943  +
    async fn rest_json_query_integer_malformed_value_rejected_case4_malformed_request() {
29483  24944   
        {
29484  24945   
            #[allow(unused_mut)]
29485  24946   
            let mut http_request = http::Request::builder()
29486         -
                .uri("/MalformedUnion")
       24947  +
                .uri("/MalformedInteger/1")
29487  24948   
                .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         -
                ))
       24949  +
                .body(::aws_smithy_http_server::body::Body::empty())
       24950  +
                .unwrap();
       24951  +
            *http_request.uri_mut() = "/MalformedInteger/1?integerInQuery=Infinity"
       24952  +
                .parse()
29492  24953   
                .unwrap();
29493  24954   
            #[allow(unused_mut)]
29494  24955   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
29495  24956   
            let config = crate::service::RestJsonConfig::builder().build();
29496  24957   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
29497         -
                            .malformed_union(move |input: crate::input::MalformedUnionInput| {
       24958  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
29498  24959   
                                let sender = sender.clone();
29499  24960   
                                async move {
29500         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedUnionOutput };
       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> };
29501  24962   
                                    sender.send(()).await.expect("receiver dropped early");
29502  24963   
                                    result
29503  24964   
                                }
29504  24965   
                            })
29505  24966   
                            .build_unchecked();
29506  24967   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
29507  24968   
                .await
29508  24969   
                .expect("unable to make an HTTP request");
29509  24970   
            ::pretty_assertions::assert_eq!(
29510  24971   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
29511  24972   
                http_response.status()
29512  24973   
            );
29513  24974   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
29514  24975   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
29515  24976   
                http_response.headers(),
29516  24977   
                expected_headers,
29517  24978   
            ));
29518  24979   
        }
29519  24980   
    }
29520         -
    /// When the union value is actually an array, the response should be a 400
29521         -
    /// SerializationException.
29522         -
    /// Test ID: RestJsonMalformedUnionValueIsArray
       24981  +
    /// Malformed values in query parameters should be rejected
       24982  +
    /// Test ID: RestJsonQueryIntegerMalformedValueRejected_case5
29523  24983   
    #[::tokio::test]
29524         -
    async fn rest_json_malformed_union_value_is_array_malformed_request() {
       24984  +
    #[::tracing_test::traced_test]
       24985  +
    async fn rest_json_query_integer_malformed_value_rejected_case5_malformed_request() {
29525  24986   
        {
29526  24987   
            #[allow(unused_mut)]
29527  24988   
            let mut http_request = http::Request::builder()
29528         -
                .uri("/MalformedUnion")
       24989  +
                .uri("/MalformedInteger/1")
29529  24990   
                .method("POST")
29530         -
                .header("content-type", "application/json")
29531         -
                .body(::aws_smithy_http_server::body::Body::from(
29532         -
                    ::bytes::Bytes::from_static("{ \"union\" : [\"int\"] }".as_bytes()),
29533         -
                ))
       24991  +
                .body(::aws_smithy_http_server::body::Body::empty())
       24992  +
                .unwrap();
       24993  +
            *http_request.uri_mut() = "/MalformedInteger/1?integerInQuery=-Infinity"
       24994  +
                .parse()
29534  24995   
                .unwrap();
29535  24996   
            #[allow(unused_mut)]
29536  24997   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
29537  24998   
            let config = crate::service::RestJsonConfig::builder().build();
29538  24999   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
29539         -
                            .malformed_union(move |input: crate::input::MalformedUnionInput| {
       25000  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
29540  25001   
                                let sender = sender.clone();
29541  25002   
                                async move {
29542         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedUnionOutput };
       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> };
29543  25004   
                                    sender.send(()).await.expect("receiver dropped early");
29544  25005   
                                    result
29545  25006   
                                }
29546  25007   
                            })
29547  25008   
                            .build_unchecked();
29548  25009   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
29549  25010   
                .await
29550  25011   
                .expect("unable to make an HTTP request");
29551  25012   
            ::pretty_assertions::assert_eq!(
29552  25013   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
29553  25014   
                http_response.status()
29554  25015   
            );
29555  25016   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
29556  25017   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
29557  25018   
                http_response.headers(),
29558  25019   
                expected_headers,
29559  25020   
            ));
29560  25021   
        }
29561  25022   
    }
29562         -
    /// When an unknown union member is received, the response should be a 400
29563         -
    /// SerializationException.
29564         -
    /// Test ID: RestJsonMalformedUnionUnknownMember
       25023  +
    /// Malformed values in query parameters should be rejected
       25024  +
    /// Test ID: RestJsonQueryIntegerMalformedValueRejected_case6
29565  25025   
    #[::tokio::test]
29566         -
    async fn rest_json_malformed_union_unknown_member_malformed_request() {
       25026  +
    #[::tracing_test::traced_test]
       25027  +
    async fn rest_json_query_integer_malformed_value_rejected_case6_malformed_request() {
29567  25028   
        {
29568  25029   
            #[allow(unused_mut)]
29569  25030   
            let mut http_request = http::Request::builder()
29570         -
                .uri("/MalformedUnion")
       25031  +
                .uri("/MalformedInteger/1")
29571  25032   
                .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         -
                ))
       25033  +
                .body(::aws_smithy_http_server::body::Body::empty())
29578  25034   
                .unwrap();
       25035  +
            *http_request.uri_mut() = "/MalformedInteger/1?integerInQuery=NaN".parse().unwrap();
29579  25036   
            #[allow(unused_mut)]
29580  25037   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
29581  25038   
            let config = crate::service::RestJsonConfig::builder().build();
29582  25039   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
29583         -
                            .malformed_union(move |input: crate::input::MalformedUnionInput| {
       25040  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
29584  25041   
                                let sender = sender.clone();
29585  25042   
                                async move {
29586         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedUnionOutput };
       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> };
29587  25044   
                                    sender.send(()).await.expect("receiver dropped early");
29588  25045   
                                    result
29589  25046   
                                }
29590  25047   
                            })
29591  25048   
                            .build_unchecked();
29592  25049   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
29593  25050   
                .await
29594  25051   
                .expect("unable to make an HTTP request");
29595  25052   
            ::pretty_assertions::assert_eq!(
29596  25053   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
29597  25054   
                http_response.status()
29598  25055   
            );
29599  25056   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
29600  25057   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
29601  25058   
                http_response.headers(),
29602  25059   
                expected_headers,
29603  25060   
            ));
29604  25061   
        }
29605  25062   
    }
29606         -
}
29607         -
#[cfg(test)]
29608         -
#[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
29612         -
    #[::tokio::test]
29613         -
    async fn media_type_header_input_base64_request() {
29614         -
        #[allow(unused_mut)]
29615         -
        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();
29623         -
        #[allow(unused_mut)]
29624         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
29625         -
        let config = crate::service::RestJsonConfig::builder().build();
29626         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
29627         -
            .media_type_header(move |input: crate::input::MediaTypeHeaderInput| {
29628         -
                let sender = sender.clone();
29629         -
                async move {
29630         -
                    let result = {
29631         -
                        let expected = crate::input::MediaTypeHeaderInput {
29632         -
                            json: ::std::option::Option::Some("true".to_owned()),
29633         -
                        };
29634         -
                        ::pretty_assertions::assert_eq!(input, expected);
29635         -
                        let response = crate::output::MediaTypeHeaderOutput {
29636         -
                            json: ::std::option::Option::None,
29637         -
                        };
29638         -
                        response
29639         -
                    };
29640         -
                    sender.send(()).await.expect("receiver dropped early");
29641         -
                    result
29642         -
                }
29643         -
            })
29644         -
            .build_unchecked();
29645         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
29646         -
            .await
29647         -
            .expect("unable to make an HTTP request");
29648         -
        assert!(receiver.recv().await.is_some());
29649         -
    }
29650         -
    /// Headers that target strings with a mediaType are base64 encoded
29651         -
    /// Test ID: MediaTypeHeaderOutputBase64
29652         -
    #[::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()),
29656         -
        };
29657         -
        use ::aws_smithy_http_server::response::IntoResponse;
29658         -
        let http_response = output.into_response();
29659         -
        ::pretty_assertions::assert_eq!(
29660         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
29661         -
            http_response.status()
29662         -
        );
29663         -
        let expected_headers = [("X-Json", "dHJ1ZQ==")];
29664         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
29665         -
            http_response.headers(),
29666         -
            expected_headers,
29667         -
        ));
29668         -
    }
29669         -
}
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
29702         -
                }
29703         -
            })
29704         -
            .build_unchecked();
29705         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
29706         -
            .await
29707         -
            .expect("unable to make an HTTP request");
29708         -
        assert!(receiver.recv().await.is_some());
29709         -
    }
29710         -
    /// Servers should allow the accept header to be set to the
29711         -
    /// default content-type.
29712         -
    /// Test ID: RestJsonNoInputAllowsAccept
29713         -
    #[::tokio::test]
29714         -
    async fn rest_json_no_input_allows_accept_request() {
29715         -
        #[allow(unused_mut)]
29716         -
        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();
29724         -
        #[allow(unused_mut)]
29725         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
29726         -
        let config = crate::service::RestJsonConfig::builder().build();
29727         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
29728         -
            .no_input_and_no_output(move |input: crate::input::NoInputAndNoOutputInput| {
29729         -
                let sender = sender.clone();
29730         -
                async move {
29731         -
                    let result = {
29732         -
                        let expected = crate::input::NoInputAndNoOutputInput {};
29733         -
                        ::pretty_assertions::assert_eq!(input, expected);
29734         -
                        let response = crate::output::NoInputAndNoOutputOutput {};
29735         -
                        response
29736         -
                    };
29737         -
                    sender.send(()).await.expect("receiver dropped early");
29738         -
                    result
29739         -
                }
29740         -
            })
29741         -
            .build_unchecked();
29742         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
29743         -
            .await
29744         -
            .expect("unable to make an HTTP request");
29745         -
        assert!(receiver.recv().await.is_some());
29746         -
    }
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
29751         -
    #[::tokio::test]
29752         -
    async fn rest_json_no_input_and_no_output_response() {
29753         -
        let output = crate::output::NoInputAndNoOutputOutput {};
29754         -
        use ::aws_smithy_http_server::response::IntoResponse;
29755         -
        let http_response = output.into_response();
29756         -
        ::pretty_assertions::assert_eq!(
29757         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
29758         -
            http_response.status()
29759         -
        );
29760         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
29761         -
            .await
29762         -
            .expect("unable to extract body to bytes");
29763         -
        // No body.
29764         -
        ::pretty_assertions::assert_eq!(std::str::from_utf8(&body).unwrap(), "");
29765         -
    }
29766         -
}
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
29799         -
                }
29800         -
            })
29801         -
            .build_unchecked();
29802         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
29803         -
            .await
29804         -
            .expect("unable to make an HTTP request");
29805         -
        assert!(receiver.recv().await.is_some());
29806         -
    }
29807         -
    /// Servers should allow the accept header to be set to the
29808         -
    /// default content-type.
29809         -
    /// Test ID: RestJsonNoInputAndOutputAllowsAccept
29810         -
    #[::tokio::test]
29811         -
    async fn rest_json_no_input_and_output_allows_accept_request() {
29812         -
        #[allow(unused_mut)]
29813         -
        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();
29821         -
        #[allow(unused_mut)]
29822         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
29823         -
        let config = crate::service::RestJsonConfig::builder().build();
29824         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
29825         -
            .no_input_and_output(move |input: crate::input::NoInputAndOutputInput| {
29826         -
                let sender = sender.clone();
29827         -
                async move {
29828         -
                    let result = {
29829         -
                        let expected = crate::input::NoInputAndOutputInput {};
29830         -
                        ::pretty_assertions::assert_eq!(input, expected);
29831         -
                        let response = crate::output::NoInputAndOutputOutput {};
29832         -
                        response
29833         -
                    };
29834         -
                    sender.send(()).await.expect("receiver dropped early");
29835         -
                    result
29836         -
                }
29837         -
            })
29838         -
            .build_unchecked();
29839         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
29840         -
            .await
29841         -
            .expect("unable to make an HTTP request");
29842         -
        assert!(receiver.recv().await.is_some());
29843         -
    }
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
29847         -
    #[::tokio::test]
29848         -
    async fn rest_json_no_input_and_output_with_json_response() {
29849         -
        let output = crate::output::NoInputAndOutputOutput {};
29850         -
        use ::aws_smithy_http_server::response::IntoResponse;
29851         -
        let http_response = output.into_response();
29852         -
        ::pretty_assertions::assert_eq!(
29853         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
29854         -
            http_response.status()
29855         -
        );
29856         -
        let expected_headers = [("Content-Type", "application/json")];
29857         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
29858         -
            http_response.headers(),
29859         -
            expected_headers,
29860         -
        ));
29861         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
29862         -
            .await
29863         -
            .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         -
        ));
29869         -
    }
29870         -
}
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![]),
29882         -
        };
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()
29888         -
        );
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         -
        ));
29894         -
    }
29895         -
}
29896         -
#[cfg(test)]
29897         -
#[allow(unreachable_code, unused_variables)]
29898         -
mod server_omits_null_serializes_empty_string_test {
29899         -
    /// Serializes empty query strings
29900         -
    /// Test ID: RestJsonSerializesEmptyQueryValue
29901         -
    #[::tokio::test]
29902         -
    async fn rest_json_serializes_empty_query_value_request() {
29903         -
        #[allow(unused_mut)]
29904         -
        let mut http_request = http::Request::builder()
29905         -
            .uri("/OmitsNullSerializesEmptyString")
29906         -
            .method("GET")
29907         -
            .body(::aws_smithy_http_server::body::Body::from(
29908         -
                ::bytes::Bytes::from_static("".as_bytes()),
29909         -
            ))
29910         -
            .unwrap();
29911         -
        *http_request.uri_mut() = "/OmitsNullSerializesEmptyString?Empty=".parse().unwrap();
29912         -
        #[allow(unused_mut)]
29913         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
29914         -
        let config = crate::service::RestJsonConfig::builder().build();
29915         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
29916         -
            .omits_null_serializes_empty_string(
29917         -
                move |input: crate::input::OmitsNullSerializesEmptyStringInput| {
29918         -
                    let sender = sender.clone();
29919         -
                    async move {
29920         -
                        let result = {
29921         -
                            let expected = crate::input::OmitsNullSerializesEmptyStringInput {
29922         -
                                empty_string: ::std::option::Option::Some("".to_owned()),
29923         -
                                null_value: ::std::option::Option::None,
29924         -
                            };
29925         -
                            ::pretty_assertions::assert_eq!(input, expected);
29926         -
                            let response = crate::output::OmitsNullSerializesEmptyStringOutput {};
29927         -
                            response
29928         -
                        };
29929         -
                        sender.send(()).await.expect("receiver dropped early");
29930         -
                        result
29931         -
                    }
29932         -
                },
29933         -
            )
29934         -
            .build_unchecked();
29935         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
29936         -
            .await
29937         -
            .expect("unable to make an HTTP request");
29938         -
        assert!(receiver.recv().await.is_some());
29939         -
    }
29940         -
    /// Servers accept static query params as empty strings.
29941         -
    /// Test ID: RestJsonServersAcceptStaticQueryParamAsEmptyString
       25063  +
    /// Malformed values in headers should be rejected
       25064  +
    /// Test ID: RestJsonHeaderIntegerMalformedValueRejected_case0
29942  25065   
    #[::tokio::test]
29943         -
    async fn rest_json_servers_accept_static_query_param_as_empty_string_request() {
29944         -
        #[allow(unused_mut)]
29945         -
        let mut http_request = http::Request::builder()
29946         -
            .uri("/OmitsNullSerializesEmptyString")
29947         -
            .method("GET")
29948         -
            .body(::aws_smithy_http_server::body::Body::from(
29949         -
                ::bytes::Bytes::from_static("".as_bytes()),
29950         -
            ))
29951         -
            .unwrap();
29952         -
        *http_request.uri_mut() = "/OmitsNullSerializesEmptyString?Empty".parse().unwrap();
29953         -
        #[allow(unused_mut)]
29954         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
29955         -
        let config = crate::service::RestJsonConfig::builder().build();
29956         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
29957         -
            .omits_null_serializes_empty_string(
29958         -
                move |input: crate::input::OmitsNullSerializesEmptyStringInput| {
29959         -
                    let sender = sender.clone();
29960         -
                    async move {
29961         -
                        let result = {
29962         -
                            let expected = crate::input::OmitsNullSerializesEmptyStringInput {
29963         -
                                empty_string: ::std::option::Option::Some("".to_owned()),
29964         -
                                null_value: ::std::option::Option::None,
29965         -
                            };
29966         -
                            ::pretty_assertions::assert_eq!(input, expected);
29967         -
                            let response = crate::output::OmitsNullSerializesEmptyStringOutput {};
29968         -
                            response
29969         -
                        };
29970         -
                        sender.send(()).await.expect("receiver dropped early");
29971         -
                        result
29972         -
                    }
29973         -
                },
29974         -
            )
29975         -
            .build_unchecked();
29976         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
29977         -
            .await
29978         -
            .expect("unable to make an HTTP request");
29979         -
        assert!(receiver.recv().await.is_some());
       25066  +
    #[::tracing_test::traced_test]
       25067  +
    async fn rest_json_header_integer_malformed_value_rejected_case0_malformed_request() {
       25068  +
        {
       25069  +
            #[allow(unused_mut)]
       25070  +
            let mut http_request = http::Request::builder()
       25071  +
                .uri("/MalformedInteger/1")
       25072  +
                .method("POST")
       25073  +
                .header("integerInHeader", "true")
       25074  +
                .body(::aws_smithy_http_server::body::Body::empty())
       25075  +
                .unwrap();
       25076  +
            #[allow(unused_mut)]
       25077  +
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       25078  +
            let config = crate::service::RestJsonConfig::builder().build();
       25079  +
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       25080  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       25081  +
                                let sender = sender.clone();
       25082  +
                                async move {
       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> };
       25084  +
                                    sender.send(()).await.expect("receiver dropped early");
       25085  +
                                    result
       25086  +
                                }
       25087  +
                            })
       25088  +
                            .build_unchecked();
       25089  +
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       25090  +
                .await
       25091  +
                .expect("unable to make an HTTP request");
       25092  +
            ::pretty_assertions::assert_eq!(
       25093  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
       25094  +
                http_response.status()
       25095  +
            );
       25096  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
       25097  +
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       25098  +
                http_response.headers(),
       25099  +
                expected_headers,
       25100  +
            ));
       25101  +
        }
29980  25102   
    }
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
       25103  +
    /// Malformed values in headers should be rejected
       25104  +
    /// Test ID: RestJsonHeaderIntegerMalformedValueRejected_case1
29987  25105   
    #[::tokio::test]
29988         -
    #[should_panic]
29989         -
    async fn rest_json_omits_empty_list_query_values_request() {
29990         -
        #[allow(unused_mut)]
29991         -
        let mut http_request = http::Request::builder()
29992         -
            .uri("/OmitsSerializingEmptyLists")
29993         -
            .method("POST")
29994         -
            .body(::aws_smithy_http_server::body::Body::from(
29995         -
                ::bytes::Bytes::from_static("".as_bytes()),
29996         -
            ))
29997         -
            .unwrap();
29998         -
        #[allow(unused_mut)]
29999         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
30000         -
        let config = crate::service::RestJsonConfig::builder().build();
30001         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
30002         -
            .omits_serializing_empty_lists(
30003         -
                move |input: crate::input::OmitsSerializingEmptyListsInput| {
30004         -
                    let sender = sender.clone();
30005         -
                    async move {
30006         -
                        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![]),
30015         -
                            };
30016         -
                            ::pretty_assertions::assert_eq!(input, expected);
30017         -
                            let response = crate::output::OmitsSerializingEmptyListsOutput {};
30018         -
                            Ok(response)
30019         -
                        };
30020         -
                        sender.send(()).await.expect("receiver dropped early");
30021         -
                        result
30022         -
                    }
30023         -
                },
30024         -
            )
30025         -
            .build_unchecked();
30026         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
30027         -
            .await
30028         -
            .expect("unable to make an HTTP request");
30029         -
        assert!(receiver.recv().await.is_some());
       25106  +
    #[::tracing_test::traced_test]
       25107  +
    async fn rest_json_header_integer_malformed_value_rejected_case1_malformed_request() {
       25108  +
        {
       25109  +
            #[allow(unused_mut)]
       25110  +
            let mut http_request = http::Request::builder()
       25111  +
                .uri("/MalformedInteger/1")
       25112  +
                .method("POST")
       25113  +
                .header("integerInHeader", "1.001")
       25114  +
                .body(::aws_smithy_http_server::body::Body::empty())
       25115  +
                .unwrap();
       25116  +
            #[allow(unused_mut)]
       25117  +
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       25118  +
            let config = crate::service::RestJsonConfig::builder().build();
       25119  +
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       25120  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       25121  +
                                let sender = sender.clone();
       25122  +
                                async move {
       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> };
       25124  +
                                    sender.send(()).await.expect("receiver dropped early");
       25125  +
                                    result
       25126  +
                                }
       25127  +
                            })
       25128  +
                            .build_unchecked();
       25129  +
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       25130  +
                .await
       25131  +
                .expect("unable to make an HTTP request");
       25132  +
            ::pretty_assertions::assert_eq!(
       25133  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
       25134  +
                http_response.status()
       25135  +
            );
       25136  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
       25137  +
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       25138  +
                http_response.headers(),
       25139  +
                expected_headers,
       25140  +
            ));
       25141  +
        }
30030  25142   
    }
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
       25143  +
    /// Malformed values in headers should be rejected
       25144  +
    /// Test ID: RestJsonHeaderIntegerMalformedValueRejected_case2
30037  25145   
    #[::tokio::test]
30038         -
    async fn rest_json_input_union_with_unit_member_request() {
30039         -
        #[allow(unused_mut)]
30040         -
        let mut http_request = http::Request::builder()
30041         -
            .uri("/PostPlayerAction")
30042         -
            .method("POST")
30043         -
            .header("Content-Type", "application/json")
30044         -
            .body(::aws_smithy_http_server::body::Body::from(
30045         -
                ::bytes::Bytes::from_static(
30046         -
                    "{\n    \"action\": {\n        \"quit\": {}\n    }\n}".as_bytes(),
30047         -
                ),
30048         -
            ))
30049         -
            .unwrap();
30050         -
        #[allow(unused_mut)]
30051         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
30052         -
        let config = crate::service::RestJsonConfig::builder().build();
30053         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
30054         -
            .post_player_action(move |input: crate::input::PostPlayerActionInput| {
30055         -
                let sender = sender.clone();
30056         -
                async move {
30057         -
                    let result = {
30058         -
                        let expected = crate::input::PostPlayerActionInput {
30059         -
                            action: ::std::option::Option::Some(crate::model::PlayerAction::Quit),
30060         -
                        };
30061         -
                        ::pretty_assertions::assert_eq!(input, expected);
30062         -
                        let response = crate::output::PostPlayerActionOutput {
30063         -
                            action: crate::model::PlayerAction::Quit,
30064         -
                        };
30065         -
                        response
30066         -
                    };
30067         -
                    sender.send(()).await.expect("receiver dropped early");
30068         -
                    result
30069         -
                }
30070         -
            })
30071         -
            .build_unchecked();
30072         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
30073         -
            .await
30074         -
            .expect("unable to make an HTTP request");
30075         -
        assert!(receiver.recv().await.is_some());
       25146  +
    #[::tracing_test::traced_test]
       25147  +
    async fn rest_json_header_integer_malformed_value_rejected_case2_malformed_request() {
       25148  +
        {
       25149  +
            #[allow(unused_mut)]
       25150  +
            let mut http_request = http::Request::builder()
       25151  +
                .uri("/MalformedInteger/1")
       25152  +
                .method("POST")
       25153  +
                .header("integerInHeader", "2ABC")
       25154  +
                .body(::aws_smithy_http_server::body::Body::empty())
       25155  +
                .unwrap();
       25156  +
            #[allow(unused_mut)]
       25157  +
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       25158  +
            let config = crate::service::RestJsonConfig::builder().build();
       25159  +
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       25160  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       25161  +
                                let sender = sender.clone();
       25162  +
                                async move {
       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> };
       25164  +
                                    sender.send(()).await.expect("receiver dropped early");
       25165  +
                                    result
       25166  +
                                }
       25167  +
                            })
       25168  +
                            .build_unchecked();
       25169  +
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       25170  +
                .await
       25171  +
                .expect("unable to make an HTTP request");
       25172  +
            ::pretty_assertions::assert_eq!(
       25173  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
       25174  +
                http_response.status()
       25175  +
            );
       25176  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
       25177  +
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       25178  +
                http_response.headers(),
       25179  +
                expected_headers,
       25180  +
            ));
       25181  +
        }
30076  25182   
    }
30077         -
    /// Unit types in unions are serialized like normal structures in responses.
30078         -
    /// Test ID: RestJsonOutputUnionWithUnitMember
       25183  +
    /// Malformed values in headers should be rejected
       25184  +
    /// Test ID: RestJsonHeaderIntegerMalformedValueRejected_case3
30079  25185   
    #[::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()
30089         -
        );
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         -
        ));
       25186  +
    #[::tracing_test::traced_test]
       25187  +
    async fn rest_json_header_integer_malformed_value_rejected_case3_malformed_request() {
       25188  +
        {
       25189  +
            #[allow(unused_mut)]
       25190  +
            let mut http_request = http::Request::builder()
       25191  +
                .uri("/MalformedInteger/1")
       25192  +
                .method("POST")
       25193  +
                .header("integerInHeader", "0x42")
       25194  +
                .body(::aws_smithy_http_server::body::Body::empty())
       25195  +
                .unwrap();
       25196  +
            #[allow(unused_mut)]
       25197  +
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       25198  +
            let config = crate::service::RestJsonConfig::builder().build();
       25199  +
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       25200  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       25201  +
                                let sender = sender.clone();
       25202  +
                                async move {
       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> };
       25204  +
                                    sender.send(()).await.expect("receiver dropped early");
       25205  +
                                    result
       25206  +
                                }
       25207  +
                            })
       25208  +
                            .build_unchecked();
       25209  +
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       25210  +
                .await
       25211  +
                .expect("unable to make an HTTP request");
       25212  +
            ::pretty_assertions::assert_eq!(
       25213  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
       25214  +
                http_response.status()
       25215  +
            );
       25216  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
       25217  +
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       25218  +
                http_response.headers(),
       25219  +
                expected_headers,
       25220  +
            ));
       25221  +
        }
30103  25222   
    }
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
       25223  +
    /// Malformed values in headers should be rejected
       25224  +
    /// Test ID: RestJsonHeaderIntegerMalformedValueRejected_case4
30110  25225   
    #[::tokio::test]
30111         -
    async fn post_union_with_json_name_request1_request() {
30112         -
        #[allow(unused_mut)]
30113         -
        let mut http_request = http::Request::builder()
30114         -
            .uri("/PostUnionWithJsonName")
30115         -
            .method("POST")
30116         -
            .header("Content-Type", "application/json")
30117         -
            .body(::aws_smithy_http_server::body::Body::from(
30118         -
                ::bytes::Bytes::from_static(
30119         -
                    "{\n    \"value\": {\n        \"FOO\": \"hi\"\n    }\n}".as_bytes(),
30120         -
                ),
30121         -
            ))
30122         -
            .unwrap();
30123         -
        #[allow(unused_mut)]
30124         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
30125         -
        let config = crate::service::RestJsonConfig::builder().build();
30126         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
30127         -
            .post_union_with_json_name(move |input: crate::input::PostUnionWithJsonNameInput| {
30128         -
                let sender = sender.clone();
30129         -
                async move {
30130         -
                    let result = {
30131         -
                        let expected = crate::input::PostUnionWithJsonNameInput {
30132         -
                            value: ::std::option::Option::Some(
30133         -
                                crate::model::UnionWithJsonName::Foo("hi".to_owned()),
30134         -
                            ),
30135         -
                        };
30136         -
                        ::pretty_assertions::assert_eq!(input, expected);
30137         -
                        let response = crate::output::PostUnionWithJsonNameOutput {
30138         -
                            value: crate::model::UnionWithJsonName::Foo("".to_owned()),
30139         -
                        };
30140         -
                        response
30141         -
                    };
30142         -
                    sender.send(()).await.expect("receiver dropped early");
30143         -
                    result
30144         -
                }
30145         -
            })
30146         -
            .build_unchecked();
30147         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
30148         -
            .await
30149         -
            .expect("unable to make an HTTP request");
30150         -
        assert!(receiver.recv().await.is_some());
       25226  +
    #[::tracing_test::traced_test]
       25227  +
    async fn rest_json_header_integer_malformed_value_rejected_case4_malformed_request() {
       25228  +
        {
       25229  +
            #[allow(unused_mut)]
       25230  +
            let mut http_request = http::Request::builder()
       25231  +
                .uri("/MalformedInteger/1")
       25232  +
                .method("POST")
       25233  +
                .header("integerInHeader", "Infinity")
       25234  +
                .body(::aws_smithy_http_server::body::Body::empty())
       25235  +
                .unwrap();
       25236  +
            #[allow(unused_mut)]
       25237  +
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       25238  +
            let config = crate::service::RestJsonConfig::builder().build();
       25239  +
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       25240  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       25241  +
                                let sender = sender.clone();
       25242  +
                                async move {
       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> };
       25244  +
                                    sender.send(()).await.expect("receiver dropped early");
       25245  +
                                    result
       25246  +
                                }
       25247  +
                            })
       25248  +
                            .build_unchecked();
       25249  +
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       25250  +
                .await
       25251  +
                .expect("unable to make an HTTP request");
       25252  +
            ::pretty_assertions::assert_eq!(
       25253  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
       25254  +
                http_response.status()
       25255  +
            );
       25256  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
       25257  +
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       25258  +
                http_response.headers(),
       25259  +
                expected_headers,
       25260  +
            ));
       25261  +
        }
30151  25262   
    }
30152         -
    /// Tests that jsonName works with union members.
30153         -
    /// Test ID: PostUnionWithJsonNameRequest2
       25263  +
    /// Malformed values in headers should be rejected
       25264  +
    /// Test ID: RestJsonHeaderIntegerMalformedValueRejected_case5
30154  25265   
    #[::tokio::test]
30155         -
    async fn post_union_with_json_name_request2_request() {
30156         -
        #[allow(unused_mut)]
30157         -
        let mut http_request = http::Request::builder()
30158         -
            .uri("/PostUnionWithJsonName")
30159         -
            .method("POST")
30160         -
            .header("Content-Type", "application/json")
30161         -
            .body(::aws_smithy_http_server::body::Body::from(
30162         -
                ::bytes::Bytes::from_static(
30163         -
                    "{\n    \"value\": {\n        \"_baz\": \"hi\"\n    }\n}".as_bytes(),
30164         -
                ),
30165         -
            ))
30166         -
            .unwrap();
30167         -
        #[allow(unused_mut)]
30168         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
30169         -
        let config = crate::service::RestJsonConfig::builder().build();
30170         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
30171         -
            .post_union_with_json_name(move |input: crate::input::PostUnionWithJsonNameInput| {
30172         -
                let sender = sender.clone();
30173         -
                async move {
30174         -
                    let result = {
30175         -
                        let expected = crate::input::PostUnionWithJsonNameInput {
30176         -
                            value: ::std::option::Option::Some(
30177         -
                                crate::model::UnionWithJsonName::Baz("hi".to_owned()),
30178         -
                            ),
30179         -
                        };
30180         -
                        ::pretty_assertions::assert_eq!(input, expected);
30181         -
                        let response = crate::output::PostUnionWithJsonNameOutput {
30182         -
                            value: crate::model::UnionWithJsonName::Foo("".to_owned()),
30183         -
                        };
30184         -
                        response
30185         -
                    };
30186         -
                    sender.send(()).await.expect("receiver dropped early");
30187         -
                    result
30188         -
                }
30189         -
            })
30190         -
            .build_unchecked();
30191         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
30192         -
            .await
30193         -
            .expect("unable to make an HTTP request");
30194         -
        assert!(receiver.recv().await.is_some());
       25266  +
    #[::tracing_test::traced_test]
       25267  +
    async fn rest_json_header_integer_malformed_value_rejected_case5_malformed_request() {
       25268  +
        {
       25269  +
            #[allow(unused_mut)]
       25270  +
            let mut http_request = http::Request::builder()
       25271  +
                .uri("/MalformedInteger/1")
       25272  +
                .method("POST")
       25273  +
                .header("integerInHeader", "-Infinity")
       25274  +
                .body(::aws_smithy_http_server::body::Body::empty())
       25275  +
                .unwrap();
       25276  +
            #[allow(unused_mut)]
       25277  +
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       25278  +
            let config = crate::service::RestJsonConfig::builder().build();
       25279  +
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       25280  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       25281  +
                                let sender = sender.clone();
       25282  +
                                async move {
       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> };
       25284  +
                                    sender.send(()).await.expect("receiver dropped early");
       25285  +
                                    result
       25286  +
                                }
       25287  +
                            })
       25288  +
                            .build_unchecked();
       25289  +
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       25290  +
                .await
       25291  +
                .expect("unable to make an HTTP request");
       25292  +
            ::pretty_assertions::assert_eq!(
       25293  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
       25294  +
                http_response.status()
       25295  +
            );
       25296  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
       25297  +
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       25298  +
                http_response.headers(),
       25299  +
                expected_headers,
       25300  +
            ));
       25301  +
        }
30195  25302   
    }
30196         -
    /// Tests that jsonName works with union members.
30197         -
    /// Test ID: PostUnionWithJsonNameRequest3
       25303  +
    /// Malformed values in headers should be rejected
       25304  +
    /// Test ID: RestJsonHeaderIntegerMalformedValueRejected_case6
30198  25305   
    #[::tokio::test]
30199         -
    async fn post_union_with_json_name_request3_request() {
30200         -
        #[allow(unused_mut)]
30201         -
        let mut http_request = http::Request::builder()
30202         -
            .uri("/PostUnionWithJsonName")
30203         -
            .method("POST")
30204         -
            .header("Content-Type", "application/json")
30205         -
            .body(::aws_smithy_http_server::body::Body::from(
30206         -
                ::bytes::Bytes::from_static(
30207         -
                    "{\n    \"value\": {\n        \"bar\": \"hi\"\n    }\n}".as_bytes(),
30208         -
                ),
30209         -
            ))
30210         -
            .unwrap();
30211         -
        #[allow(unused_mut)]
30212         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
30213         -
        let config = crate::service::RestJsonConfig::builder().build();
30214         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
30215         -
            .post_union_with_json_name(move |input: crate::input::PostUnionWithJsonNameInput| {
30216         -
                let sender = sender.clone();
30217         -
                async move {
30218         -
                    let result = {
30219         -
                        let expected = crate::input::PostUnionWithJsonNameInput {
30220         -
                            value: ::std::option::Option::Some(
30221         -
                                crate::model::UnionWithJsonName::Bar("hi".to_owned()),
30222         -
                            ),
30223         -
                        };
30224         -
                        ::pretty_assertions::assert_eq!(input, expected);
30225         -
                        let response = crate::output::PostUnionWithJsonNameOutput {
30226         -
                            value: crate::model::UnionWithJsonName::Foo("".to_owned()),
30227         -
                        };
30228         -
                        response
30229         -
                    };
30230         -
                    sender.send(()).await.expect("receiver dropped early");
30231         -
                    result
30232         -
                }
30233         -
            })
30234         -
            .build_unchecked();
30235         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
30236         -
            .await
30237         -
            .expect("unable to make an HTTP request");
30238         -
        assert!(receiver.recv().await.is_some());
       25306  +
    #[::tracing_test::traced_test]
       25307  +
    async fn rest_json_header_integer_malformed_value_rejected_case6_malformed_request() {
       25308  +
        {
       25309  +
            #[allow(unused_mut)]
       25310  +
            let mut http_request = http::Request::builder()
       25311  +
                .uri("/MalformedInteger/1")
       25312  +
                .method("POST")
       25313  +
                .header("integerInHeader", "NaN")
       25314  +
                .body(::aws_smithy_http_server::body::Body::empty())
       25315  +
                .unwrap();
       25316  +
            #[allow(unused_mut)]
       25317  +
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       25318  +
            let config = crate::service::RestJsonConfig::builder().build();
       25319  +
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       25320  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       25321  +
                                let sender = sender.clone();
       25322  +
                                async move {
       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> };
       25324  +
                                    sender.send(()).await.expect("receiver dropped early");
       25325  +
                                    result
       25326  +
                                }
       25327  +
                            })
       25328  +
                            .build_unchecked();
       25329  +
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       25330  +
                .await
       25331  +
                .expect("unable to make an HTTP request");
       25332  +
            ::pretty_assertions::assert_eq!(
       25333  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
       25334  +
                http_response.status()
       25335  +
            );
       25336  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
       25337  +
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       25338  +
                http_response.headers(),
       25339  +
                expected_headers,
       25340  +
            ));
       25341  +
        }
30239  25342   
    }
30240         -
    /// Tests that jsonName works with union members.
30241         -
    /// Test ID: PostUnionWithJsonNameResponse1
30242         -
    #[::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()),
30246         -
        };
30247         -
        use ::aws_smithy_http_server::response::IntoResponse;
30248         -
        let http_response = output.into_response();
30249         -
        ::pretty_assertions::assert_eq!(
30250         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
30251         -
            http_response.status()
30252         -
        );
30253         -
        let expected_headers = [("Content-Type", "application/json")];
30254         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
30255         -
            http_response.headers(),
30256         -
            expected_headers,
30257         -
        ));
30258         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
30259         -
            .await
30260         -
            .expect("unable to extract body to bytes");
30261         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
30262         -
            &body,
30263         -
            "{\n    \"value\": {\n        \"FOO\": \"hi\"\n    }\n}",
30264         -
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
30265         -
        ));
       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>>
30266  25351   
    }
30267         -
    /// Tests that jsonName works with union members.
30268         -
    /// Test ID: PostUnionWithJsonNameResponse2
30269         -
    #[::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()),
30273         -
        };
30274         -
        use ::aws_smithy_http_server::response::IntoResponse;
30275         -
        let http_response = output.into_response();
30276         -
        ::pretty_assertions::assert_eq!(
30277         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
30278         -
            http_response.status()
30279         -
        );
30280         -
        let expected_headers = [("Content-Type", "application/json")];
30281         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
30282         -
            http_response.headers(),
30283         -
            expected_headers,
30284         -
        ));
30285         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
30286         -
            .await
30287         -
            .expect("unable to extract body to bytes");
30288         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
30289         -
            &body,
30290         -
            "{\n    \"value\": {\n        \"_baz\": \"hi\"\n    }\n}",
30291         -
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
30292         -
        ));
       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)
30293  25366   
    }
30294         -
    /// Tests that jsonName works with union members.
30295         -
    /// Test ID: PostUnionWithJsonNameResponse3
30296         -
    #[::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()),
       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)
30300  25396   
        };
30301         -
        use ::aws_smithy_http_server::response::IntoResponse;
30302         -
        let http_response = output.into_response();
30303         -
        ::pretty_assertions::assert_eq!(
30304         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
30305         -
            http_response.status()
       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  +
            },
30306  25405   
        );
30307         -
        let expected_headers = [("Content-Type", "application/json")];
30308         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
30309         -
            http_response.headers(),
30310         -
            expected_headers,
30311         -
        ));
30312         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
30313         -
            .await
30314         -
            .expect("unable to extract body to bytes");
30315         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
30316         -
            &body,
30317         -
            "{\n    \"value\": {\n        \"bar\": \"hi\"\n    }\n}",
30318         -
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
30319         -
        ));
       25406  +
        MalformedRequestBodyInputFuture {
       25407  +
            inner: Box::pin(fut),
       25408  +
        }
30320  25409   
    }
30321  25410   
}
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
       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  +
                        }
30367  25423   
                    }
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  25424   
    }
30376  25425   
}
30377         -
#[cfg(test)]
       25426  +
30378  25427   
#[allow(unreachable_code, unused_variables)]
30379         -
mod server_query_precedence_test {
30380         -
    /// Servers put all query params in map
30381         -
    /// Test ID: RestJsonServersPutAllQueryParamsInMap
30382         -
    #[::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
30413         -
                    };
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  25428   
#[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)
30515         -
            .await
30516         -
            .expect("unable to make an HTTP request");
30517         -
        assert!(receiver.recv().await.is_some());
30518         -
    }
30519         -
    /// Serializes recursive structures
30520         -
    /// Test ID: RestJsonRecursiveShapes
       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
30521  25434   
    #[::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         -
                            },
30539         -
                        ),
30540         -
                    },
30541         -
                )),
30542         -
            }),
30543         -
        };
30544         -
        use ::aws_smithy_http_server::response::IntoResponse;
30545         -
        let http_response = output.into_response();
30546         -
        ::pretty_assertions::assert_eq!(
30547         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
30548         -
            http_response.status()
30549         -
        );
30550         -
        let expected_headers = [("Content-Type", "application/json")];
30551         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
30552         -
            http_response.headers(),
30553         -
            expected_headers,
30554         -
        ));
30555         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
30556         -
            .await
30557         -
            .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         -
        );
       25435  +
    #[::tracing_test::traced_test]
       25436  +
    async fn rest_json_invalid_json_body_case0_malformed_request() {
       25437  +
        {
       25438  +
            #[allow(unused_mut)]
       25439  +
            let mut http_request = http::Request::builder()
       25440  +
                .uri("/MalformedRequestBody")
       25441  +
                .method("POST")
       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();
       25447  +
            #[allow(unused_mut)]
       25448  +
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       25449  +
            let config = crate::service::RestJsonConfig::builder().build();
       25450  +
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       25451  +
                            .malformed_request_body(move |input: crate::input::MalformedRequestBodyInput| {
       25452  +
                                let sender = sender.clone();
       25453  +
                                async move {
       25454  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedRequestBodyOutput };
       25455  +
                                    sender.send(()).await.expect("receiver dropped early");
       25456  +
                                    result
       25457  +
                                }
       25458  +
                            })
       25459  +
                            .build_unchecked();
       25460  +
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       25461  +
                .await
       25462  +
                .expect("unable to make an HTTP request");
       25463  +
            ::pretty_assertions::assert_eq!(
       25464  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
       25465  +
                http_response.status()
       25466  +
            );
       25467  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
       25468  +
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       25469  +
                http_response.headers(),
       25470  +
                expected_headers,
       25471  +
            ));
       25472  +
        }
30561  25473   
    }
30562         -
}
30563         -
#[cfg(test)]
30564         -
#[allow(unreachable_code, unused_variables)]
30565         -
mod server_simple_scalar_properties_test {
30566         -
    /// Serializes simple scalar properties
30567         -
    /// Test ID: RestJsonSimpleScalarProperties
       25474  +
    /// When the request body is not valid JSON, the response should be a 400
       25475  +
    /// SerializationException.
       25476  +
    /// Test ID: RestJsonInvalidJsonBody_case1
30568  25477   
    #[::tokio::test]
30569         -
    async fn rest_json_simple_scalar_properties_request() {
30570         -
        #[allow(unused_mut)]
30571         -
                    let mut http_request = http::Request::builder()
30572         -
                        .uri("/SimpleScalarProperties")
30573         -
                        .method("PUT")
30574         -
        .header("Content-Type", "application/json")
30575         -
        .header("X-Foo", "Foo")
30576         -
        .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         -
        #[allow(unused_mut)]
30578         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
30579         -
        let config = crate::service::RestJsonConfig::builder().build();
30580         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
30581         -
            .simple_scalar_properties(move |input: crate::input::SimpleScalarPropertiesInput| {
30582         -
                let sender = sender.clone();
30583         -
                async move {
30584         -
                    let result = {
30585         -
                        use ::aws_smithy_protocol_test::FloatEquals;
30586         -
                        let expected = crate::input::SimpleScalarPropertiesInput {
30587         -
                            foo: ::std::option::Option::Some("Foo".to_owned()),
30588         -
                            string_value: ::std::option::Option::Some("string".to_owned()),
30589         -
                            true_boolean_value: ::std::option::Option::Some(true),
30590         -
                            false_boolean_value: ::std::option::Option::Some(false),
30591         -
                            byte_value: ::std::option::Option::Some(1),
30592         -
                            short_value: ::std::option::Option::Some(2),
30593         -
                            integer_value: ::std::option::Option::Some(3),
30594         -
                            long_value: ::std::option::Option::Some(4),
30595         -
                            float_value: ::std::option::Option::Some(5.5_f32),
30596         -
                            double_value: ::std::option::Option::Some(6.5_f64),
30597         -
                        };
30598         -
                        ::pretty_assertions::assert_eq!(
30599         -
                            input.foo,
30600         -
                            expected.foo,
30601         -
                            "Unexpected value for `foo`"
30602         -
                        );
30603         -
                        ::pretty_assertions::assert_eq!(
30604         -
                            input.string_value,
30605         -
                            expected.string_value,
30606         -
                            "Unexpected value for `string_value`"
30607         -
                        );
30608         -
                        ::pretty_assertions::assert_eq!(
30609         -
                            input.true_boolean_value,
30610         -
                            expected.true_boolean_value,
30611         -
                            "Unexpected value for `true_boolean_value`"
30612         -
                        );
30613         -
                        ::pretty_assertions::assert_eq!(
30614         -
                            input.false_boolean_value,
30615         -
                            expected.false_boolean_value,
30616         -
                            "Unexpected value for `false_boolean_value`"
30617         -
                        );
30618         -
                        ::pretty_assertions::assert_eq!(
30619         -
                            input.byte_value,
30620         -
                            expected.byte_value,
30621         -
                            "Unexpected value for `byte_value`"
30622         -
                        );
30623         -
                        ::pretty_assertions::assert_eq!(
30624         -
                            input.short_value,
30625         -
                            expected.short_value,
30626         -
                            "Unexpected value for `short_value`"
30627         -
                        );
30628         -
                        ::pretty_assertions::assert_eq!(
30629         -
                            input.integer_value,
30630         -
                            expected.integer_value,
30631         -
                            "Unexpected value for `integer_value`"
30632         -
                        );
30633         -
                        ::pretty_assertions::assert_eq!(
30634         -
                            input.long_value,
30635         -
                            expected.long_value,
30636         -
                            "Unexpected value for `long_value`"
30637         -
                        );
30638         -
                        assert!(
30639         -
                            input.float_value.float_equals(&expected.float_value),
30640         -
                            "Unexpected value for `float_value` {:?} vs. {:?}",
30641         -
                            expected.float_value,
30642         -
                            input.float_value
30643         -
                        );
30644         -
                        assert!(
30645         -
                            input.double_value.float_equals(&expected.double_value),
30646         -
                            "Unexpected value for `double_value` {:?} vs. {:?}",
30647         -
                            expected.double_value,
30648         -
                            input.double_value
30649         -
                        );
30650         -
                        let response = crate::output::SimpleScalarPropertiesOutput {
30651         -
                            foo: ::std::option::Option::None,
30652         -
                            string_value: ::std::option::Option::None,
30653         -
                            true_boolean_value: ::std::option::Option::None,
30654         -
                            false_boolean_value: ::std::option::Option::None,
30655         -
                            byte_value: ::std::option::Option::None,
30656         -
                            short_value: ::std::option::Option::None,
30657         -
                            integer_value: ::std::option::Option::None,
30658         -
                            long_value: ::std::option::Option::None,
30659         -
                            float_value: ::std::option::Option::None,
30660         -
                            double_value: ::std::option::Option::None,
30661         -
                        };
30662         -
                        response
30663         -
                    };
30664         -
                    sender.send(()).await.expect("receiver dropped early");
30665         -
                    result
30666         -
                }
30667         -
            })
30668         -
            .build_unchecked();
30669         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
30670         -
            .await
30671         -
            .expect("unable to make an HTTP request");
30672         -
        assert!(receiver.recv().await.is_some());
       25478  +
    #[::tracing_test::traced_test]
       25479  +
    async fn rest_json_invalid_json_body_case1_malformed_request() {
       25480  +
        {
       25481  +
            #[allow(unused_mut)]
       25482  +
            let mut http_request = http::Request::builder()
       25483  +
                .uri("/MalformedRequestBody")
       25484  +
                .method("POST")
       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  +
                ))
       25489  +
                .unwrap();
       25490  +
            #[allow(unused_mut)]
       25491  +
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       25492  +
            let config = crate::service::RestJsonConfig::builder().build();
       25493  +
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       25494  +
                            .malformed_request_body(move |input: crate::input::MalformedRequestBodyInput| {
       25495  +
                                let sender = sender.clone();
       25496  +
                                async move {
       25497  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedRequestBodyOutput };
       25498  +
                                    sender.send(()).await.expect("receiver dropped early");
       25499  +
                                    result
       25500  +
                                }
       25501  +
                            })
       25502  +
                            .build_unchecked();
       25503  +
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       25504  +
                .await
       25505  +
                .expect("unable to make an HTTP request");
       25506  +
            ::pretty_assertions::assert_eq!(
       25507  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
       25508  +
                http_response.status()
       25509  +
            );
       25510  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
       25511  +
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       25512  +
                http_response.headers(),
       25513  +
                expected_headers,
       25514  +
            ));
       25515  +
        }
30673  25516   
    }
30674         -
    /// Rest Json should not deserialize null structure values
30675         -
    /// Test ID: RestJsonServersDontSerializeNullStructureValues
       25517  +
    /// When the request body is not valid JSON, the response should be a 400
       25518  +
    /// SerializationException.
       25519  +
    /// Test ID: RestJsonInvalidJsonBody_case2
30676  25520   
    #[::tokio::test]
30677         -
    async fn rest_json_servers_dont_serialize_null_structure_values_request() {
30678         -
        #[allow(unused_mut)]
30679         -
        let mut http_request = http::Request::builder()
30680         -
            .uri("/SimpleScalarProperties")
30681         -
            .method("PUT")
30682         -
            .header("Content-Type", "application/json")
30683         -
            .body(::aws_smithy_http_server::body::Body::from(
30684         -
                ::bytes::Bytes::from_static("{\n    \"stringValue\": null\n}".as_bytes()),
30685         -
            ))
30686         -
            .unwrap();
30687         -
        #[allow(unused_mut)]
30688         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
30689         -
        let config = crate::service::RestJsonConfig::builder().build();
30690         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
30691         -
            .simple_scalar_properties(move |input: crate::input::SimpleScalarPropertiesInput| {
30692         -
                let sender = sender.clone();
30693         -
                async move {
30694         -
                    let result = {
30695         -
                        use ::aws_smithy_protocol_test::FloatEquals;
30696         -
                        let expected = crate::input::SimpleScalarPropertiesInput {
30697         -
                            foo: ::std::option::Option::None,
30698         -
                            string_value: ::std::option::Option::None,
30699         -
                            true_boolean_value: ::std::option::Option::None,
30700         -
                            false_boolean_value: ::std::option::Option::None,
30701         -
                            byte_value: ::std::option::Option::None,
30702         -
                            short_value: ::std::option::Option::None,
30703         -
                            integer_value: ::std::option::Option::None,
30704         -
                            long_value: ::std::option::Option::None,
30705         -
                            float_value: ::std::option::Option::None,
30706         -
                            double_value: ::std::option::Option::None,
30707         -
                        };
30708         -
                        ::pretty_assertions::assert_eq!(
30709         -
                            input.foo,
30710         -
                            expected.foo,
30711         -
                            "Unexpected value for `foo`"
30712         -
                        );
30713         -
                        ::pretty_assertions::assert_eq!(
30714         -
                            input.string_value,
30715         -
                            expected.string_value,
30716         -
                            "Unexpected value for `string_value`"
30717         -
                        );
30718         -
                        ::pretty_assertions::assert_eq!(
30719         -
                            input.true_boolean_value,
30720         -
                            expected.true_boolean_value,
30721         -
                            "Unexpected value for `true_boolean_value`"
30722         -
                        );
30723         -
                        ::pretty_assertions::assert_eq!(
30724         -
                            input.false_boolean_value,
30725         -
                            expected.false_boolean_value,
30726         -
                            "Unexpected value for `false_boolean_value`"
30727         -
                        );
30728         -
                        ::pretty_assertions::assert_eq!(
30729         -
                            input.byte_value,
30730         -
                            expected.byte_value,
30731         -
                            "Unexpected value for `byte_value`"
30732         -
                        );
30733         -
                        ::pretty_assertions::assert_eq!(
30734         -
                            input.short_value,
30735         -
                            expected.short_value,
30736         -
                            "Unexpected value for `short_value`"
30737         -
                        );
30738         -
                        ::pretty_assertions::assert_eq!(
30739         -
                            input.integer_value,
30740         -
                            expected.integer_value,
30741         -
                            "Unexpected value for `integer_value`"
30742         -
                        );
30743         -
                        ::pretty_assertions::assert_eq!(
30744         -
                            input.long_value,
30745         -
                            expected.long_value,
30746         -
                            "Unexpected value for `long_value`"
30747         -
                        );
30748         -
                        assert!(
30749         -
                            input.float_value.float_equals(&expected.float_value),
30750         -
                            "Unexpected value for `float_value` {:?} vs. {:?}",
30751         -
                            expected.float_value,
30752         -
                            input.float_value
30753         -
                        );
30754         -
                        assert!(
30755         -
                            input.double_value.float_equals(&expected.double_value),
30756         -
                            "Unexpected value for `double_value` {:?} vs. {:?}",
30757         -
                            expected.double_value,
30758         -
                            input.double_value
30759         -
                        );
30760         -
                        let response = crate::output::SimpleScalarPropertiesOutput {
30761         -
                            foo: ::std::option::Option::None,
30762         -
                            string_value: ::std::option::Option::None,
30763         -
                            true_boolean_value: ::std::option::Option::None,
30764         -
                            false_boolean_value: ::std::option::Option::None,
30765         -
                            byte_value: ::std::option::Option::None,
30766         -
                            short_value: ::std::option::Option::None,
30767         -
                            integer_value: ::std::option::Option::None,
30768         -
                            long_value: ::std::option::Option::None,
30769         -
                            float_value: ::std::option::Option::None,
30770         -
                            double_value: ::std::option::Option::None,
30771         -
                        };
30772         -
                        response
30773         -
                    };
30774         -
                    sender.send(()).await.expect("receiver dropped early");
30775         -
                    result
30776         -
                }
30777         -
            })
30778         -
            .build_unchecked();
30779         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
30780         -
            .await
30781         -
            .expect("unable to make an HTTP request");
30782         -
        assert!(receiver.recv().await.is_some());
       25521  +
    #[::tracing_test::traced_test]
       25522  +
    async fn rest_json_invalid_json_body_case2_malformed_request() {
       25523  +
        {
       25524  +
            #[allow(unused_mut)]
       25525  +
            let mut http_request = http::Request::builder()
       25526  +
                .uri("/MalformedRequestBody")
       25527  +
                .method("POST")
       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  +
                ))
       25532  +
                .unwrap();
       25533  +
            #[allow(unused_mut)]
       25534  +
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       25535  +
            let config = crate::service::RestJsonConfig::builder().build();
       25536  +
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       25537  +
                            .malformed_request_body(move |input: crate::input::MalformedRequestBodyInput| {
       25538  +
                                let sender = sender.clone();
       25539  +
                                async move {
       25540  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedRequestBodyOutput };
       25541  +
                                    sender.send(()).await.expect("receiver dropped early");
       25542  +
                                    result
       25543  +
                                }
       25544  +
                            })
       25545  +
                            .build_unchecked();
       25546  +
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       25547  +
                .await
       25548  +
                .expect("unable to make an HTTP request");
       25549  +
            ::pretty_assertions::assert_eq!(
       25550  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
       25551  +
                http_response.status()
       25552  +
            );
       25553  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
       25554  +
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       25555  +
                http_response.headers(),
       25556  +
                expected_headers,
       25557  +
            ));
       25558  +
        }
30783  25559   
    }
30784         -
    /// Supports handling NaN float values.
30785         -
    /// Test ID: RestJsonSupportsNaNFloatInputs
       25560  +
    /// When the request body is not valid JSON, the response should be a 400
       25561  +
    /// SerializationException.
       25562  +
    /// Test ID: RestJsonInvalidJsonBody_case3
30786  25563   
    #[::tokio::test]
30787         -
    async fn rest_json_supports_na_n_float_inputs_request() {
30788         -
        #[allow(unused_mut)]
30789         -
        let mut http_request = http::Request::builder()
30790         -
            .uri("/SimpleScalarProperties")
30791         -
            .method("PUT")
30792         -
            .header("Content-Type", "application/json")
30793         -
            .body(::aws_smithy_http_server::body::Body::from(
30794         -
                ::bytes::Bytes::from_static(
30795         -
                    "{\n    \"floatValue\": \"NaN\",\n    \"DoubleDribble\": \"NaN\"\n}".as_bytes(),
30796         -
                ),
30797         -
            ))
30798         -
            .unwrap();
30799         -
        #[allow(unused_mut)]
30800         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
30801         -
        let config = crate::service::RestJsonConfig::builder().build();
30802         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
30803         -
                        .simple_scalar_properties(move |input: crate::input::SimpleScalarPropertiesInput| {
30804         -
                            let sender = sender.clone();
30805         -
                            async move {
30806         -
                                let result = { use ::aws_smithy_protocol_test::FloatEquals;
30807         -
        let expected =
30808         -
            crate::input::SimpleScalarPropertiesInput {
30809         -
                float_value:
30810         -
                    ::std::option::Option::Some(
30811         -
                        <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("NaN").expect("invalid string for number")
30812         -
                    )
30813         -
                ,
30814         -
                double_value:
30815         -
                    ::std::option::Option::Some(
30816         -
                        <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("NaN").expect("invalid string for number")
30817         -
                    )
30818         -
                ,
30819         -
                foo:
30820         -
                    ::std::option::Option::None
30821         -
                ,
30822         -
                string_value:
30823         -
                    ::std::option::Option::None
30824         -
                ,
30825         -
                true_boolean_value:
30826         -
                    ::std::option::Option::None
30827         -
                ,
30828         -
                false_boolean_value:
30829         -
                    ::std::option::Option::None
30830         -
                ,
30831         -
                byte_value:
30832         -
                    ::std::option::Option::None
30833         -
                ,
30834         -
                short_value:
30835         -
                    ::std::option::Option::None
30836         -
                ,
30837         -
                integer_value:
30838         -
                    ::std::option::Option::None
30839         -
                ,
30840         -
                long_value:
30841         -
                    ::std::option::Option::None
30842         -
                ,
30843         -
            }
30844         -
        ;
30845         -
        ::pretty_assertions::assert_eq!(input.foo, expected.foo, "Unexpected value for `foo`");
30846         -
        ::pretty_assertions::assert_eq!(input.string_value, expected.string_value, "Unexpected value for `string_value`");
30847         -
        ::pretty_assertions::assert_eq!(input.true_boolean_value, expected.true_boolean_value, "Unexpected value for `true_boolean_value`");
30848         -
        ::pretty_assertions::assert_eq!(input.false_boolean_value, expected.false_boolean_value, "Unexpected value for `false_boolean_value`");
30849         -
        ::pretty_assertions::assert_eq!(input.byte_value, expected.byte_value, "Unexpected value for `byte_value`");
30850         -
        ::pretty_assertions::assert_eq!(input.short_value, expected.short_value, "Unexpected value for `short_value`");
30851         -
        ::pretty_assertions::assert_eq!(input.integer_value, expected.integer_value, "Unexpected value for `integer_value`");
30852         -
        ::pretty_assertions::assert_eq!(input.long_value, expected.long_value, "Unexpected value for `long_value`");
30853         -
        assert!(input.float_value.float_equals(&expected.float_value),
30854         -
                                            "Unexpected value for `float_value` {:?} vs. {:?}", expected.float_value, input.float_value);
30855         -
        assert!(input.double_value.float_equals(&expected.double_value),
30856         -
                                            "Unexpected value for `double_value` {:?} vs. {:?}", expected.double_value, input.double_value);
30857         -
        let response =
30858         -
            crate::output::SimpleScalarPropertiesOutput {
30859         -
                foo:
30860         -
                    ::std::option::Option::None
30861         -
                ,
30862         -
                string_value:
30863         -
                    ::std::option::Option::None
30864         -
                ,
30865         -
                true_boolean_value:
30866         -
                    ::std::option::Option::None
30867         -
                ,
30868         -
                false_boolean_value:
30869         -
                    ::std::option::Option::None
30870         -
                ,
30871         -
                byte_value:
30872         -
                    ::std::option::Option::None
30873         -
                ,
30874         -
                short_value:
30875         -
                    ::std::option::Option::None
30876         -
                ,
30877         -
                integer_value:
30878         -
                    ::std::option::Option::None
30879         -
                ,
30880         -
                long_value:
30881         -
                    ::std::option::Option::None
30882         -
                ,
30883         -
                float_value:
30884         -
                    ::std::option::Option::None
30885         -
                ,
30886         -
                double_value:
30887         -
                    ::std::option::Option::None
30888         -
                ,
30889         -
            }
30890         -
        ;
30891         -
        response };
30892         -
                                sender.send(()).await.expect("receiver dropped early");
30893         -
                                result
30894         -
                            }
30895         -
                        })
30896         -
                        .build_unchecked();
30897         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
30898         -
            .await
30899         -
            .expect("unable to make an HTTP request");
30900         -
        assert!(receiver.recv().await.is_some());
       25564  +
    #[::tracing_test::traced_test]
       25565  +
    async fn rest_json_invalid_json_body_case3_malformed_request() {
       25566  +
        {
       25567  +
            #[allow(unused_mut)]
       25568  +
            let mut http_request = http::Request::builder()
       25569  +
                .uri("/MalformedRequestBody")
       25570  +
                .method("POST")
       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  +
                ))
       25577  +
                .unwrap();
       25578  +
            #[allow(unused_mut)]
       25579  +
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       25580  +
            let config = crate::service::RestJsonConfig::builder().build();
       25581  +
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       25582  +
                            .malformed_request_body(move |input: crate::input::MalformedRequestBodyInput| {
       25583  +
                                let sender = sender.clone();
       25584  +
                                async move {
       25585  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedRequestBodyOutput };
       25586  +
                                    sender.send(()).await.expect("receiver dropped early");
       25587  +
                                    result
       25588  +
                                }
       25589  +
                            })
       25590  +
                            .build_unchecked();
       25591  +
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       25592  +
                .await
       25593  +
                .expect("unable to make an HTTP request");
       25594  +
            ::pretty_assertions::assert_eq!(
       25595  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
       25596  +
                http_response.status()
       25597  +
            );
       25598  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
       25599  +
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       25600  +
                http_response.headers(),
       25601  +
                expected_headers,
       25602  +
            ));
       25603  +
        }
30901  25604   
    }
30902         -
    /// Supports handling Infinity float values.
30903         -
    /// Test ID: RestJsonSupportsInfinityFloatInputs
       25605  +
    /// When the request body is not valid JSON, the response should be a 400
       25606  +
    /// SerializationException.
       25607  +
    /// Test ID: RestJsonInvalidJsonBody_case4
30904  25608   
    #[::tokio::test]
30905         -
    async fn rest_json_supports_infinity_float_inputs_request() {
30906         -
        #[allow(unused_mut)]
30907         -
        let mut http_request = http::Request::builder()
30908         -
            .uri("/SimpleScalarProperties")
30909         -
            .method("PUT")
30910         -
            .header("Content-Type", "application/json")
30911         -
            .body(::aws_smithy_http_server::body::Body::from(
30912         -
                ::bytes::Bytes::from_static(
30913         -
                    "{\n    \"floatValue\": \"Infinity\",\n    \"DoubleDribble\": \"Infinity\"\n}"
30914         -
                        .as_bytes(),
30915         -
                ),
30916         -
            ))
30917         -
            .unwrap();
30918         -
        #[allow(unused_mut)]
30919         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
30920         -
        let config = crate::service::RestJsonConfig::builder().build();
30921         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
30922         -
                        .simple_scalar_properties(move |input: crate::input::SimpleScalarPropertiesInput| {
30923         -
                            let sender = sender.clone();
30924         -
                            async move {
30925         -
                                let result = { use ::aws_smithy_protocol_test::FloatEquals;
30926         -
        let expected =
30927         -
            crate::input::SimpleScalarPropertiesInput {
30928         -
                float_value:
30929         -
                    ::std::option::Option::Some(
30930         -
                        <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("Infinity").expect("invalid string for number")
30931         -
                    )
30932         -
                ,
30933         -
                double_value:
30934         -
                    ::std::option::Option::Some(
30935         -
                        <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("Infinity").expect("invalid string for number")
30936         -
                    )
30937         -
                ,
30938         -
                foo:
30939         -
                    ::std::option::Option::None
30940         -
                ,
30941         -
                string_value:
30942         -
                    ::std::option::Option::None
30943         -
                ,
30944         -
                true_boolean_value:
30945         -
                    ::std::option::Option::None
30946         -
                ,
30947         -
                false_boolean_value:
30948         -
                    ::std::option::Option::None
30949         -
                ,
30950         -
                byte_value:
30951         -
                    ::std::option::Option::None
30952         -
                ,
30953         -
                short_value:
30954         -
                    ::std::option::Option::None
30955         -
                ,
30956         -
                integer_value:
30957         -
                    ::std::option::Option::None
30958         -
                ,
30959         -
                long_value:
30960         -
                    ::std::option::Option::None
30961         -
                ,
30962         -
            }
30963         -
        ;
30964         -
        ::pretty_assertions::assert_eq!(input.foo, expected.foo, "Unexpected value for `foo`");
30965         -
        ::pretty_assertions::assert_eq!(input.string_value, expected.string_value, "Unexpected value for `string_value`");
30966         -
        ::pretty_assertions::assert_eq!(input.true_boolean_value, expected.true_boolean_value, "Unexpected value for `true_boolean_value`");
30967         -
        ::pretty_assertions::assert_eq!(input.false_boolean_value, expected.false_boolean_value, "Unexpected value for `false_boolean_value`");
30968         -
        ::pretty_assertions::assert_eq!(input.byte_value, expected.byte_value, "Unexpected value for `byte_value`");
30969         -
        ::pretty_assertions::assert_eq!(input.short_value, expected.short_value, "Unexpected value for `short_value`");
30970         -
        ::pretty_assertions::assert_eq!(input.integer_value, expected.integer_value, "Unexpected value for `integer_value`");
30971         -
        ::pretty_assertions::assert_eq!(input.long_value, expected.long_value, "Unexpected value for `long_value`");
30972         -
        assert!(input.float_value.float_equals(&expected.float_value),
30973         -
                                            "Unexpected value for `float_value` {:?} vs. {:?}", expected.float_value, input.float_value);
30974         -
        assert!(input.double_value.float_equals(&expected.double_value),
30975         -
                                            "Unexpected value for `double_value` {:?} vs. {:?}", expected.double_value, input.double_value);
30976         -
        let response =
30977         -
            crate::output::SimpleScalarPropertiesOutput {
30978         -
                foo:
30979         -
                    ::std::option::Option::None
30980         -
                ,
30981         -
                string_value:
30982         -
                    ::std::option::Option::None
30983         -
                ,
30984         -
                true_boolean_value:
30985         -
                    ::std::option::Option::None
30986         -
                ,
30987         -
                false_boolean_value:
30988         -
                    ::std::option::Option::None
30989         -
                ,
30990         -
                byte_value:
30991         -
                    ::std::option::Option::None
30992         -
                ,
30993         -
                short_value:
30994         -
                    ::std::option::Option::None
30995         -
                ,
30996         -
                integer_value:
30997         -
                    ::std::option::Option::None
30998         -
                ,
30999         -
                long_value:
31000         -
                    ::std::option::Option::None
31001         -
                ,
31002         -
                float_value:
31003         -
                    ::std::option::Option::None
31004         -
                ,
31005         -
                double_value:
31006         -
                    ::std::option::Option::None
31007         -
                ,
31008         -
            }
31009         -
        ;
31010         -
        response };
31011         -
                                sender.send(()).await.expect("receiver dropped early");
31012         -
                                result
31013         -
                            }
31014         -
                        })
31015         -
                        .build_unchecked();
31016         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
31017         -
            .await
31018         -
            .expect("unable to make an HTTP request");
31019         -
        assert!(receiver.recv().await.is_some());
       25609  +
    #[::tracing_test::traced_test]
       25610  +
    async fn rest_json_invalid_json_body_case4_malformed_request() {
       25611  +
        {
       25612  +
            #[allow(unused_mut)]
       25613  +
            let mut http_request = http::Request::builder()
       25614  +
                .uri("/MalformedRequestBody")
       25615  +
                .method("POST")
       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  +
                ))
       25622  +
                .unwrap();
       25623  +
            #[allow(unused_mut)]
       25624  +
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       25625  +
            let config = crate::service::RestJsonConfig::builder().build();
       25626  +
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       25627  +
                            .malformed_request_body(move |input: crate::input::MalformedRequestBodyInput| {
       25628  +
                                let sender = sender.clone();
       25629  +
                                async move {
       25630  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedRequestBodyOutput };
       25631  +
                                    sender.send(()).await.expect("receiver dropped early");
       25632  +
                                    result
       25633  +
                                }
       25634  +
                            })
       25635  +
                            .build_unchecked();
       25636  +
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       25637  +
                .await
       25638  +
                .expect("unable to make an HTTP request");
       25639  +
            ::pretty_assertions::assert_eq!(
       25640  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
       25641  +
                http_response.status()
       25642  +
            );
       25643  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
       25644  +
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       25645  +
                http_response.headers(),
       25646  +
                expected_headers,
       25647  +
            ));
       25648  +
        }
       25649  +
    }
       25650  +
    /// When the request body is not valid JSON, the response should be a 400
       25651  +
    /// SerializationException.
       25652  +
    /// Test ID: RestJsonInvalidJsonBody_case5
       25653  +
    #[::tokio::test]
       25654  +
    #[::tracing_test::traced_test]
       25655  +
    async fn rest_json_invalid_json_body_case5_malformed_request() {
       25656  +
        {
       25657  +
            #[allow(unused_mut)]
       25658  +
            let mut http_request = http::Request::builder()
       25659  +
                .uri("/MalformedRequestBody")
       25660  +
                .method("POST")
       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  +
                ))
       25665  +
                .unwrap();
       25666  +
            #[allow(unused_mut)]
       25667  +
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       25668  +
            let config = crate::service::RestJsonConfig::builder().build();
       25669  +
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       25670  +
                            .malformed_request_body(move |input: crate::input::MalformedRequestBodyInput| {
       25671  +
                                let sender = sender.clone();
       25672  +
                                async move {
       25673  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedRequestBodyOutput };
       25674  +
                                    sender.send(()).await.expect("receiver dropped early");
       25675  +
                                    result
       25676  +
                                }
       25677  +
                            })
       25678  +
                            .build_unchecked();
       25679  +
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       25680  +
                .await
       25681  +
                .expect("unable to make an HTTP request");
       25682  +
            ::pretty_assertions::assert_eq!(
       25683  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
       25684  +
                http_response.status()
       25685  +
            );
       25686  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
       25687  +
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       25688  +
                http_response.headers(),
       25689  +
                expected_headers,
       25690  +
            ));
       25691  +
        }
31020  25692   
    }
31021         -
    /// Supports handling -Infinity float values.
31022         -
    /// Test ID: RestJsonSupportsNegativeInfinityFloatInputs
       25693  +
    /// When the request body is not valid JSON, the response should be a 400
       25694  +
    /// SerializationException.
       25695  +
    /// Test ID: RestJsonInvalidJsonBody_case6
31023  25696   
    #[::tokio::test]
31024         -
    async fn rest_json_supports_negative_infinity_float_inputs_request() {
31025         -
        #[allow(unused_mut)]
31026         -
                    let mut http_request = http::Request::builder()
31027         -
                        .uri("/SimpleScalarProperties")
31028         -
                        .method("PUT")
31029         -
        .header("Content-Type", "application/json")
31030         -
        .body(::aws_smithy_http_server::body::Body::from(::bytes::Bytes::from_static("{\n    \"floatValue\": \"-Infinity\",\n    \"DoubleDribble\": \"-Infinity\"\n}".as_bytes()))).unwrap();
31031         -
        #[allow(unused_mut)]
31032         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
31033         -
        let config = crate::service::RestJsonConfig::builder().build();
31034         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
31035         -
                        .simple_scalar_properties(move |input: crate::input::SimpleScalarPropertiesInput| {
31036         -
                            let sender = sender.clone();
31037         -
                            async move {
31038         -
                                let result = { use ::aws_smithy_protocol_test::FloatEquals;
31039         -
        let expected =
31040         -
            crate::input::SimpleScalarPropertiesInput {
31041         -
                float_value:
31042         -
                    ::std::option::Option::Some(
31043         -
                        <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("-Infinity").expect("invalid string for number")
31044         -
                    )
31045         -
                ,
31046         -
                double_value:
31047         -
                    ::std::option::Option::Some(
31048         -
                        <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("-Infinity").expect("invalid string for number")
31049         -
                    )
31050         -
                ,
31051         -
                foo:
31052         -
                    ::std::option::Option::None
31053         -
                ,
31054         -
                string_value:
31055         -
                    ::std::option::Option::None
31056         -
                ,
31057         -
                true_boolean_value:
31058         -
                    ::std::option::Option::None
31059         -
                ,
31060         -
                false_boolean_value:
31061         -
                    ::std::option::Option::None
31062         -
                ,
31063         -
                byte_value:
31064         -
                    ::std::option::Option::None
31065         -
                ,
31066         -
                short_value:
31067         -
                    ::std::option::Option::None
31068         -
                ,
31069         -
                integer_value:
31070         -
                    ::std::option::Option::None
31071         -
                ,
31072         -
                long_value:
31073         -
                    ::std::option::Option::None
31074         -
                ,
31075         -
            }
31076         -
        ;
31077         -
        ::pretty_assertions::assert_eq!(input.foo, expected.foo, "Unexpected value for `foo`");
31078         -
        ::pretty_assertions::assert_eq!(input.string_value, expected.string_value, "Unexpected value for `string_value`");
31079         -
        ::pretty_assertions::assert_eq!(input.true_boolean_value, expected.true_boolean_value, "Unexpected value for `true_boolean_value`");
31080         -
        ::pretty_assertions::assert_eq!(input.false_boolean_value, expected.false_boolean_value, "Unexpected value for `false_boolean_value`");
31081         -
        ::pretty_assertions::assert_eq!(input.byte_value, expected.byte_value, "Unexpected value for `byte_value`");
31082         -
        ::pretty_assertions::assert_eq!(input.short_value, expected.short_value, "Unexpected value for `short_value`");
31083         -
        ::pretty_assertions::assert_eq!(input.integer_value, expected.integer_value, "Unexpected value for `integer_value`");
31084         -
        ::pretty_assertions::assert_eq!(input.long_value, expected.long_value, "Unexpected value for `long_value`");
31085         -
        assert!(input.float_value.float_equals(&expected.float_value),
31086         -
                                            "Unexpected value for `float_value` {:?} vs. {:?}", expected.float_value, input.float_value);
31087         -
        assert!(input.double_value.float_equals(&expected.double_value),
31088         -
                                            "Unexpected value for `double_value` {:?} vs. {:?}", expected.double_value, input.double_value);
31089         -
        let response =
31090         -
            crate::output::SimpleScalarPropertiesOutput {
31091         -
                foo:
31092         -
                    ::std::option::Option::None
31093         -
                ,
31094         -
                string_value:
31095         -
                    ::std::option::Option::None
31096         -
                ,
31097         -
                true_boolean_value:
31098         -
                    ::std::option::Option::None
31099         -
                ,
31100         -
                false_boolean_value:
31101         -
                    ::std::option::Option::None
31102         -
                ,
31103         -
                byte_value:
31104         -
                    ::std::option::Option::None
31105         -
                ,
31106         -
                short_value:
31107         -
                    ::std::option::Option::None
31108         -
                ,
31109         -
                integer_value:
31110         -
                    ::std::option::Option::None
31111         -
                ,
31112         -
                long_value:
31113         -
                    ::std::option::Option::None
31114         -
                ,
31115         -
                float_value:
31116         -
                    ::std::option::Option::None
31117         -
                ,
31118         -
                double_value:
31119         -
                    ::std::option::Option::None
31120         -
                ,
31121         -
            }
31122         -
        ;
31123         -
        response };
31124         -
                                sender.send(()).await.expect("receiver dropped early");
31125         -
                                result
31126         -
                            }
31127         -
                        })
31128         -
                        .build_unchecked();
31129         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
31130         -
            .await
31131         -
            .expect("unable to make an HTTP request");
31132         -
        assert!(receiver.recv().await.is_some());
       25697  +
    #[::tracing_test::traced_test]
       25698  +
    async fn rest_json_invalid_json_body_case6_malformed_request() {
       25699  +
        {
       25700  +
            #[allow(unused_mut)]
       25701  +
            let mut http_request = http::Request::builder()
       25702  +
                .uri("/MalformedRequestBody")
       25703  +
                .method("POST")
       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  +
                ))
       25708  +
                .unwrap();
       25709  +
            #[allow(unused_mut)]
       25710  +
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       25711  +
            let config = crate::service::RestJsonConfig::builder().build();
       25712  +
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       25713  +
                            .malformed_request_body(move |input: crate::input::MalformedRequestBodyInput| {
       25714  +
                                let sender = sender.clone();
       25715  +
                                async move {
       25716  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedRequestBodyOutput };
       25717  +
                                    sender.send(()).await.expect("receiver dropped early");
       25718  +
                                    result
       25719  +
                                }
       25720  +
                            })
       25721  +
                            .build_unchecked();
       25722  +
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       25723  +
                .await
       25724  +
                .expect("unable to make an HTTP request");
       25725  +
            ::pretty_assertions::assert_eq!(
       25726  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
       25727  +
                http_response.status()
       25728  +
            );
       25729  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
       25730  +
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       25731  +
                http_response.headers(),
       25732  +
                expected_headers,
       25733  +
            ));
       25734  +
        }
31133  25735   
    }
31134         -
    /// Serializes simple scalar properties
31135         -
    /// Test ID: RestJsonSimpleScalarProperties
       25736  +
    /// When the request body is not valid JSON, the response should be a 400
       25737  +
    /// SerializationException.
       25738  +
    /// Test ID: RestJsonInvalidJsonBody_case7
31136  25739   
    #[::tokio::test]
31137         -
    async fn rest_json_simple_scalar_properties_response() {
31138         -
        let output = crate::output::SimpleScalarPropertiesOutput {
31139         -
            foo: ::std::option::Option::Some("Foo".to_owned()),
31140         -
            string_value: ::std::option::Option::Some("string".to_owned()),
31141         -
            true_boolean_value: ::std::option::Option::Some(true),
31142         -
            false_boolean_value: ::std::option::Option::Some(false),
31143         -
            byte_value: ::std::option::Option::Some(1),
31144         -
            short_value: ::std::option::Option::Some(2),
31145         -
            integer_value: ::std::option::Option::Some(3),
31146         -
            long_value: ::std::option::Option::Some(4),
31147         -
            float_value: ::std::option::Option::Some(5.5_f32),
31148         -
            double_value: ::std::option::Option::Some(6.5_f64),
31149         -
        };
31150         -
        use ::aws_smithy_http_server::response::IntoResponse;
31151         -
        let http_response = output.into_response();
31152         -
        ::pretty_assertions::assert_eq!(
31153         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
31154         -
            http_response.status()
31155         -
        );
31156         -
        let expected_headers = [("Content-Type", "application/json"), ("X-Foo", "Foo")];
31157         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
31158         -
            http_response.headers(),
31159         -
            expected_headers,
31160         -
        ));
31161         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
31162         -
            .await
31163         -
            .expect("unable to extract body to bytes");
31164         -
        ::aws_smithy_protocol_test::assert_ok(
31165         -
        ::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         -
        );
       25740  +
    #[::tracing_test::traced_test]
       25741  +
    async fn rest_json_invalid_json_body_case7_malformed_request() {
       25742  +
        {
       25743  +
            #[allow(unused_mut)]
       25744  +
            let mut http_request = http::Request::builder()
       25745  +
                .uri("/MalformedRequestBody")
       25746  +
                .method("POST")
       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  +
                ))
       25751  +
                .unwrap();
       25752  +
            #[allow(unused_mut)]
       25753  +
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       25754  +
            let config = crate::service::RestJsonConfig::builder().build();
       25755  +
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       25756  +
                            .malformed_request_body(move |input: crate::input::MalformedRequestBodyInput| {
       25757  +
                                let sender = sender.clone();
       25758  +
                                async move {
       25759  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedRequestBodyOutput };
       25760  +
                                    sender.send(()).await.expect("receiver dropped early");
       25761  +
                                    result
       25762  +
                                }
       25763  +
                            })
       25764  +
                            .build_unchecked();
       25765  +
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       25766  +
                .await
       25767  +
                .expect("unable to make an HTTP request");
       25768  +
            ::pretty_assertions::assert_eq!(
       25769  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
       25770  +
                http_response.status()
       25771  +
            );
       25772  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
       25773  +
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       25774  +
                http_response.headers(),
       25775  +
                expected_headers,
       25776  +
            ));
       25777  +
        }
31167  25778   
    }
31168         -
    /// Rest Json should not serialize null structure values
31169         -
    /// Test ID: RestJsonServersDontSerializeNullStructureValues
       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
31170  25782   
    #[::tokio::test]
31171         -
    async fn rest_json_servers_dont_serialize_null_structure_values_response() {
31172         -
        let output = crate::output::SimpleScalarPropertiesOutput {
31173         -
            string_value: ::std::option::Option::None,
31174         -
            foo: ::std::option::Option::None,
31175         -
            true_boolean_value: ::std::option::Option::None,
31176         -
            false_boolean_value: ::std::option::Option::None,
31177         -
            byte_value: ::std::option::Option::None,
31178         -
            short_value: ::std::option::Option::None,
31179         -
            integer_value: ::std::option::Option::None,
31180         -
            long_value: ::std::option::Option::None,
31181         -
            float_value: ::std::option::Option::None,
31182         -
            double_value: ::std::option::Option::None,
31183         -
        };
31184         -
        use ::aws_smithy_http_server::response::IntoResponse;
31185         -
        let http_response = output.into_response();
31186         -
        ::pretty_assertions::assert_eq!(
31187         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
31188         -
            http_response.status()
31189         -
        );
31190         -
        let expected_headers = [("Content-Type", "application/json")];
31191         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
31192         -
            http_response.headers(),
31193         -
            expected_headers,
31194         -
        ));
31195         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
31196         -
            .await
31197         -
            .expect("unable to extract body to bytes");
31198         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
31199         -
            &body,
31200         -
            "{}",
31201         -
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
31202         -
        ));
       25783  +
    #[::tracing_test::traced_test]
       25784  +
    async fn rest_json_technically_valid_json_body_case0_malformed_request() {
       25785  +
        {
       25786  +
            #[allow(unused_mut)]
       25787  +
            let mut http_request = http::Request::builder()
       25788  +
                .uri("/MalformedRequestBody")
       25789  +
                .method("POST")
       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  +
                ))
       25794  +
                .unwrap();
       25795  +
            #[allow(unused_mut)]
       25796  +
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       25797  +
            let config = crate::service::RestJsonConfig::builder().build();
       25798  +
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       25799  +
                            .malformed_request_body(move |input: crate::input::MalformedRequestBodyInput| {
       25800  +
                                let sender = sender.clone();
       25801  +
                                async move {
       25802  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedRequestBodyOutput };
       25803  +
                                    sender.send(()).await.expect("receiver dropped early");
       25804  +
                                    result
       25805  +
                                }
       25806  +
                            })
       25807  +
                            .build_unchecked();
       25808  +
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       25809  +
                .await
       25810  +
                .expect("unable to make an HTTP request");
       25811  +
            ::pretty_assertions::assert_eq!(
       25812  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
       25813  +
                http_response.status()
       25814  +
            );
       25815  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
       25816  +
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       25817  +
                http_response.headers(),
       25818  +
                expected_headers,
       25819  +
            ));
       25820  +
        }
31203  25821   
    }
31204         -
    /// Supports handling NaN float values.
31205         -
    /// Test ID: RestJsonSupportsNaNFloatInputs
       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
31206  25825   
    #[::tokio::test]
31207         -
    async fn rest_json_supports_na_n_float_inputs_response() {
31208         -
        let output = crate::output::SimpleScalarPropertiesOutput {
31209         -
            float_value: ::std::option::Option::Some(
31210         -
                <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("NaN")
31211         -
                    .expect("invalid string for number"),
31212         -
            ),
31213         -
            double_value: ::std::option::Option::Some(
31214         -
                <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("NaN")
31215         -
                    .expect("invalid string for number"),
31216         -
            ),
31217         -
            foo: ::std::option::Option::None,
31218         -
            string_value: ::std::option::Option::None,
31219         -
            true_boolean_value: ::std::option::Option::None,
31220         -
            false_boolean_value: ::std::option::Option::None,
31221         -
            byte_value: ::std::option::Option::None,
31222         -
            short_value: ::std::option::Option::None,
31223         -
            integer_value: ::std::option::Option::None,
31224         -
            long_value: ::std::option::Option::None,
31225         -
        };
31226         -
        use ::aws_smithy_http_server::response::IntoResponse;
31227         -
        let http_response = output.into_response();
31228         -
        ::pretty_assertions::assert_eq!(
31229         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
31230         -
            http_response.status()
31231         -
        );
31232         -
        let expected_headers = [("Content-Type", "application/json")];
31233         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
31234         -
            http_response.headers(),
31235         -
            expected_headers,
31236         -
        ));
31237         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
31238         -
            .await
31239         -
            .expect("unable to extract body to bytes");
31240         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
31241         -
            &body,
31242         -
            "{\n    \"floatValue\": \"NaN\",\n    \"DoubleDribble\": \"NaN\"\n}",
31243         -
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
31244         -
        ));
       25826  +
    #[::tracing_test::traced_test]
       25827  +
    async fn rest_json_technically_valid_json_body_case1_malformed_request() {
       25828  +
        {
       25829  +
            #[allow(unused_mut)]
       25830  +
            let mut http_request = http::Request::builder()
       25831  +
                .uri("/MalformedRequestBody")
       25832  +
                .method("POST")
       25833  +
                .header("content-type", "application/json")
       25834  +
                .body(::aws_smithy_http_server::body::Body::from(
       25835  +
                    ::bytes::Bytes::from_static("10".as_bytes()),
       25836  +
                ))
       25837  +
                .unwrap();
       25838  +
            #[allow(unused_mut)]
       25839  +
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       25840  +
            let config = crate::service::RestJsonConfig::builder().build();
       25841  +
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       25842  +
                            .malformed_request_body(move |input: crate::input::MalformedRequestBodyInput| {
       25843  +
                                let sender = sender.clone();
       25844  +
                                async move {
       25845  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedRequestBodyOutput };
       25846  +
                                    sender.send(()).await.expect("receiver dropped early");
       25847  +
                                    result
       25848  +
                                }
       25849  +
                            })
       25850  +
                            .build_unchecked();
       25851  +
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       25852  +
                .await
       25853  +
                .expect("unable to make an HTTP request");
       25854  +
            ::pretty_assertions::assert_eq!(
       25855  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
       25856  +
                http_response.status()
       25857  +
            );
       25858  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
       25859  +
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       25860  +
                http_response.headers(),
       25861  +
                expected_headers,
       25862  +
            ));
       25863  +
        }
31245  25864   
    }
31246         -
    /// Supports handling Infinity float values.
31247         -
    /// Test ID: RestJsonSupportsInfinityFloatInputs
       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
31248  25868   
    #[::tokio::test]
31249         -
    async fn rest_json_supports_infinity_float_inputs_response() {
31250         -
        let output = crate::output::SimpleScalarPropertiesOutput {
31251         -
            float_value: ::std::option::Option::Some(
31252         -
                <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("Infinity")
31253         -
                    .expect("invalid string for number"),
31254         -
            ),
31255         -
            double_value: ::std::option::Option::Some(
31256         -
                <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("Infinity")
31257         -
                    .expect("invalid string for number"),
31258         -
            ),
31259         -
            foo: ::std::option::Option::None,
31260         -
            string_value: ::std::option::Option::None,
31261         -
            true_boolean_value: ::std::option::Option::None,
31262         -
            false_boolean_value: ::std::option::Option::None,
31263         -
            byte_value: ::std::option::Option::None,
31264         -
            short_value: ::std::option::Option::None,
31265         -
            integer_value: ::std::option::Option::None,
31266         -
            long_value: ::std::option::Option::None,
31267         -
        };
31268         -
        use ::aws_smithy_http_server::response::IntoResponse;
31269         -
        let http_response = output.into_response();
31270         -
        ::pretty_assertions::assert_eq!(
31271         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
31272         -
            http_response.status()
31273         -
        );
31274         -
        let expected_headers = [("Content-Type", "application/json")];
31275         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
31276         -
            http_response.headers(),
31277         -
            expected_headers,
31278         -
        ));
31279         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
31280         -
            .await
31281         -
            .expect("unable to extract body to bytes");
31282         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
31283         -
            &body,
31284         -
            "{\n    \"floatValue\": \"Infinity\",\n    \"DoubleDribble\": \"Infinity\"\n}",
31285         -
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
31286         -
        ));
       25869  +
    #[::tracing_test::traced_test]
       25870  +
    async fn rest_json_technically_valid_json_body_case2_malformed_request() {
       25871  +
        {
       25872  +
            #[allow(unused_mut)]
       25873  +
            let mut http_request = http::Request::builder()
       25874  +
                .uri("/MalformedRequestBody")
       25875  +
                .method("POST")
       25876  +
                .header("content-type", "application/json")
       25877  +
                .body(::aws_smithy_http_server::body::Body::from(
       25878  +
                    ::bytes::Bytes::from_static("null".as_bytes()),
       25879  +
                ))
       25880  +
                .unwrap();
       25881  +
            #[allow(unused_mut)]
       25882  +
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       25883  +
            let config = crate::service::RestJsonConfig::builder().build();
       25884  +
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       25885  +
                            .malformed_request_body(move |input: crate::input::MalformedRequestBodyInput| {
       25886  +
                                let sender = sender.clone();
       25887  +
                                async move {
       25888  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedRequestBodyOutput };
       25889  +
                                    sender.send(()).await.expect("receiver dropped early");
       25890  +
                                    result
       25891  +
                                }
       25892  +
                            })
       25893  +
                            .build_unchecked();
       25894  +
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       25895  +
                .await
       25896  +
                .expect("unable to make an HTTP request");
       25897  +
            ::pretty_assertions::assert_eq!(
       25898  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
       25899  +
                http_response.status()
       25900  +
            );
       25901  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
       25902  +
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       25903  +
                http_response.headers(),
       25904  +
                expected_headers,
       25905  +
            ));
       25906  +
        }
31287  25907   
    }
31288         -
    /// Supports handling -Infinity float values.
31289         -
    /// Test ID: RestJsonSupportsNegativeInfinityFloatInputs
31290         -
    #[::tokio::test]
31291         -
    async fn rest_json_supports_negative_infinity_float_inputs_response() {
31292         -
        let output = crate::output::SimpleScalarPropertiesOutput {
31293         -
            float_value: ::std::option::Option::Some(
31294         -
                <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("-Infinity")
31295         -
                    .expect("invalid string for number"),
31296         -
            ),
31297         -
            double_value: ::std::option::Option::Some(
31298         -
                <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("-Infinity")
31299         -
                    .expect("invalid string for number"),
31300         -
            ),
31301         -
            foo: ::std::option::Option::None,
31302         -
            string_value: ::std::option::Option::None,
31303         -
            true_boolean_value: ::std::option::Option::None,
31304         -
            false_boolean_value: ::std::option::Option::None,
31305         -
            byte_value: ::std::option::Option::None,
31306         -
            short_value: ::std::option::Option::None,
31307         -
            integer_value: ::std::option::Option::None,
31308         -
            long_value: ::std::option::Option::None,
       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)
       25959  +
                            .await
       25960  +
                            .map_err(Into::into)
31309  25961   
        };
31310         -
        use ::aws_smithy_http_server::response::IntoResponse;
31311         -
        let http_response = output.into_response();
31312         -
        ::pretty_assertions::assert_eq!(
31313         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
31314         -
            http_response.status()
       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  +
            },
31315  25970   
        );
31316         -
        let expected_headers = [("Content-Type", "application/json")];
31317         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
31318         -
            http_response.headers(),
31319         -
            expected_headers,
31320         -
        ));
31321         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
31322         -
            .await
31323         -
            .expect("unable to extract body to bytes");
31324         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
31325         -
            &body,
31326         -
            "{\n    \"floatValue\": \"-Infinity\",\n    \"DoubleDribble\": \"-Infinity\"\n}",
31327         -
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
31328         -
        ));
       25971  +
        HttpChecksumRequiredInputFuture {
       25972  +
            inner: Box::pin(fut),
       25973  +
        }
31329  25974   
    }
31330  25975   
}
31331         -
#[cfg(test)]
       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  +
31332  25992   
#[allow(unreachable_code, unused_variables)]
31333         -
mod server_sparse_json_lists_test {
31334         -
    /// Serializes null values in sparse lists
31335         -
    /// Test ID: RestJsonSparseListsSerializeNull
       25993  +
#[cfg(test)]
       25994  +
mod http_checksum_required_test {
       25995  +
       25996  +
    /// Adds Content-MD5 header
       25997  +
    /// Test ID: RestJsonHttpChecksumRequired
31336  25998   
    #[::tokio::test]
31337         -
    async fn rest_json_sparse_lists_serialize_null_request() {
       25999  +
    #[::tracing_test::traced_test]
       26000  +
    async fn rest_json_http_checksum_required_request() {
31338  26001   
        #[allow(unused_mut)]
31339  26002   
        let mut http_request = http::Request::builder()
31340         -
            .uri("/SparseJsonLists")
31341         -
            .method("PUT")
       26003  +
            .uri("/HttpChecksumRequired")
       26004  +
            .method("POST")
       26005  +
            .header("Content-MD5", "iB0/3YSo7maijL0IGOgA9g==")
31342  26006   
            .header("Content-Type", "application/json")
31343  26007   
            .body(::aws_smithy_http_server::body::Body::from(
31344  26008   
                ::bytes::Bytes::from_static(
31345         -
                    "{\n    \"sparseStringList\": [\n        null,\n        \"hi\"\n    ]\n}"
31346         -
                        .as_bytes(),
       26009  +
                    "{\n    \"foo\":\"base64 encoded md5 checksum\"\n}\n".as_bytes(),
31347  26010   
                ),
31348  26011   
            ))
31349  26012   
            .unwrap();
31350  26013   
        #[allow(unused_mut)]
31351  26014   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
31352  26015   
        let config = crate::service::RestJsonConfig::builder().build();
31353  26016   
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
31354         -
            .sparse_json_lists(move |input: crate::input::SparseJsonListsInput| {
       26017  +
            .http_checksum_required(move |input: crate::input::HttpChecksumRequiredInput| {
31355  26018   
                let sender = sender.clone();
31356  26019   
                async move {
31357  26020   
                    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         -
                            ]),
       26021  +
                        let expected = crate::input::HttpChecksumRequiredInput {
       26022  +
                            foo: ::std::option::Option::Some(
       26023  +
                                "base64 encoded md5 checksum".to_owned(),
       26024  +
                            ),
31363  26025   
                        };
31364  26026   
                        ::pretty_assertions::assert_eq!(input, expected);
31365         -
                        let response = crate::output::SparseJsonListsOutput {
31366         -
                            sparse_string_list: ::std::option::Option::None,
       26027  +
                        let response = crate::output::HttpChecksumRequiredOutput {
       26028  +
                            foo: ::std::option::Option::None,
31367  26029   
                        };
31368  26030   
                        response
31369  26031   
                    };
31370  26032   
                    sender.send(()).await.expect("receiver dropped early");
31371  26033   
                    result
31372  26034   
                }
31373  26035   
            })
31374  26036   
            .build_unchecked();
31375  26037   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
31376  26038   
            .await
31377  26039   
            .expect("unable to make an HTTP request");
31378         -
        assert!(receiver.recv().await.is_some());
       26040  +
        assert!(
       26041  +
            receiver.recv().await.is_some(),
       26042  +
            "we expected operation handler to be invoked but it was not entered"
       26043  +
        );
31379  26044   
    }
31380         -
    /// Serializes null values in sparse lists
31381         -
    /// Test ID: RestJsonSparseListsSerializeNull
31382         -
    #[::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         -
            ]),
       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>>
       26053  +
    }
       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,
       26092  +
            ) {
       26093  +
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
       26094  +
            }
       26095  +
            crate::protocol_serde::shape_host_with_path_operation::de_host_with_path_operation_http_request(request)
       26096  +
                            .await
       26097  +
                            .map_err(Into::into)
31389  26098   
        };
31390         -
        use ::aws_smithy_http_server::response::IntoResponse;
31391         -
        let http_response = output.into_response();
31392         -
        ::pretty_assertions::assert_eq!(
31393         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
31394         -
            http_response.status()
       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  +
            },
31395  26107   
        );
31396         -
        let expected_headers = [("Content-Type", "application/json")];
31397         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
31398         -
            http_response.headers(),
31399         -
            expected_headers,
31400         -
        ));
31401         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
31402         -
            .await
31403         -
            .expect("unable to extract body to bytes");
31404         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
31405         -
            &body,
31406         -
            "{\n    \"sparseStringList\": [\n        null,\n        \"hi\"\n    ]\n}",
31407         -
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
31408         -
        ));
       26108  +
        HostWithPathOperationInputFuture {
       26109  +
            inner: Box::pin(fut),
       26110  +
        }
31409  26111   
    }
31410  26112   
}
31411         -
#[cfg(test)]
31412         -
#[allow(unreachable_code, unused_variables)]
31413         -
mod server_sparse_json_maps_test {
31414         -
    /// Serializes JSON maps
31415         -
    /// Test ID: RestJsonSparseJsonMaps
31416         -
    #[::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)
31463         -
                    };
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)
31470         -
            .await
31471         -
            .expect("unable to make an HTTP request");
31472         -
        assert!(receiver.recv().await.is_some());
       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  +
                    }
31473  26126   
    }
31474         -
    /// Serializes JSON map values in sparse maps
31475         -
    /// Test ID: RestJsonSerializesSparseNullMapValues
31476         -
    #[::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
31512         -
                            }),
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         -
                    };
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)
31531         -
            .await
31532         -
            .expect("unable to make an HTTP request");
31533         -
        assert!(receiver.recv().await.is_some());
       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>>
31534  26135   
    }
31535         -
    /// Ensure that 0 and false are sent over the wire in all maps and lists
31536         -
    /// Test ID: RestJsonSerializesZeroValuesInSparseMaps
31537         -
    #[::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());
       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)
31587  26150   
    }
31588         -
    /// A request that contains a sparse map of sets
31589         -
    /// Test ID: RestJsonSerializesSparseSetMap
       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,
       26174  +
            ) {
       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
31590  26237   
    #[::tokio::test]
31591         -
    async fn rest_json_serializes_sparse_set_map_request() {
       26238  +
    #[::tracing_test::traced_test]
       26239  +
    #[should_panic]
       26240  +
    async fn rest_json_endpoint_trait_with_host_label_request() {
31592  26241   
        #[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();
       26242  +
        let mut http_request = http::Request::builder()
       26243  +
            .uri("/EndpointWithHostLabelOperation")
       26244  +
            .method("POST")
       26245  +
            .body(::aws_smithy_http_server::body::Body::from(
       26246  +
                ::bytes::Bytes::from_static("{\"label\": \"bar\"}".as_bytes()),
       26247  +
            ))
       26248  +
            .unwrap();
       26249  +
        todo!("endpoint trait not supported yet");
31598  26250   
        #[allow(unused_mut)]
31599  26251   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
31600  26252   
        let config = crate::service::RestJsonConfig::builder().build();
31601  26253   
        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,
       26254  +
            .endpoint_with_host_label_operation(
       26255  +
                move |input: crate::input::EndpointWithHostLabelOperationInput| {
       26256  +
                    let sender = sender.clone();
       26257  +
                    async move {
       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)
31637  26265   
                        };
31638         -
                        Ok(response)
31639         -
                    };
31640         -
                    sender.send(()).await.expect("receiver dropped early");
31641         -
                    result
31642         -
                }
31643         -
            })
       26266  +
                        sender.send(()).await.expect("receiver dropped early");
       26267  +
                        result
       26268  +
                    }
       26269  +
                },
       26270  +
            )
31644  26271   
            .build_unchecked();
31645  26272   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
31646  26273   
            .await
31647  26274   
            .expect("unable to make an HTTP request");
31648         -
        assert!(receiver.recv().await.is_some());
       26275  +
        assert!(
       26276  +
            receiver.recv().await.is_some(),
       26277  +
            "we expected operation handler to be invoked but it was not entered"
       26278  +
        );
31649  26279   
    }
31650         -
    /// A request that contains a sparse map of sets.
31651         -
    /// Test ID: RestJsonSerializesSparseSetMapAndRetainsNull
       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>>
       26288  +
    }
       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,
       26327  +
            ) {
       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
31652  26375   
    #[::tokio::test]
31653         -
    async fn rest_json_serializes_sparse_set_map_and_retains_null_request() {
       26376  +
    #[::tracing_test::traced_test]
       26377  +
    #[should_panic]
       26378  +
    async fn rest_json_endpoint_trait_request() {
31654  26379   
        #[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();
       26380  +
        let mut http_request = http::Request::builder()
       26381  +
            .uri("/EndpointOperation")
       26382  +
            .method("POST")
       26383  +
            .body(::aws_smithy_http_server::body::Body::from(
       26384  +
                ::bytes::Bytes::from_static("".as_bytes()),
       26385  +
            ))
       26386  +
            .unwrap();
       26387  +
        todo!("endpoint trait not supported yet");
31660  26388   
        #[allow(unused_mut)]
31661  26389   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
31662  26390   
        let config = crate::service::RestJsonConfig::builder().build();
31663  26391   
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
31664         -
            .sparse_json_maps(move |input: crate::input::SparseJsonMapsInput| {
       26392  +
            .endpoint_operation(move |input: crate::input::EndpointOperationInput| {
31665  26393   
                let sender = sender.clone();
31666  26394   
                async move {
31667  26395   
                    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         -
                        };
       26396  +
                        let expected = crate::input::EndpointOperationInput {};
31693  26397   
                        ::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)
       26398  +
                        let response = crate::output::EndpointOperationOutput {};
       26399  +
                        response
31702  26400   
                    };
31703  26401   
                    sender.send(()).await.expect("receiver dropped early");
31704  26402   
                    result
31705  26403   
                }
31706  26404   
            })
31707  26405   
            .build_unchecked();
31708  26406   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
31709  26407   
            .await
31710  26408   
            .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,
31738         -
        };
31739         -
        use ::aws_smithy_http_server::response::IntoResponse;
31740         -
        let http_response = output.into_response();
31741         -
        ::pretty_assertions::assert_eq!(
31742         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
31743         -
            http_response.status()
31744         -
        );
31745         -
        let expected_headers = [("Content-Type", "application/json")];
31746         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
31747         -
            http_response.headers(),
31748         -
            expected_headers,
31749         -
        ));
31750         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
31751         -
            .await
31752         -
            .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"))
       26409  +
        assert!(
       26410  +
            receiver.recv().await.is_some(),
       26411  +
            "we expected operation handler to be invoked but it was not entered"
31755  26412   
        );
31756  26413   
    }
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,
31794         -
        ));
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         -
        );
       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>>
31801  26422   
    }
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         -
        );
       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)
31838  26437   
    }
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,
       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,
       26461  +
            ) {
       26462  +
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
       26463  +
            }
       26464  +
            crate::protocol_serde::shape_post_union_with_json_name::de_post_union_with_json_name_http_request(request)
       26465  +
                            .await
       26466  +
                            .map_err(Into::into)
31866  26467   
        };
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"))
       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  +
            },
31883  26476   
        );
       26477  +
        PostUnionWithJsonNameInputFuture {
       26478  +
            inner: Box::pin(fut),
       26479  +
        }
31884  26480   
    }
31885         -
    /// A response that contains a sparse map of sets.
31886         -
    /// Test ID: RestJsonDeserializesSparseSetMapAndRetainsNull
       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
31887  26504   
    #[::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())
       26505  +
    #[::tracing_test::traced_test]
       26506  +
    async fn post_union_with_json_name_request1_request() {
       26507  +
        #[allow(unused_mut)]
       26508  +
        let mut http_request = http::Request::builder()
       26509  +
            .uri("/PostUnionWithJsonName")
       26510  +
            .method("POST")
       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  +
            ))
       26517  +
            .unwrap();
       26518  +
        #[allow(unused_mut)]
       26519  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       26520  +
        let config = crate::service::RestJsonConfig::builder().build();
       26521  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       26522  +
            .post_union_with_json_name(move |input: crate::input::PostUnionWithJsonNameInput| {
       26523  +
                let sender = sender.clone();
       26524  +
                async move {
       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  +
                    };
       26537  +
                    sender.send(()).await.expect("receiver dropped early");
       26538  +
                    result
       26539  +
                }
       26540  +
            })
       26541  +
            .build_unchecked();
       26542  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
31926  26543   
            .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"))
       26544  +
            .expect("unable to make an HTTP request");
       26545  +
        assert!(
       26546  +
            receiver.recv().await.is_some(),
       26547  +
            "we expected operation handler to be invoked but it was not entered"
31930  26548   
        );
31931  26549   
    }
31932         -
}
31933         -
#[cfg(test)]
31934         -
#[allow(unreachable_code, unused_variables)]
31935         -
mod server_streaming_traits_test {
31936         -
    /// Serializes a blob in the HTTP payload
31937         -
    /// Test ID: RestJsonStreamingTraitsWithBlob
       26550  +
    /// Tests that jsonName works with union members.
       26551  +
    /// Test ID: PostUnionWithJsonNameRequest2
31938  26552   
    #[::tokio::test]
31939         -
    async fn rest_json_streaming_traits_with_blob_request() {
       26553  +
    #[::tracing_test::traced_test]
       26554  +
    async fn post_union_with_json_name_request2_request() {
31940  26555   
        #[allow(unused_mut)]
31941  26556   
        let mut http_request = http::Request::builder()
31942         -
            .uri("/StreamingTraits")
       26557  +
            .uri("/PostUnionWithJsonName")
31943  26558   
            .method("POST")
31944         -
            .header("Content-Type", "application/octet-stream")
31945         -
            .header("X-Foo", "Foo")
       26559  +
            .header("Content-Type", "application/json")
31946  26560   
            .body(::aws_smithy_http_server::body::Body::from(
31947         -
                ::bytes::Bytes::from_static("blobby blob blob".as_bytes()),
       26561  +
                ::bytes::Bytes::from_static(
       26562  +
                    "{\n    \"value\": {\n        \"_baz\": \"hi\"\n    }\n}".as_bytes(),
       26563  +
                ),
31948  26564   
            ))
31949  26565   
            .unwrap();
31950  26566   
        #[allow(unused_mut)]
31951  26567   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
31952  26568   
        let config = crate::service::RestJsonConfig::builder().build();
31953  26569   
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
31954         -
            .streaming_traits(move |input: crate::input::StreamingTraitsInput| {
       26570  +
            .post_union_with_json_name(move |input: crate::input::PostUnionWithJsonNameInput| {
31955  26571   
                let sender = sender.clone();
31956  26572   
                async move {
31957  26573   
                    let result = {
31958         -
                        let expected = crate::input::StreamingTraitsInput {
31959         -
                            foo: ::std::option::Option::Some("Foo".to_owned()),
31960         -
                            blob: ::aws_smithy_types::byte_stream::ByteStream::from_static(
31961         -
                                b"blobby blob blob",
       26574  +
                        let expected = crate::input::PostUnionWithJsonNameInput {
       26575  +
                            value: ::std::option::Option::Some(
       26576  +
                                crate::model::UnionWithJsonName::Baz("hi".to_owned()),
31962  26577   
                            ),
31963  26578   
                        };
31964         -
                        ::pretty_assertions::assert_eq!(
31965         -
                            input.foo,
31966         -
                            expected.foo,
31967         -
                            "Unexpected value for `foo`"
31968         -
                        );
31969         -
                        ::pretty_assertions::assert_eq!(
31970         -
                            input.blob.collect().await.unwrap().into_bytes(),
31971         -
                            expected.blob.collect().await.unwrap().into_bytes()
31972         -
                        );
31973         -
                        let response = crate::output::StreamingTraitsOutput {
31974         -
                            blob: ::aws_smithy_types::byte_stream::ByteStream::from_static(b""),
31975         -
                            foo: ::std::option::Option::None,
       26579  +
                        ::pretty_assertions::assert_eq!(input, expected);
       26580  +
                        let response = crate::output::PostUnionWithJsonNameOutput {
       26581  +
                            value: crate::model::UnionWithJsonName::Foo("".to_owned()),
31976  26582   
                        };
31977  26583   
                        response
31978  26584   
                    };
31979  26585   
                    sender.send(()).await.expect("receiver dropped early");
31980  26586   
                    result
31981  26587   
                }
31982  26588   
            })
31983  26589   
            .build_unchecked();
31984  26590   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
31985  26591   
            .await
31986  26592   
            .expect("unable to make an HTTP request");
31987         -
        assert!(receiver.recv().await.is_some());
       26593  +
        assert!(
       26594  +
            receiver.recv().await.is_some(),
       26595  +
            "we expected operation handler to be invoked but it was not entered"
       26596  +
        );
31988  26597   
    }
31989         -
    /// Serializes an empty blob in the HTTP payload
31990         -
    /// Test ID: RestJsonStreamingTraitsWithNoBlobBody
       26598  +
    /// Tests that jsonName works with union members.
       26599  +
    /// Test ID: PostUnionWithJsonNameRequest3
31991  26600   
    #[::tokio::test]
31992         -
    async fn rest_json_streaming_traits_with_no_blob_body_request() {
       26601  +
    #[::tracing_test::traced_test]
       26602  +
    async fn post_union_with_json_name_request3_request() {
31993  26603   
        #[allow(unused_mut)]
31994  26604   
        let mut http_request = http::Request::builder()
31995         -
            .uri("/StreamingTraits")
       26605  +
            .uri("/PostUnionWithJsonName")
31996  26606   
            .method("POST")
31997         -
            .header("X-Foo", "Foo")
       26607  +
            .header("Content-Type", "application/json")
31998  26608   
            .body(::aws_smithy_http_server::body::Body::from(
31999         -
                ::bytes::Bytes::from_static("".as_bytes()),
       26609  +
                ::bytes::Bytes::from_static(
       26610  +
                    "{\n    \"value\": {\n        \"bar\": \"hi\"\n    }\n}".as_bytes(),
       26611  +
                ),
32000  26612   
            ))
32001  26613   
            .unwrap();
32002  26614   
        #[allow(unused_mut)]
32003  26615   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
32004  26616   
        let config = crate::service::RestJsonConfig::builder().build();
32005  26617   
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
32006         -
            .streaming_traits(move |input: crate::input::StreamingTraitsInput| {
       26618  +
            .post_union_with_json_name(move |input: crate::input::PostUnionWithJsonNameInput| {
32007  26619   
                let sender = sender.clone();
32008  26620   
                async move {
32009  26621   
                    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()),
       26622  +
                        let expected = crate::input::PostUnionWithJsonNameInput {
       26623  +
                            value: ::std::option::Option::Some(
       26624  +
                                crate::model::UnionWithJsonName::Bar("hi".to_owned()),
       26625  +
                            ),
32013  26626   
                        };
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,
       26627  +
                        ::pretty_assertions::assert_eq!(input, expected);
       26628  +
                        let response = crate::output::PostUnionWithJsonNameOutput {
       26629  +
                            value: crate::model::UnionWithJsonName::Foo("".to_owned()),
32026  26630   
                        };
32027  26631   
                        response
32028  26632   
                    };
32029  26633   
                    sender.send(()).await.expect("receiver dropped early");
32030  26634   
                    result
32031  26635   
                }
32032  26636   
            })
32033  26637   
            .build_unchecked();
32034  26638   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
32035  26639   
            .await
32036  26640   
            .expect("unable to make an HTTP request");
32037         -
        assert!(receiver.recv().await.is_some());
       26641  +
        assert!(
       26642  +
            receiver.recv().await.is_some(),
       26643  +
            "we expected operation handler to be invoked but it was not entered"
       26644  +
        );
32038  26645   
    }
32039         -
    /// Serializes a blob in the HTTP payload
32040         -
    /// Test ID: RestJsonStreamingTraitsWithBlob
       26646  +
    /// Tests that jsonName works with union members.
       26647  +
    /// Test ID: PostUnionWithJsonNameResponse1
32041  26648   
    #[::tokio::test]
32042         -
    async fn rest_json_streaming_traits_with_blob_response() {
32043         -
        let output = crate::output::StreamingTraitsOutput {
32044         -
            foo: ::std::option::Option::Some("Foo".to_owned()),
32045         -
            blob: ::aws_smithy_types::byte_stream::ByteStream::from_static(b"blobby blob blob"),
       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()),
32046  26653   
        };
32047  26654   
        use ::aws_smithy_http_server::response::IntoResponse;
32048  26655   
        let http_response = output.into_response();
32049  26656   
        ::pretty_assertions::assert_eq!(
32050  26657   
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
32051  26658   
            http_response.status()
32052  26659   
        );
32053         -
        let expected_headers = [
32054         -
            ("Content-Type", "application/octet-stream"),
32055         -
            ("X-Foo", "Foo"),
32056         -
        ];
       26660  +
        let expected_headers = [("Content-Type", "application/json")];
32057  26661   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
32058  26662   
            http_response.headers(),
32059  26663   
            expected_headers,
32060  26664   
        ));
32061  26665   
        let body = ::hyper::body::to_bytes(http_response.into_body())
32062  26666   
            .await
32063  26667   
            .expect("unable to extract body to bytes");
32064  26668   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
32065  26669   
            &body,
32066         -
            "blobby blob blob",
32067         -
            ::aws_smithy_protocol_test::MediaType::from("application/octet-stream"),
       26670  +
            "{\n    \"value\": {\n        \"FOO\": \"hi\"\n    }\n}",
       26671  +
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
32068  26672   
        ));
32069  26673   
    }
32070         -
    /// Serializes an empty blob in the HTTP payload
32071         -
    /// Test ID: RestJsonStreamingTraitsWithNoBlobBody
       26674  +
    /// Tests that jsonName works with union members.
       26675  +
    /// Test ID: PostUnionWithJsonNameResponse2
32072  26676   
    #[::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()),
       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()),
32077  26681   
        };
32078  26682   
        use ::aws_smithy_http_server::response::IntoResponse;
32079  26683   
        let http_response = output.into_response();
32080  26684   
        ::pretty_assertions::assert_eq!(
32081  26685   
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
32082  26686   
            http_response.status()
32083  26687   
        );
32084         -
        let expected_headers = [("X-Foo", "Foo")];
       26688  +
        let expected_headers = [("Content-Type", "application/json")];
32085  26689   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
32086  26690   
            http_response.headers(),
32087  26691   
            expected_headers,
32088  26692   
        ));
32089  26693   
        let body = ::hyper::body::to_bytes(http_response.into_body())
32090  26694   
            .await
32091  26695   
            .expect("unable to extract body to bytes");
32092         -
        // No body.
32093         -
        ::pretty_assertions::assert_eq!(std::str::from_utf8(&body).unwrap(), "");
32094         -
    }
32095         -
}
32096         -
#[cfg(test)]
32097         -
#[allow(unreachable_code, unused_variables)]
32098         -
mod server_streaming_traits_require_length_test {
32099         -
    /// Serializes a blob in the HTTP payload with a required length
32100         -
    /// Test ID: RestJsonStreamingTraitsRequireLengthWithBlob
32101         -
    #[::tokio::test]
32102         -
    async fn rest_json_streaming_traits_require_length_with_blob_request() {
32103         -
        #[allow(unused_mut)]
32104         -
        let mut http_request = http::Request::builder()
32105         -
            .uri("/StreamingTraitsRequireLength")
32106         -
            .method("POST")
32107         -
            .header("Content-Type", "application/octet-stream")
32108         -
            .header("X-Foo", "Foo")
32109         -
            .body(::aws_smithy_http_server::body::Body::from(
32110         -
                ::bytes::Bytes::from_static("blobby blob blob".as_bytes()),
32111         -
            ))
32112         -
            .unwrap();
32113         -
        #[allow(unused_mut)]
32114         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
32115         -
        let config = crate::service::RestJsonConfig::builder().build();
32116         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
32117         -
            .streaming_traits_require_length(
32118         -
                move |input: crate::input::StreamingTraitsRequireLengthInput| {
32119         -
                    let sender = sender.clone();
32120         -
                    async move {
32121         -
                        let result = {
32122         -
                            let expected = crate::input::StreamingTraitsRequireLengthInput {
32123         -
                                foo: ::std::option::Option::Some("Foo".to_owned()),
32124         -
                                blob: ::aws_smithy_types::byte_stream::ByteStream::from_static(
32125         -
                                    b"blobby blob blob",
32126         -
                                ),
32127         -
                            };
32128         -
                            ::pretty_assertions::assert_eq!(
32129         -
                                input.foo,
32130         -
                                expected.foo,
32131         -
                                "Unexpected value for `foo`"
32132         -
                            );
32133         -
                            ::pretty_assertions::assert_eq!(
32134         -
                                input.blob.collect().await.unwrap().into_bytes(),
32135         -
                                expected.blob.collect().await.unwrap().into_bytes()
32136         -
                            );
32137         -
                            let response = crate::output::StreamingTraitsRequireLengthOutput {};
32138         -
                            response
32139         -
                        };
32140         -
                        sender.send(()).await.expect("receiver dropped early");
32141         -
                        result
32142         -
                    }
32143         -
                },
32144         -
            )
32145         -
            .build_unchecked();
32146         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
32147         -
            .await
32148         -
            .expect("unable to make an HTTP request");
32149         -
        assert!(receiver.recv().await.is_some());
32150         -
    }
32151         -
    /// Serializes an empty blob in the HTTP payload
32152         -
    /// Test ID: RestJsonStreamingTraitsRequireLengthWithNoBlobBody
32153         -
    #[::tokio::test]
32154         -
    async fn rest_json_streaming_traits_require_length_with_no_blob_body_request() {
32155         -
        #[allow(unused_mut)]
32156         -
        let mut http_request = http::Request::builder()
32157         -
            .uri("/StreamingTraitsRequireLength")
32158         -
            .method("POST")
32159         -
            .header("X-Foo", "Foo")
32160         -
            .body(::aws_smithy_http_server::body::Body::from(
32161         -
                ::bytes::Bytes::from_static("".as_bytes()),
32162         -
            ))
32163         -
            .unwrap();
32164         -
        #[allow(unused_mut)]
32165         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
32166         -
        let config = crate::service::RestJsonConfig::builder().build();
32167         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
32168         -
            .streaming_traits_require_length(
32169         -
                move |input: crate::input::StreamingTraitsRequireLengthInput| {
32170         -
                    let sender = sender.clone();
32171         -
                    async move {
32172         -
                        let result = {
32173         -
                            let expected = crate::input::StreamingTraitsRequireLengthInput {
32174         -
                                blob: ::aws_smithy_types::byte_stream::ByteStream::from_static(b""),
32175         -
                                foo: ::std::option::Option::Some("Foo".to_owned()),
32176         -
                            };
32177         -
                            ::pretty_assertions::assert_eq!(
32178         -
                                input.foo,
32179         -
                                expected.foo,
32180         -
                                "Unexpected value for `foo`"
32181         -
                            );
32182         -
                            ::pretty_assertions::assert_eq!(
32183         -
                                input.blob.collect().await.unwrap().into_bytes(),
32184         -
                                expected.blob.collect().await.unwrap().into_bytes()
32185         -
                            );
32186         -
                            let response = crate::output::StreamingTraitsRequireLengthOutput {};
32187         -
                            response
32188         -
                        };
32189         -
                        sender.send(()).await.expect("receiver dropped early");
32190         -
                        result
32191         -
                    }
32192         -
                },
32193         -
            )
32194         -
            .build_unchecked();
32195         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
32196         -
            .await
32197         -
            .expect("unable to make an HTTP request");
32198         -
        assert!(receiver.recv().await.is_some());
32199         -
    }
32200         -
}
32201         -
#[cfg(test)]
32202         -
#[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
32206         -
    #[::tokio::test]
32207         -
    async fn rest_json_streaming_traits_with_media_type_with_blob_request() {
32208         -
        #[allow(unused_mut)]
32209         -
        let mut http_request = http::Request::builder()
32210         -
            .uri("/StreamingTraitsWithMediaType")
32211         -
            .method("POST")
32212         -
            .header("Content-Type", "text/plain")
32213         -
            .header("X-Foo", "Foo")
32214         -
            .body(::aws_smithy_http_server::body::Body::from(
32215         -
                ::bytes::Bytes::from_static("blobby blob blob".as_bytes()),
32216         -
            ))
32217         -
            .unwrap();
32218         -
        #[allow(unused_mut)]
32219         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
32220         -
        let config = crate::service::RestJsonConfig::builder().build();
32221         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
32222         -
            .streaming_traits_with_media_type(
32223         -
                move |input: crate::input::StreamingTraitsWithMediaTypeInput| {
32224         -
                    let sender = sender.clone();
32225         -
                    async move {
32226         -
                        let result = {
32227         -
                            let expected = crate::input::StreamingTraitsWithMediaTypeInput {
32228         -
                                foo: ::std::option::Option::Some("Foo".to_owned()),
32229         -
                                blob: ::aws_smithy_types::byte_stream::ByteStream::from_static(
32230         -
                                    b"blobby blob blob",
32231         -
                                ),
32232         -
                            };
32233         -
                            ::pretty_assertions::assert_eq!(
32234         -
                                input.foo,
32235         -
                                expected.foo,
32236         -
                                "Unexpected value for `foo`"
32237         -
                            );
32238         -
                            ::pretty_assertions::assert_eq!(
32239         -
                                input.blob.collect().await.unwrap().into_bytes(),
32240         -
                                expected.blob.collect().await.unwrap().into_bytes()
32241         -
                            );
32242         -
                            let response = crate::output::StreamingTraitsWithMediaTypeOutput {
32243         -
                                blob: ::aws_smithy_types::byte_stream::ByteStream::from_static(b""),
32244         -
                                foo: ::std::option::Option::None,
32245         -
                            };
32246         -
                            response
32247         -
                        };
32248         -
                        sender.send(()).await.expect("receiver dropped early");
32249         -
                        result
32250         -
                    }
32251         -
                },
32252         -
            )
32253         -
            .build_unchecked();
32254         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
32255         -
            .await
32256         -
            .expect("unable to make an HTTP request");
32257         -
        assert!(receiver.recv().await.is_some());
       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  +
        ));
32258  26701   
    }
32259         -
    /// Serializes a blob in the HTTP payload with a content-type
32260         -
    /// Test ID: RestJsonStreamingTraitsWithMediaTypeWithBlob
       26702  +
    /// Tests that jsonName works with union members.
       26703  +
    /// Test ID: PostUnionWithJsonNameResponse3
32261  26704   
    #[::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"),
       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()),
32266  26709   
        };
32267  26710   
        use ::aws_smithy_http_server::response::IntoResponse;
32268  26711   
        let http_response = output.into_response();
32269  26712   
        ::pretty_assertions::assert_eq!(
32270  26713   
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
32271  26714   
            http_response.status()
32272  26715   
        );
32273         -
        let expected_headers = [("Content-Type", "text/plain"), ("X-Foo", "Foo")];
       26716  +
        let expected_headers = [("Content-Type", "application/json")];
32274  26717   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
32275  26718   
            http_response.headers(),
32276  26719   
            expected_headers,
32277  26720   
        ));
32278  26721   
        let body = ::hyper::body::to_bytes(http_response.into_body())
32279  26722   
            .await
32280  26723   
            .expect("unable to extract body to bytes");
32281  26724   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
32282  26725   
            &body,
32283         -
            "blobby blob blob",
32284         -
            ::aws_smithy_protocol_test::MediaType::from("application/octet-stream"),
       26726  +
            "{\n    \"value\": {\n        \"bar\": \"hi\"\n    }\n}",
       26727  +
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
32285  26728   
        ));
32286  26729   
    }
32287  26730   
}
32288         -
#[cfg(test)]
32289         -
#[allow(unreachable_code, unused_variables)]
32290         -
mod server_test_body_structure_test {
32291         -
    /// Serializes a structure
32292         -
    /// Test ID: RestJsonTestBodyStructure
32293         -
    #[::tokio::test]
32294         -
    async fn rest_json_test_body_structure_request() {
32295         -
        #[allow(unused_mut)]
32296         -
        let mut http_request = http::Request::builder()
32297         -
            .uri("/body")
32298         -
            .method("POST")
32299         -
            .header("Content-Type", "application/json")
32300         -
            .body(::aws_smithy_http_server::body::Body::from(
32301         -
                ::bytes::Bytes::from_static(
32302         -
                    "{\"testConfig\":\n    {\"timeout\": 10}\n}".as_bytes(),
32303         -
                ),
32304         -
            ))
32305         -
            .unwrap();
32306         -
        #[allow(unused_mut)]
32307         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
32308         -
        let config = crate::service::RestJsonConfig::builder().build();
32309         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
32310         -
            .test_body_structure(move |input: crate::input::TestBodyStructureInput| {
32311         -
                let sender = sender.clone();
32312         -
                async move {
32313         -
                    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,
32319         -
                        };
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,
32324         -
                        };
32325         -
                        response
32326         -
                    };
32327         -
                    sender.send(()).await.expect("receiver dropped early");
32328         -
                    result
32329         -
                }
32330         -
            })
32331         -
            .build_unchecked();
32332         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
32333         -
            .await
32334         -
            .expect("unable to make an HTTP request");
32335         -
        assert!(receiver.recv().await.is_some());
       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>>
32336  26738   
    }
32337         -
    /// Serializes an empty structure in the body
32338         -
    /// Test ID: RestJsonHttpWithEmptyBody
32339         -
    #[::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
32368         -
                    };
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)
       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  +
            )
32375  26783   
            .await
32376         -
            .expect("unable to make an HTTP request");
32377         -
        assert!(receiver.recv().await.is_some());
       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  +
        }
32378  26798   
    }
32379  26799   
}
32380         -
#[cfg(test)]
       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  +
32381  26818   
#[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
       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
32385  26824   
    #[::tokio::test]
32386         -
    async fn rest_json_http_with_no_modeled_body_request() {
       26825  +
    #[::tracing_test::traced_test]
       26826  +
    async fn rest_json_input_union_with_unit_member_request() {
32387  26827   
        #[allow(unused_mut)]
32388  26828   
        let mut http_request = http::Request::builder()
32389         -
            .uri("/no_payload")
32390         -
            .method("GET")
       26829  +
            .uri("/PostPlayerAction")
       26830  +
            .method("POST")
       26831  +
            .header("Content-Type", "application/json")
32391  26832   
            .body(::aws_smithy_http_server::body::Body::from(
32392         -
                ::bytes::Bytes::from_static("".as_bytes()),
       26833  +
                ::bytes::Bytes::from_static(
       26834  +
                    "{\n    \"action\": {\n        \"quit\": {}\n    }\n}".as_bytes(),
       26835  +
                ),
32393  26836   
            ))
32394  26837   
            .unwrap();
32395  26838   
        #[allow(unused_mut)]
32396  26839   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
32397  26840   
        let config = crate::service::RestJsonConfig::builder().build();
32398  26841   
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
32399         -
            .test_no_payload(move |input: crate::input::TestNoPayloadInput| {
       26842  +
            .post_player_action(move |input: crate::input::PostPlayerActionInput| {
32400  26843   
                let sender = sender.clone();
32401  26844   
                async move {
32402  26845   
                    let result = {
32403         -
                        let expected = crate::input::TestNoPayloadInput {
32404         -
                            test_id: ::std::option::Option::None,
       26846  +
                        let expected = crate::input::PostPlayerActionInput {
       26847  +
                            action: ::std::option::Option::Some(crate::model::PlayerAction::Quit),
32405  26848   
                        };
32406  26849   
                        ::pretty_assertions::assert_eq!(input, expected);
32407         -
                        let response = crate::output::TestNoPayloadOutput {
32408         -
                            test_id: ::std::option::Option::None,
       26850  +
                        let response = crate::output::PostPlayerActionOutput {
       26851  +
                            action: crate::model::PlayerAction::Quit,
32409  26852   
                        };
32410  26853   
                        response
32411  26854   
                    };
32412  26855   
                    sender.send(()).await.expect("receiver dropped early");
32413  26856   
                    result
32414  26857   
                }
32415  26858   
            })
32416  26859   
            .build_unchecked();
32417  26860   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
32418  26861   
            .await
32419  26862   
            .expect("unable to make an HTTP request");
32420         -
        assert!(receiver.recv().await.is_some());
       26863  +
        assert!(
       26864  +
            receiver.recv().await.is_some(),
       26865  +
            "we expected operation handler to be invoked but it was not entered"
       26866  +
        );
32421  26867   
    }
32422         -
    /// Serializes a GET request with header member but no modeled body
32423         -
    /// Test ID: RestJsonHttpWithHeaderMemberNoModeledBody
       26868  +
    /// Unit types in unions are serialized like normal structures in responses.
       26869  +
    /// Test ID: RestJsonOutputUnionWithUnitMember
32424  26870   
    #[::tokio::test]
32425         -
    async fn rest_json_http_with_header_member_no_modeled_body_request() {
       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();
       26878  +
        ::pretty_assertions::assert_eq!(
       26879  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
       26880  +
            http_response.status()
       26881  +
        );
       26882  +
        let expected_headers = [("Content-Type", "application/json")];
       26883  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       26884  +
            http_response.headers(),
       26885  +
            expected_headers,
       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  +
        ));
       26895  +
    }
       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
       27006  +
    #[::tokio::test]
       27007  +
    #[::tracing_test::traced_test]
       27008  +
    async fn rest_json_serialize_string_union_value_request() {
32426  27009   
        #[allow(unused_mut)]
32427  27010   
        let mut http_request = http::Request::builder()
32428         -
            .uri("/no_payload")
32429         -
            .method("GET")
32430         -
            .header("X-Amz-Test-Id", "t-12345")
       27011  +
            .uri("/JsonUnions")
       27012  +
            .method("PUT")
       27013  +
            .header("Content-Type", "application/json")
32431  27014   
            .body(::aws_smithy_http_server::body::Body::from(
32432         -
                ::bytes::Bytes::from_static("".as_bytes()),
       27015  +
                ::bytes::Bytes::from_static(
       27016  +
                    "{\n    \"contents\": {\n        \"stringValue\": \"foo\"\n    }\n}".as_bytes(),
       27017  +
                ),
32433  27018   
            ))
32434  27019   
            .unwrap();
32435  27020   
        #[allow(unused_mut)]
32436  27021   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
32437  27022   
        let config = crate::service::RestJsonConfig::builder().build();
32438  27023   
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
32439         -
            .test_no_payload(move |input: crate::input::TestNoPayloadInput| {
       27024  +
            .json_unions(move |input: crate::input::JsonUnionsInput| {
32440  27025   
                let sender = sender.clone();
32441  27026   
                async move {
32442  27027   
                    let result = {
32443         -
                        let expected = crate::input::TestNoPayloadInput {
32444         -
                            test_id: ::std::option::Option::Some("t-12345".to_owned()),
       27028  +
                        let expected = crate::input::JsonUnionsInput {
       27029  +
                            contents: ::std::option::Option::Some(
       27030  +
                                crate::model::MyUnion::StringValue("foo".to_owned()),
       27031  +
                            ),
32445  27032   
                        };
32446  27033   
                        ::pretty_assertions::assert_eq!(input, expected);
32447         -
                        let response = crate::output::TestNoPayloadOutput {
32448         -
                            test_id: ::std::option::Option::None,
       27034  +
                        let response = crate::output::JsonUnionsOutput {
       27035  +
                            contents: ::std::option::Option::None,
32449  27036   
                        };
32450         -
                        response
       27037  +
                        Ok(response)
32451  27038   
                    };
32452  27039   
                    sender.send(()).await.expect("receiver dropped early");
32453  27040   
                    result
32454  27041   
                }
32455  27042   
            })
32456  27043   
            .build_unchecked();
32457  27044   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
32458  27045   
            .await
32459  27046   
            .expect("unable to make an HTTP request");
32460         -
        assert!(receiver.recv().await.is_some());
       27047  +
        assert!(
       27048  +
            receiver.recv().await.is_some(),
       27049  +
            "we expected operation handler to be invoked but it was not entered"
       27050  +
        );
32461  27051   
    }
32462         -
}
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
       27052  +
    /// Serializes a boolean union value
       27053  +
    /// Test ID: RestJsonSerializeBooleanUnionValue
32468  27054   
    #[::tokio::test]
32469         -
    async fn rest_json_http_with_empty_blob_payload_request() {
       27055  +
    #[::tracing_test::traced_test]
       27056  +
    async fn rest_json_serialize_boolean_union_value_request() {
32470  27057   
        #[allow(unused_mut)]
32471  27058   
        let mut http_request = http::Request::builder()
32472         -
            .uri("/blob_payload")
32473         -
            .method("POST")
32474         -
            .header("Content-Type", "application/octet-stream")
       27059  +
            .uri("/JsonUnions")
       27060  +
            .method("PUT")
       27061  +
            .header("Content-Type", "application/json")
32475  27062   
            .body(::aws_smithy_http_server::body::Body::from(
32476         -
                ::bytes::Bytes::from_static("".as_bytes()),
       27063  +
                ::bytes::Bytes::from_static(
       27064  +
                    "{\n    \"contents\": {\n        \"booleanValue\": true\n    }\n}".as_bytes(),
       27065  +
                ),
32477  27066   
            ))
32478  27067   
            .unwrap();
32479  27068   
        #[allow(unused_mut)]
32480  27069   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
32481  27070   
        let config = crate::service::RestJsonConfig::builder().build();
32482  27071   
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
32483         -
            .test_payload_blob(move |input: crate::input::TestPayloadBlobInput| {
       27072  +
            .json_unions(move |input: crate::input::JsonUnionsInput| {
32484  27073   
                let sender = sender.clone();
32485  27074   
                async move {
32486  27075   
                    let result = {
32487         -
                        let expected = crate::input::TestPayloadBlobInput {
32488         -
                            content_type: ::std::option::Option::Some(
32489         -
                                "application/octet-stream".to_owned(),
       27076  +
                        let expected = crate::input::JsonUnionsInput {
       27077  +
                            contents: ::std::option::Option::Some(
       27078  +
                                crate::model::MyUnion::BooleanValue(true),
32490  27079   
                            ),
32491         -
                            data: ::std::option::Option::None,
32492  27080   
                        };
32493  27081   
                        ::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,
       27082  +
                        let response = crate::output::JsonUnionsOutput {
       27083  +
                            contents: ::std::option::Option::None,
32497  27084   
                        };
32498         -
                        response
       27085  +
                        Ok(response)
32499  27086   
                    };
32500  27087   
                    sender.send(()).await.expect("receiver dropped early");
32501  27088   
                    result
32502  27089   
                }
32503  27090   
            })
32504  27091   
            .build_unchecked();
32505  27092   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
32506  27093   
            .await
32507  27094   
            .expect("unable to make an HTTP request");
32508         -
        assert!(receiver.recv().await.is_some());
       27095  +
        assert!(
       27096  +
            receiver.recv().await.is_some(),
       27097  +
            "we expected operation handler to be invoked but it was not entered"
       27098  +
        );
32509  27099   
    }
32510         -
    /// Serializes a payload targeting a blob
32511         -
    /// Test ID: RestJsonTestPayloadBlob
       27100  +
    /// Serializes a number union value
       27101  +
    /// Test ID: RestJsonSerializeNumberUnionValue
32512  27102   
    #[::tokio::test]
32513         -
    async fn rest_json_test_payload_blob_request() {
       27103  +
    #[::tracing_test::traced_test]
       27104  +
    async fn rest_json_serialize_number_union_value_request() {
32514  27105   
        #[allow(unused_mut)]
32515  27106   
        let mut http_request = http::Request::builder()
32516         -
            .uri("/blob_payload")
32517         -
            .method("POST")
32518         -
            .header("Content-Type", "image/jpg")
       27107  +
            .uri("/JsonUnions")
       27108  +
            .method("PUT")
       27109  +
            .header("Content-Type", "application/json")
32519  27110   
            .body(::aws_smithy_http_server::body::Body::from(
32520         -
                ::bytes::Bytes::from_static("1234".as_bytes()),
       27111  +
                ::bytes::Bytes::from_static(
       27112  +
                    "{\n    \"contents\": {\n        \"numberValue\": 1\n    }\n}".as_bytes(),
       27113  +
                ),
32521  27114   
            ))
32522  27115   
            .unwrap();
32523  27116   
        #[allow(unused_mut)]
32524  27117   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
32525  27118   
        let config = crate::service::RestJsonConfig::builder().build();
32526  27119   
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
32527         -
            .test_payload_blob(move |input: crate::input::TestPayloadBlobInput| {
       27120  +
            .json_unions(move |input: crate::input::JsonUnionsInput| {
32528  27121   
                let sender = sender.clone();
32529  27122   
                async move {
32530  27123   
                    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         -
                            )),
       27124  +
                        let expected = crate::input::JsonUnionsInput {
       27125  +
                            contents: ::std::option::Option::Some(
       27126  +
                                crate::model::MyUnion::NumberValue(1),
       27127  +
                            ),
32536  27128   
                        };
32537  27129   
                        ::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,
       27130  +
                        let response = crate::output::JsonUnionsOutput {
       27131  +
                            contents: ::std::option::Option::None,
32541  27132   
                        };
32542         -
                        response
       27133  +
                        Ok(response)
32543  27134   
                    };
32544  27135   
                    sender.send(()).await.expect("receiver dropped early");
32545  27136   
                    result
32546  27137   
                }
32547  27138   
            })
32548  27139   
            .build_unchecked();
32549  27140   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
32550  27141   
            .await
32551  27142   
            .expect("unable to make an HTTP request");
32552         -
        assert!(receiver.recv().await.is_some());
       27143  +
        assert!(
       27144  +
            receiver.recv().await.is_some(),
       27145  +
            "we expected operation handler to be invoked but it was not entered"
       27146  +
        );
32553  27147   
    }
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
       27148  +
    /// Serializes a blob union value
       27149  +
    /// Test ID: RestJsonSerializeBlobUnionValue
32560  27150   
    #[::tokio::test]
32561         -
    async fn rest_json_http_with_empty_structure_payload_request() {
       27151  +
    #[::tracing_test::traced_test]
       27152  +
    async fn rest_json_serialize_blob_union_value_request() {
32562  27153   
        #[allow(unused_mut)]
32563  27154   
        let mut http_request = http::Request::builder()
32564         -
            .uri("/payload")
32565         -
            .method("POST")
       27155  +
            .uri("/JsonUnions")
       27156  +
            .method("PUT")
32566  27157   
            .header("Content-Type", "application/json")
32567  27158   
            .body(::aws_smithy_http_server::body::Body::from(
32568         -
                ::bytes::Bytes::from_static("{}".as_bytes()),
       27159  +
                ::bytes::Bytes::from_static(
       27160  +
                    "{\n    \"contents\": {\n        \"blobValue\": \"Zm9v\"\n    }\n}".as_bytes(),
       27161  +
                ),
32569  27162   
            ))
32570  27163   
            .unwrap();
32571  27164   
        #[allow(unused_mut)]
32572  27165   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
32573  27166   
        let config = crate::service::RestJsonConfig::builder().build();
32574  27167   
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
32575         -
            .test_payload_structure(move |input: crate::input::TestPayloadStructureInput| {
       27168  +
            .json_unions(move |input: crate::input::JsonUnionsInput| {
32576  27169   
                let sender = sender.clone();
32577  27170   
                async move {
32578  27171   
                    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         -
                                },
       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  +
                                )),
32584  27177   
                            ),
32585         -
                            test_id: ::std::option::Option::None,
32586  27178   
                        };
32587  27179   
                        ::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,
       27180  +
                        let response = crate::output::JsonUnionsOutput {
       27181  +
                            contents: ::std::option::Option::None,
32595  27182   
                        };
32596         -
                        response
       27183  +
                        Ok(response)
32597  27184   
                    };
32598  27185   
                    sender.send(()).await.expect("receiver dropped early");
32599  27186   
                    result
32600  27187   
                }
32601  27188   
            })
32602  27189   
            .build_unchecked();
32603  27190   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
32604  27191   
            .await
32605  27192   
            .expect("unable to make an HTTP request");
32606         -
        assert!(receiver.recv().await.is_some());
       27193  +
        assert!(
       27194  +
            receiver.recv().await.is_some(),
       27195  +
            "we expected operation handler to be invoked but it was not entered"
       27196  +
        );
32607  27197   
    }
32608         -
    /// Serializes a payload targeting a structure
32609         -
    /// Test ID: RestJsonTestPayloadStructure
       27198  +
    /// Serializes a timestamp union value
       27199  +
    /// Test ID: RestJsonSerializeTimestampUnionValue
32610  27200   
    #[::tokio::test]
32611         -
    async fn rest_json_test_payload_structure_request() {
       27201  +
    #[::tracing_test::traced_test]
       27202  +
    async fn rest_json_serialize_timestamp_union_value_request() {
32612  27203   
        #[allow(unused_mut)]
32613  27204   
        let mut http_request = http::Request::builder()
32614         -
            .uri("/payload")
32615         -
            .method("POST")
       27205  +
            .uri("/JsonUnions")
       27206  +
            .method("PUT")
32616  27207   
            .header("Content-Type", "application/json")
32617  27208   
            .body(::aws_smithy_http_server::body::Body::from(
32618         -
                ::bytes::Bytes::from_static("{\"data\": 25\n}".as_bytes()),
       27209  +
                ::bytes::Bytes::from_static(
       27210  +
                    "{\n    \"contents\": {\n        \"timestampValue\": 1398796238\n    }\n}"
       27211  +
                        .as_bytes(),
       27212  +
                ),
32619  27213   
            ))
32620  27214   
            .unwrap();
32621  27215   
        #[allow(unused_mut)]
32622  27216   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
32623  27217   
        let config = crate::service::RestJsonConfig::builder().build();
32624  27218   
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
32625         -
            .test_payload_structure(move |input: crate::input::TestPayloadStructureInput| {
       27219  +
            .json_unions(move |input: crate::input::JsonUnionsInput| {
32626  27220   
                let sender = sender.clone();
32627  27221   
                async move {
32628  27222   
                    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         -
                                },
       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  +
                                ),
32634  27230   
                            ),
32635         -
                            test_id: ::std::option::Option::None,
32636  27231   
                        };
32637  27232   
                        ::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,
       27233  +
                        let response = crate::output::JsonUnionsOutput {
       27234  +
                            contents: ::std::option::Option::None,
32645  27235   
                        };
32646         -
                        response
       27236  +
                        Ok(response)
32647  27237   
                    };
32648  27238   
                    sender.send(()).await.expect("receiver dropped early");
32649  27239   
                    result
32650  27240   
                }
32651  27241   
            })
32652  27242   
            .build_unchecked();
32653  27243   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
32654  27244   
            .await
32655  27245   
            .expect("unable to make an HTTP request");
32656         -
        assert!(receiver.recv().await.is_some());
       27246  +
        assert!(
       27247  +
            receiver.recv().await.is_some(),
       27248  +
            "we expected operation handler to be invoked but it was not entered"
       27249  +
        );
32657  27250   
    }
32658         -
    /// Serializes an request with header members but no payload
32659         -
    /// Test ID: RestJsonHttpWithHeadersButNoPayload
       27251  +
    /// Serializes an enum union value
       27252  +
    /// Test ID: RestJsonSerializeEnumUnionValue
32660  27253   
    #[::tokio::test]
32661         -
    async fn rest_json_http_with_headers_but_no_payload_request() {
       27254  +
    #[::tracing_test::traced_test]
       27255  +
    async fn rest_json_serialize_enum_union_value_request() {
32662  27256   
        #[allow(unused_mut)]
32663  27257   
        let mut http_request = http::Request::builder()
32664         -
            .uri("/payload")
32665         -
            .method("POST")
       27258  +
            .uri("/JsonUnions")
       27259  +
            .method("PUT")
32666  27260   
            .header("Content-Type", "application/json")
32667         -
            .header("X-Amz-Test-Id", "t-12345")
32668  27261   
            .body(::aws_smithy_http_server::body::Body::from(
32669         -
                ::bytes::Bytes::from_static("{}".as_bytes()),
       27262  +
                ::bytes::Bytes::from_static(
       27263  +
                    "{\n    \"contents\": {\n        \"enumValue\": \"Foo\"\n    }\n}".as_bytes(),
       27264  +
                ),
32670  27265   
            ))
32671  27266   
            .unwrap();
32672  27267   
        #[allow(unused_mut)]
32673  27268   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
32674  27269   
        let config = crate::service::RestJsonConfig::builder().build();
32675  27270   
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
32676         -
            .test_payload_structure(move |input: crate::input::TestPayloadStructureInput| {
       27271  +
            .json_unions(move |input: crate::input::JsonUnionsInput| {
32677  27272   
                let sender = sender.clone();
32678  27273   
                async move {
32679  27274   
                    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         -
                                },
       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  +
                                ),
32686  27282   
                            ),
32687  27283   
                        };
32688  27284   
                        ::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,
       27285  +
                        let response = crate::output::JsonUnionsOutput {
       27286  +
                            contents: ::std::option::Option::None,
32696  27287   
                        };
32697         -
                        response
       27288  +
                        Ok(response)
32698  27289   
                    };
32699  27290   
                    sender.send(()).await.expect("receiver dropped early");
32700  27291   
                    result
32701  27292   
                }
32702  27293   
            })
32703  27294   
            .build_unchecked();
32704  27295   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
32705  27296   
            .await
32706  27297   
            .expect("unable to make an HTTP request");
32707         -
        assert!(receiver.recv().await.is_some());
       27298  +
        assert!(
       27299  +
            receiver.recv().await.is_some(),
       27300  +
            "we expected operation handler to be invoked but it was not entered"
       27301  +
        );
32708  27302   
    }
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
       27303  +
    /// Serializes a list union value
       27304  +
    /// Test ID: RestJsonSerializeListUnionValue
32715  27305   
    #[::tokio::test]
32716         -
    async fn rest_json_timestamp_format_headers_request() {
       27306  +
    #[::tracing_test::traced_test]
       27307  +
    async fn rest_json_serialize_list_union_value_request() {
32717  27308   
        #[allow(unused_mut)]
32718  27309   
        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")
       27310  +
            .uri("/JsonUnions")
       27311  +
            .method("PUT")
       27312  +
            .header("Content-Type", "application/json")
32728  27313   
            .body(::aws_smithy_http_server::body::Body::from(
32729         -
                ::bytes::Bytes::from_static("".as_bytes()),
       27314  +
                ::bytes::Bytes::from_static(
       27315  +
                    "{\n    \"contents\": {\n        \"listValue\": [\"foo\", \"bar\"]\n    }\n}"
       27316  +
                        .as_bytes(),
       27317  +
                ),
32730  27318   
            ))
32731  27319   
            .unwrap();
32732  27320   
        #[allow(unused_mut)]
32733  27321   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
32734  27322   
        let config = crate::service::RestJsonConfig::builder().build();
32735  27323   
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
32736         -
            .timestamp_format_headers(move |input: crate::input::TimestampFormatHeadersInput| {
       27324  +
            .json_unions(move |input: crate::input::JsonUnionsInput| {
32737  27325   
                let sender = sender.clone();
32738  27326   
                async move {
32739  27327   
                    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         -
                                ),
       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  +
                                ]),
32775  27334   
                            ),
32776  27335   
                        };
32777  27336   
                        ::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,
       27337  +
                        let response = crate::output::JsonUnionsOutput {
       27338  +
                            contents: ::std::option::Option::None,
32786  27339   
                        };
32787         -
                        response
       27340  +
                        Ok(response)
32788  27341   
                    };
32789  27342   
                    sender.send(()).await.expect("receiver dropped early");
32790  27343   
                    result
32791  27344   
                }
32792  27345   
            })
32793  27346   
            .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
       27347  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       27348  +
            .await
       27349  +
            .expect("unable to make an HTTP request");
       27350  +
        assert!(
       27351  +
            receiver.recv().await.is_some(),
       27352  +
            "we expected operation handler to be invoked but it was not entered"
       27353  +
        );
       27354  +
    }
       27355  +
    /// Serializes a map union value
       27356  +
    /// Test ID: RestJsonSerializeMapUnionValue
32854  27357   
    #[::tokio::test]
32855         -
    async fn rest_json_unit_input_and_output_request() {
       27358  +
    #[::tracing_test::traced_test]
       27359  +
    async fn rest_json_serialize_map_union_value_request() {
32856  27360   
        #[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();
       27361  +
                    let mut http_request = http::Request::builder()
       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();
32864  27366   
        #[allow(unused_mut)]
32865  27367   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
32866  27368   
        let config = crate::service::RestJsonConfig::builder().build();
32867  27369   
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
32868         -
            .unit_input_and_output(move |input: crate::input::UnitInputAndOutputInput| {
       27370  +
            .json_unions(move |input: crate::input::JsonUnionsInput| {
32869  27371   
                let sender = sender.clone();
32870  27372   
                async move {
32871  27373   
                    let result = {
32872         -
                        let expected = crate::input::UnitInputAndOutputInput {};
       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  +
                        };
32873  27384   
                        ::pretty_assertions::assert_eq!(input, expected);
32874         -
                        let response = crate::output::UnitInputAndOutputOutput {};
32875         -
                        response
       27385  +
                        let response = crate::output::JsonUnionsOutput {
       27386  +
                            contents: ::std::option::Option::None,
       27387  +
                        };
       27388  +
                        Ok(response)
32876  27389   
                    };
32877  27390   
                    sender.send(()).await.expect("receiver dropped early");
32878  27391   
                    result
32879  27392   
                }
32880  27393   
            })
32881  27394   
            .build_unchecked();
32882  27395   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
32883  27396   
            .await
32884  27397   
            .expect("unable to make an HTTP request");
32885         -
        assert!(receiver.recv().await.is_some());
       27398  +
        assert!(
       27399  +
            receiver.recv().await.is_some(),
       27400  +
            "we expected operation handler to be invoked but it was not entered"
       27401  +
        );
32886  27402   
    }
32887         -
    /// Servers should allow the accept header to be set to the
32888         -
    /// default content-type.
32889         -
    /// Test ID: RestJsonUnitInputAllowsAccept
       27403  +
    /// Serializes a structure union value
       27404  +
    /// Test ID: RestJsonSerializeStructureUnionValue
32890  27405   
    #[::tokio::test]
32891         -
    async fn rest_json_unit_input_allows_accept_request() {
       27406  +
    #[::tracing_test::traced_test]
       27407  +
    async fn rest_json_serialize_structure_union_value_request() {
32892  27408   
        #[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();
       27409  +
                    let mut http_request = http::Request::builder()
       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();
32901  27414   
        #[allow(unused_mut)]
32902  27415   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
32903  27416   
        let config = crate::service::RestJsonConfig::builder().build();
32904  27417   
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
32905         -
            .unit_input_and_output(move |input: crate::input::UnitInputAndOutputInput| {
       27418  +
            .json_unions(move |input: crate::input::JsonUnionsInput| {
32906  27419   
                let sender = sender.clone();
32907  27420   
                async move {
32908  27421   
                    let result = {
32909         -
                        let expected = crate::input::UnitInputAndOutputInput {};
       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  +
                        };
32910  27431   
                        ::pretty_assertions::assert_eq!(input, expected);
32911         -
                        let response = crate::output::UnitInputAndOutputOutput {};
32912         -
                        response
       27432  +
                        let response = crate::output::JsonUnionsOutput {
       27433  +
                            contents: ::std::option::Option::None,
       27434  +
                        };
       27435  +
                        Ok(response)
32913  27436   
                    };
32914  27437   
                    sender.send(()).await.expect("receiver dropped early");
32915  27438   
                    result
32916  27439   
                }
32917  27440   
            })
32918  27441   
            .build_unchecked();
32919  27442   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
32920  27443   
            .await
32921  27444   
            .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         -
        use ::aws_smithy_http_server::response::IntoResponse;
32932         -
        let http_response = output.into_response();
32933         -
        ::pretty_assertions::assert_eq!(
32934         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
32935         -
            http_response.status()
32936         -
        );
32937         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
32938         -
            .await
32939         -
            .expect("unable to extract body to bytes");
32940         -
        // No body.
32941         -
        ::pretty_assertions::assert_eq!(std::str::from_utf8(&body).unwrap(), "");
32942         -
    }
32943         -
}
32944         -
32945         -
const CONTENT_TYPE_PUTWITHCONTENTENCODING: ::mime::Mime = ::mime::APPLICATION_JSON;
32946         -
::pin_project_lite::pin_project! {
32947         -
    /// 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>>
32951         -
    }
32952         -
}
32953         -
32954         -
impl std::future::Future for PutWithContentEncodingInputFuture {
32955         -
    type Output = Result<
32956         -
        crate::input::PutWithContentEncodingInput,
32957         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
32958         -
    >;
32959         -
32960         -
    fn poll(
32961         -
        self: std::pin::Pin<&mut Self>,
32962         -
        cx: &mut std::task::Context<'_>,
32963         -
    ) -> std::task::Poll<Self::Output> {
32964         -
        let this = self.project();
32965         -
        this.inner.as_mut().poll(cx)
32966         -
    }
32967         -
}
32968         -
32969         -
impl<B>
32970         -
    ::aws_smithy_http_server::request::FromRequest<
32971         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
32972         -
        B,
32973         -
    > for crate::input::PutWithContentEncodingInput
32974         -
where
32975         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
32976         -
    B: 'static,
32977         -
32978         -
    B::Data: Send,
32979         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
32980         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
32981         -
{
32982         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
32983         -
    type Future = PutWithContentEncodingInputFuture;
32984         -
32985         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
32986         -
        let fut = async move {
32987         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
32988         -
                request.headers(),
32989         -
                &CONTENT_TYPE_PUTWITHCONTENTENCODING,
32990         -
            ) {
32991         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
32992         -
            }
32993         -
            crate::protocol_serde::shape_put_with_content_encoding::de_put_with_content_encoding_http_request(request)
32994         -
                            .await
32995         -
                            .map_err(Into::into)
32996         -
        };
32997         -
        use ::futures_util::future::TryFutureExt;
32998         -
        let fut = fut.map_err(
32999         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
33000         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
33001         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
33002         -
                    e,
33003         -
                )
33004         -
            },
33005         -
        );
33006         -
        PutWithContentEncodingInputFuture {
33007         -
            inner: Box::pin(fut),
33008         -
        }
33009         -
    }
33010         -
}
33011         -
impl
33012         -
    ::aws_smithy_http_server::response::IntoResponse<
33013         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
33014         -
    > for crate::output::PutWithContentEncodingOutput
33015         -
{
33016         -
    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) {
33018         -
                        Ok(response) => response,
33019         -
                        Err(e) => {
33020         -
                            ::tracing::error!(error = %e, "failed to serialize response");
33021         -
                            ::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         -
                        }
33023         -
                    }
33024         -
    }
33025         -
}
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         -
impl
33096         -
    ::aws_smithy_http_server::response::IntoResponse<
33097         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
33098         -
    > for crate::output::FractionalSecondsOutput
33099         -
{
33100         -
    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,
33103         -
        ) {
33104         -
            Ok(response) => response,
33105         -
            Err(e) => {
33106         -
                ::tracing::error!(error = %e, "failed to serialize response");
33107         -
                ::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         -
            }
33109         -
        }
33110         -
    }
33111         -
}
33112         -
33113         -
const CONTENT_TYPE_DATETIMEOFFSETS: ::mime::Mime = ::mime::APPLICATION_JSON;
33114         -
::pin_project_lite::pin_project! {
33115         -
    /// 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>>
33119         -
    }
33120         -
}
33121         -
33122         -
impl std::future::Future for DatetimeOffsetsInputFuture {
33123         -
    type Output = Result<
33124         -
        crate::input::DatetimeOffsetsInput,
33125         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
33126         -
    >;
33127         -
33128         -
    fn poll(
33129         -
        self: std::pin::Pin<&mut Self>,
33130         -
        cx: &mut std::task::Context<'_>,
33131         -
    ) -> std::task::Poll<Self::Output> {
33132         -
        let this = self.project();
33133         -
        this.inner.as_mut().poll(cx)
33134         -
    }
33135         -
}
33136         -
33137         -
impl<B>
33138         -
    ::aws_smithy_http_server::request::FromRequest<
33139         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
33140         -
        B,
33141         -
    > for crate::input::DatetimeOffsetsInput
33142         -
where
33143         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
33144         -
    B: 'static,
33145         -
33146         -
    B::Data: Send,
33147         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
33148         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
33149         -
{
33150         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
33151         -
    type Future = DatetimeOffsetsInputFuture;
33152         -
33153         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
33154         -
        let fut = async move {
33155         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
33156         -
                request.headers(),
33157         -
                &CONTENT_TYPE_DATETIMEOFFSETS,
33158         -
            ) {
33159         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
33160         -
            }
33161         -
            crate::protocol_serde::shape_datetime_offsets::de_datetime_offsets_http_request(request)
33162         -
                .await
33163         -
                .map_err(Into::into)
33164         -
        };
33165         -
        use ::futures_util::future::TryFutureExt;
33166         -
        let fut = fut.map_err(
33167         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
33168         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
33169         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
33170         -
                    e,
33171         -
                )
33172         -
            },
33173         -
        );
33174         -
        DatetimeOffsetsInputFuture {
33175         -
            inner: Box::pin(fut),
33176         -
        }
33177         -
    }
33178         -
}
33179         -
impl
33180         -
    ::aws_smithy_http_server::response::IntoResponse<
33181         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
33182         -
    > for crate::output::DatetimeOffsetsOutput
33183         -
{
33184         -
    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         -
        ) {
33188         -
            Ok(response) => response,
33189         -
            Err(e) => {
33190         -
                ::tracing::error!(error = %e, "failed to serialize response");
33191         -
                ::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         -
            }
33193         -
        }
33194         -
    }
33195         -
}
33196         -
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         -
}
33220         -
33221         -
impl<B>
33222         -
    ::aws_smithy_http_server::request::FromRequest<
33223         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
33224         -
        B,
33225         -
    > for crate::input::TestNoPayloadInput
33226         -
where
33227         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
33228         -
    B: 'static,
33229         -
33230         -
    B::Data: Send,
33231         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
33232         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
33233         -
{
33234         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
33235         -
    type Future = TestNoPayloadInputFuture;
33236         -
33237         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
33238         -
        let fut = async move {
33239         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
33240         -
                request.headers(),
33241         -
                &CONTENT_TYPE_TESTNOPAYLOAD,
33242         -
            ) {
33243         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
33244         -
            }
33245         -
            crate::protocol_serde::shape_test_no_payload::de_test_no_payload_http_request(request)
33246         -
                .await
33247         -
                .map_err(Into::into)
33248         -
        };
33249         -
        use ::futures_util::future::TryFutureExt;
33250         -
        let fut = fut.map_err(
33251         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
33252         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
33253         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
33254         -
                    e,
33255         -
                )
33256         -
            },
       27445  +
        assert!(
       27446  +
            receiver.recv().await.is_some(),
       27447  +
            "we expected operation handler to be invoked but it was not entered"
33257  27448   
        );
33258         -
        TestNoPayloadInputFuture {
33259         -
            inner: Box::pin(fut),
33260         -
        }
33261         -
    }
33262         -
}
33263         -
impl
33264         -
    ::aws_smithy_http_server::response::IntoResponse<
33265         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
33266         -
    > for crate::output::TestNoPayloadOutput
33267         -
{
33268         -
    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         -
        {
33271         -
            Ok(response) => response,
33272         -
            Err(e) => {
33273         -
                ::tracing::error!(error = %e, "failed to serialize response");
33274         -
                ::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         -
            }
33276         -
        }
33277         -
    }
33278         -
}
33279         -
33280         -
::pin_project_lite::pin_project! {
33281         -
    /// 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>>
33285         -
    }
33286         -
}
33287         -
33288         -
impl std::future::Future for TestPayloadBlobInputFuture {
33289         -
    type Output = Result<
33290         -
        crate::input::TestPayloadBlobInput,
33291         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
33292         -
    >;
33293         -
33294         -
    fn poll(
33295         -
        self: std::pin::Pin<&mut Self>,
33296         -
        cx: &mut std::task::Context<'_>,
33297         -
    ) -> std::task::Poll<Self::Output> {
33298         -
        let this = self.project();
33299         -
        this.inner.as_mut().poll(cx)
33300  27449   
    }
33301         -
}
33302         -
33303         -
impl<B>
33304         -
    ::aws_smithy_http_server::request::FromRequest<
33305         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
33306         -
        B,
33307         -
    > for crate::input::TestPayloadBlobInput
33308         -
where
33309         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
33310         -
    B: 'static,
33311         -
33312         -
    B::Data: Send,
33313         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
33314         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
33315         -
{
33316         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
33317         -
    type Future = TestPayloadBlobInputFuture;
33318         -
33319         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
33320         -
        let fut = async move {
33321         -
            crate::protocol_serde::shape_test_payload_blob::de_test_payload_blob_http_request(
33322         -
                request,
33323         -
            )
       27450  +
    /// Serializes a renamed structure union value
       27451  +
    /// Test ID: RestJsonSerializeRenamedStructureUnionValue
       27452  +
    #[::tokio::test]
       27453  +
    #[::tracing_test::traced_test]
       27454  +
    async fn rest_json_serialize_renamed_structure_union_value_request() {
       27455  +
        #[allow(unused_mut)]
       27456  +
                    let mut http_request = http::Request::builder()
       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();
       27461  +
        #[allow(unused_mut)]
       27462  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       27463  +
        let config = crate::service::RestJsonConfig::builder().build();
       27464  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       27465  +
            .json_unions(move |input: crate::input::JsonUnionsInput| {
       27466  +
                let sender = sender.clone();
       27467  +
                async move {
       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  +
                    };
       27486  +
                    sender.send(()).await.expect("receiver dropped early");
       27487  +
                    result
       27488  +
                }
       27489  +
            })
       27490  +
            .build_unchecked();
       27491  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
33324  27492   
            .await
33325         -
            .map_err(Into::into)
33326         -
        };
33327         -
        use ::futures_util::future::TryFutureExt;
33328         -
        let fut = fut.map_err(
33329         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
33330         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
33331         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
33332         -
                    e,
33333         -
                )
33334         -
            },
       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"
33335  27497   
        );
33336         -
        TestPayloadBlobInputFuture {
33337         -
            inner: Box::pin(fut),
33338         -
        }
33339         -
    }
33340         -
}
33341         -
impl
33342         -
    ::aws_smithy_http_server::response::IntoResponse<
33343         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
33344         -
    > for crate::output::TestPayloadBlobOutput
33345         -
{
33346         -
    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         -
        ) {
33350         -
            Ok(response) => response,
33351         -
            Err(e) => {
33352         -
                ::tracing::error!(error = %e, "failed to serialize response");
33353         -
                ::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         -
            }
33355         -
        }
33356         -
    }
33357         -
}
33358         -
33359         -
const CONTENT_TYPE_TESTPAYLOADSTRUCTURE: ::mime::Mime = ::mime::APPLICATION_JSON;
33360         -
::pin_project_lite::pin_project! {
33361         -
    /// 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>>
33365         -
    }
33366         -
}
33367         -
33368         -
impl std::future::Future for TestPayloadStructureInputFuture {
33369         -
    type Output = Result<
33370         -
        crate::input::TestPayloadStructureInput,
33371         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
33372         -
    >;
33373         -
33374         -
    fn poll(
33375         -
        self: std::pin::Pin<&mut Self>,
33376         -
        cx: &mut std::task::Context<'_>,
33377         -
    ) -> std::task::Poll<Self::Output> {
33378         -
        let this = self.project();
33379         -
        this.inner.as_mut().poll(cx)
33380  27498   
    }
33381         -
}
33382         -
33383         -
impl<B>
33384         -
    ::aws_smithy_http_server::request::FromRequest<
33385         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
33386         -
        B,
33387         -
    > for crate::input::TestPayloadStructureInput
33388         -
where
33389         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
33390         -
    B: 'static,
33391         -
33392         -
    B::Data: Send,
33393         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
33394         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
33395         -
{
33396         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
33397         -
    type Future = TestPayloadStructureInputFuture;
33398         -
33399         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
33400         -
        let fut = async move {
33401         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
33402         -
                request.headers(),
33403         -
                &CONTENT_TYPE_TESTPAYLOADSTRUCTURE,
33404         -
            ) {
33405         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
33406         -
            }
33407         -
            crate::protocol_serde::shape_test_payload_structure::de_test_payload_structure_http_request(request)
33408         -
                            .await
33409         -
                            .map_err(Into::into)
       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  +
            )),
33410  27508   
        };
33411         -
        use ::futures_util::future::TryFutureExt;
33412         -
        let fut = fut.map_err(
33413         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
33414         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
33415         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
33416         -
                    e,
33417         -
                )
33418         -
            },
       27509  +
        use ::aws_smithy_http_server::response::IntoResponse;
       27510  +
        let http_response = output.into_response();
       27511  +
        ::pretty_assertions::assert_eq!(
       27512  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
       27513  +
            http_response.status()
33419  27514   
        );
33420         -
        TestPayloadStructureInputFuture {
33421         -
            inner: Box::pin(fut),
33422         -
        }
33423         -
    }
33424         -
}
33425         -
impl
33426         -
    ::aws_smithy_http_server::response::IntoResponse<
33427         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
33428         -
    > for crate::output::TestPayloadStructureOutput
33429         -
{
33430         -
    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) {
33432         -
                        Ok(response) => response,
33433         -
                        Err(e) => {
33434         -
                            ::tracing::error!(error = %e, "failed to serialize response");
33435         -
                            ::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         -
                        }
33437         -
                    }
33438         -
    }
33439         -
}
33440         -
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         -
}
33449         -
33450         -
impl std::future::Future for TestBodyStructureInputFuture {
33451         -
    type Output = Result<
33452         -
        crate::input::TestBodyStructureInput,
33453         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
33454         -
    >;
33455         -
33456         -
    fn poll(
33457         -
        self: std::pin::Pin<&mut Self>,
33458         -
        cx: &mut std::task::Context<'_>,
33459         -
    ) -> std::task::Poll<Self::Output> {
33460         -
        let this = self.project();
33461         -
        this.inner.as_mut().poll(cx)
33462         -
    }
33463         -
}
33464         -
33465         -
impl<B>
33466         -
    ::aws_smithy_http_server::request::FromRequest<
33467         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
33468         -
        B,
33469         -
    > for crate::input::TestBodyStructureInput
33470         -
where
33471         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
33472         -
    B: 'static,
33473         -
33474         -
    B::Data: Send,
33475         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
33476         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
33477         -
{
33478         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
33479         -
    type Future = TestBodyStructureInputFuture;
33480         -
33481         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
33482         -
        let fut = async move {
33483         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
33484         -
                request.headers(),
33485         -
                &CONTENT_TYPE_TESTBODYSTRUCTURE,
33486         -
            ) {
33487         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
33488         -
            }
33489         -
            crate::protocol_serde::shape_test_body_structure::de_test_body_structure_http_request(
33490         -
                request,
33491         -
            )
       27515  +
        let expected_headers = [("Content-Type", "application/json")];
       27516  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       27517  +
            http_response.headers(),
       27518  +
            expected_headers,
       27519  +
        ));
       27520  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
33492  27521   
            .await
33493         -
            .map_err(Into::into)
       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  +
        ));
       27528  +
    }
       27529  +
    /// Deserializes a boolean union value
       27530  +
    /// Test ID: RestJsonDeserializeBooleanUnionValue
       27531  +
    #[::tokio::test]
       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)),
33494  27536   
        };
33495         -
        use ::futures_util::future::TryFutureExt;
33496         -
        let fut = fut.map_err(
33497         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
33498         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
33499         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
33500         -
                    e,
33501         -
                )
33502         -
            },
       27537  +
        use ::aws_smithy_http_server::response::IntoResponse;
       27538  +
        let http_response = output.into_response();
       27539  +
        ::pretty_assertions::assert_eq!(
       27540  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
       27541  +
            http_response.status()
33503  27542   
        );
33504         -
        TestBodyStructureInputFuture {
33505         -
            inner: Box::pin(fut),
33506         -
        }
33507         -
    }
33508         -
}
33509         -
impl
33510         -
    ::aws_smithy_http_server::response::IntoResponse<
33511         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
33512         -
    > for crate::output::TestBodyStructureOutput
33513         -
{
33514         -
    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) {
33516         -
                        Ok(response) => response,
33517         -
                        Err(e) => {
33518         -
                            ::tracing::error!(error = %e, "failed to serialize response");
33519         -
                            ::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         -
                        }
33521         -
                    }
33522         -
    }
33523         -
}
33524         -
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         -
    });
33531         -
::pin_project_lite::pin_project! {
33532         -
    /// 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>>
33536         -
    }
33537         -
}
33538         -
33539         -
impl std::future::Future for MalformedAcceptWithGenericStringInputFuture {
33540         -
    type Output = Result<
33541         -
        crate::input::MalformedAcceptWithGenericStringInput,
33542         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
33543         -
    >;
33544         -
33545         -
    fn poll(
33546         -
        self: std::pin::Pin<&mut Self>,
33547         -
        cx: &mut std::task::Context<'_>,
33548         -
    ) -> std::task::Poll<Self::Output> {
33549         -
        let this = self.project();
33550         -
        this.inner.as_mut().poll(cx)
       27543  +
        let expected_headers = [("Content-Type", "application/json")];
       27544  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       27545  +
            http_response.headers(),
       27546  +
            expected_headers,
       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  +
        ));
33551  27556   
    }
33552         -
}
33553         -
33554         -
impl<B>
33555         -
    ::aws_smithy_http_server::request::FromRequest<
33556         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
33557         -
        B,
33558         -
    > for crate::input::MalformedAcceptWithGenericStringInput
33559         -
where
33560         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
33561         -
    B: 'static,
33562         -
33563         -
    B::Data: Send,
33564         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
33565         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
33566         -
{
33567         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
33568         -
    type Future = MalformedAcceptWithGenericStringInputFuture;
33569         -
33570         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
33571         -
        let fut = async move {
33572         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
33573         -
                request.headers(),
33574         -
                &CONTENT_TYPE_MALFORMEDACCEPTWITHGENERICSTRING,
33575         -
            ) {
33576         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
33577         -
            }
33578         -
            crate::protocol_serde::shape_malformed_accept_with_generic_string::de_malformed_accept_with_generic_string_http_request(request)
33579         -
                            .await
33580         -
                            .map_err(Into::into)
       27557  +
    /// Deserializes a number union value
       27558  +
    /// Test ID: RestJsonDeserializeNumberUnionValue
       27559  +
    #[::tokio::test]
       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)),
33581  27564   
        };
33582         -
        use ::futures_util::future::TryFutureExt;
33583         -
        let fut = fut.map_err(
33584         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
33585         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
33586         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
33587         -
                    e,
33588         -
                )
33589         -
            },
       27565  +
        use ::aws_smithy_http_server::response::IntoResponse;
       27566  +
        let http_response = output.into_response();
       27567  +
        ::pretty_assertions::assert_eq!(
       27568  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
       27569  +
            http_response.status()
33590  27570   
        );
33591         -
        MalformedAcceptWithGenericStringInputFuture {
33592         -
            inner: Box::pin(fut),
33593         -
        }
       27571  +
        let expected_headers = [("Content-Type", "application/json")];
       27572  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       27573  +
            http_response.headers(),
       27574  +
            expected_headers,
       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  +
        ));
33594  27584   
    }
33595         -
}
33596         -
impl
33597         -
    ::aws_smithy_http_server::response::IntoResponse<
33598         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
33599         -
    > for crate::output::MalformedAcceptWithGenericStringOutput
33600         -
{
33601         -
    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) {
33603         -
                        Ok(response) => response,
33604         -
                        Err(e) => {
33605         -
                            ::tracing::error!(error = %e, "failed to serialize response");
33606         -
                            ::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         -
                        }
33608         -
                    }
       27585  +
    /// Deserializes a blob union value
       27586  +
    /// Test ID: RestJsonDeserializeBlobUnionValue
       27587  +
    #[::tokio::test]
       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();
       27597  +
        ::pretty_assertions::assert_eq!(
       27598  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
       27599  +
            http_response.status()
       27600  +
        );
       27601  +
        let expected_headers = [("Content-Type", "application/json")];
       27602  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       27603  +
            http_response.headers(),
       27604  +
            expected_headers,
       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  +
        ));
33609  27614   
    }
33610         -
}
33611         -
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         -
    });
33618         -
::pin_project_lite::pin_project! {
33619         -
    /// 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>>
       27615  +
    /// Deserializes a timestamp union value
       27616  +
    /// Test ID: RestJsonDeserializeTimestampUnionValue
       27617  +
    #[::tokio::test]
       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();
       27627  +
        ::pretty_assertions::assert_eq!(
       27628  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
       27629  +
            http_response.status()
       27630  +
        );
       27631  +
        let expected_headers = [("Content-Type", "application/json")];
       27632  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       27633  +
            http_response.headers(),
       27634  +
            expected_headers,
       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  +
        ));
33623  27644   
    }
33624         -
}
33625         -
33626         -
impl std::future::Future for MalformedAcceptWithPayloadInputFuture {
33627         -
    type Output = Result<
33628         -
        crate::input::MalformedAcceptWithPayloadInput,
33629         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
33630         -
    >;
33631         -
33632         -
    fn poll(
33633         -
        self: std::pin::Pin<&mut Self>,
33634         -
        cx: &mut std::task::Context<'_>,
33635         -
    ) -> std::task::Poll<Self::Output> {
33636         -
        let this = self.project();
33637         -
        this.inner.as_mut().poll(cx)
       27645  +
    /// Deserializes an enum union value
       27646  +
    /// Test ID: RestJsonDeserializeEnumUnionValue
       27647  +
    #[::tokio::test]
       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();
       27659  +
        ::pretty_assertions::assert_eq!(
       27660  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
       27661  +
            http_response.status()
       27662  +
        );
       27663  +
        let expected_headers = [("Content-Type", "application/json")];
       27664  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       27665  +
            http_response.headers(),
       27666  +
            expected_headers,
       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  +
        ));
33638  27676   
    }
33639         -
}
33640         -
33641         -
impl<B>
33642         -
    ::aws_smithy_http_server::request::FromRequest<
33643         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
33644         -
        B,
33645         -
    > for crate::input::MalformedAcceptWithPayloadInput
33646         -
where
33647         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
33648         -
    B: 'static,
33649         -
33650         -
    B::Data: Send,
33651         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
33652         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
33653         -
{
33654         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
33655         -
    type Future = MalformedAcceptWithPayloadInputFuture;
33656         -
33657         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
33658         -
        let fut = async move {
33659         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
33660         -
                request.headers(),
33661         -
                &CONTENT_TYPE_MALFORMEDACCEPTWITHPAYLOAD,
33662         -
            ) {
33663         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
33664         -
            }
33665         -
            crate::protocol_serde::shape_malformed_accept_with_payload::de_malformed_accept_with_payload_http_request(request)
33666         -
                            .await
33667         -
                            .map_err(Into::into)
       27677  +
    /// Deserializes a list union value
       27678  +
    /// Test ID: RestJsonDeserializeListUnionValue
       27679  +
    #[::tokio::test]
       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();
       27690  +
        ::pretty_assertions::assert_eq!(
       27691  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
       27692  +
            http_response.status()
       27693  +
        );
       27694  +
        let expected_headers = [("Content-Type", "application/json")];
       27695  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       27696  +
            http_response.headers(),
       27697  +
            expected_headers,
       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  +
        ));
       27707  +
    }
       27708  +
    /// Deserializes a map union value
       27709  +
    /// Test ID: RestJsonDeserializeMapUnionValue
       27710  +
    #[::tokio::test]
       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  +
            })),
33668  27720   
        };
33669         -
        use ::futures_util::future::TryFutureExt;
33670         -
        let fut = fut.map_err(
33671         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
33672         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
33673         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
33674         -
                    e,
33675         -
                )
33676         -
            },
       27721  +
        use ::aws_smithy_http_server::response::IntoResponse;
       27722  +
        let http_response = output.into_response();
       27723  +
        ::pretty_assertions::assert_eq!(
       27724  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
       27725  +
            http_response.status()
       27726  +
        );
       27727  +
        let expected_headers = [("Content-Type", "application/json")];
       27728  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       27729  +
            http_response.headers(),
       27730  +
            expected_headers,
       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"))
33677  27737   
        );
33678         -
        MalformedAcceptWithPayloadInputFuture {
33679         -
            inner: Box::pin(fut),
33680         -
        }
33681  27738   
    }
33682         -
}
33683         -
impl
33684         -
    ::aws_smithy_http_server::response::IntoResponse<
33685         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
33686         -
    > for crate::output::MalformedAcceptWithPayloadOutput
33687         -
{
33688         -
    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) {
33690         -
                        Ok(response) => response,
33691         -
                        Err(e) => {
33692         -
                            ::tracing::error!(error = %e, "failed to serialize response");
33693         -
                            ::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         -
                        }
33695         -
                    }
       27739  +
    /// Deserializes a structure union value
       27740  +
    /// Test ID: RestJsonDeserializeStructureUnionValue
       27741  +
    #[::tokio::test]
       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();
       27753  +
        ::pretty_assertions::assert_eq!(
       27754  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
       27755  +
            http_response.status()
       27756  +
        );
       27757  +
        let expected_headers = [("Content-Type", "application/json")];
       27758  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       27759  +
            http_response.headers(),
       27760  +
            expected_headers,
       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  +
        );
33696  27768   
    }
33697  27769   
}
33698  27770   
33699         -
const CONTENT_TYPE_MALFORMEDACCEPTWITHBODY: ::mime::Mime = ::mime::APPLICATION_JSON;
       27771  +
const CONTENT_TYPE_DOCUMENTTYPEASMAPVALUE: ::mime::Mime = ::mime::APPLICATION_JSON;
33700  27772   
::pin_project_lite::pin_project! {
33701  27773   
    /// 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>>
       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>>
33705  27777   
    }
33706  27778   
}
33707  27779   
33708         -
impl std::future::Future for MalformedAcceptWithBodyInputFuture {
       27780  +
impl std::future::Future for DocumentTypeAsMapValueInputFuture {
33709  27781   
    type Output = Result<
33710         -
        crate::input::MalformedAcceptWithBodyInput,
       27782  +
        crate::input::DocumentTypeAsMapValueInput,
33711  27783   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
33712  27784   
    >;
33713  27785   
33714  27786   
    fn poll(
33715  27787   
        self: std::pin::Pin<&mut Self>,
33716  27788   
        cx: &mut std::task::Context<'_>,
33717  27789   
    ) -> std::task::Poll<Self::Output> {
33718  27790   
        let this = self.project();
33719  27791   
        this.inner.as_mut().poll(cx)
33720  27792   
    }
33721  27793   
}
33722  27794   
33723  27795   
impl<B>
33724  27796   
    ::aws_smithy_http_server::request::FromRequest<
33725  27797   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
33726  27798   
        B,
33727         -
    > for crate::input::MalformedAcceptWithBodyInput
       27799  +
    > for crate::input::DocumentTypeAsMapValueInput
33728  27800   
where
33729  27801   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
33730  27802   
    B: 'static,
33731  27803   
33732  27804   
    B::Data: Send,
33733  27805   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
33734  27806   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
33735  27807   
{
33736  27808   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
33737         -
    type Future = MalformedAcceptWithBodyInputFuture;
       27809  +
    type Future = DocumentTypeAsMapValueInputFuture;
33738  27810   
33739  27811   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
33740  27812   
        let fut = async move {
33741  27813   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
33742  27814   
                request.headers(),
33743         -
                &CONTENT_TYPE_MALFORMEDACCEPTWITHBODY,
       27815  +
                &CONTENT_TYPE_DOCUMENTTYPEASMAPVALUE,
33744  27816   
            ) {
33745  27817   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
33746  27818   
            }
33747         -
            crate::protocol_serde::shape_malformed_accept_with_body::de_malformed_accept_with_body_http_request(request)
       27819  +
            crate::protocol_serde::shape_document_type_as_map_value::de_document_type_as_map_value_http_request(request)
33748  27820   
                            .await
33749  27821   
                            .map_err(Into::into)
33750  27822   
        };
33751  27823   
        use ::futures_util::future::TryFutureExt;
33752  27824   
        let fut = fut.map_err(
33753  27825   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
33754  27826   
                ::tracing::debug!(error = %e, "failed to deserialize request");
33755  27827   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
33756  27828   
                    e,
33757  27829   
                )
33758  27830   
            },
33759  27831   
        );
33760         -
        MalformedAcceptWithBodyInputFuture {
       27832  +
        DocumentTypeAsMapValueInputFuture {
33761  27833   
            inner: Box::pin(fut),
33762  27834   
        }
33763  27835   
    }
33764  27836   
}
33765  27837   
impl
33766  27838   
    ::aws_smithy_http_server::response::IntoResponse<
33767  27839   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
33768         -
    > for crate::output::MalformedAcceptWithBodyOutput
       27840  +
    > for crate::output::DocumentTypeAsMapValueOutput
33769  27841   
{
33770  27842   
    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) {
       27843  +
        match crate::protocol_serde::shape_document_type_as_map_value::ser_document_type_as_map_value_http_response(self) {
33772  27844   
                        Ok(response) => response,
33773  27845   
                        Err(e) => {
33774  27846   
                            ::tracing::error!(error = %e, "failed to serialize response");
33775  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))
33776  27848   
                        }
33777  27849   
                    }
33778  27850   
    }
33779  27851   
}
33780  27852   
33781         -
const CONTENT_TYPE_MALFORMEDCONTENTTYPEWITHGENERICSTRING: ::mime::Mime = ::mime::APPLICATION_JSON;
33782         -
::pin_project_lite::pin_project! {
33783         -
    /// 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>>
33787         -
    }
33788         -
}
33789         -
33790         -
impl std::future::Future for MalformedContentTypeWithGenericStringInputFuture {
33791         -
    type Output = Result<
33792         -
        crate::input::MalformedContentTypeWithGenericStringInput,
33793         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
33794         -
    >;
       27853  +
#[allow(unreachable_code, unused_variables)]
       27854  +
#[cfg(test)]
       27855  +
mod document_type_as_map_value_test {
33795  27856   
33796         -
    fn poll(
33797         -
        self: std::pin::Pin<&mut Self>,
33798         -
        cx: &mut std::task::Context<'_>,
33799         -
    ) -> std::task::Poll<Self::Output> {
33800         -
        let this = self.project();
33801         -
        this.inner.as_mut().poll(cx)
       27857  +
    /// Serializes a map that uses documents as the value.
       27858  +
    /// Test ID: DocumentTypeAsMapValueInput
       27859  +
    #[::tokio::test]
       27860  +
    #[::tracing_test::traced_test]
       27861  +
    async fn document_type_as_map_value_input_request() {
       27862  +
        #[allow(unused_mut)]
       27863  +
                    let mut http_request = http::Request::builder()
       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();
       27868  +
        #[allow(unused_mut)]
       27869  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       27870  +
        let config = crate::service::RestJsonConfig::builder().build();
       27871  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       27872  +
            .document_type_as_map_value(move |input: crate::input::DocumentTypeAsMapValueInput| {
       27873  +
                let sender = sender.clone();
       27874  +
                async move {
       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  +
                    };
       27925  +
                    sender.send(()).await.expect("receiver dropped early");
       27926  +
                    result
       27927  +
                }
       27928  +
            })
       27929  +
            .build_unchecked();
       27930  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       27931  +
            .await
       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  +
        );
33802  27937   
    }
33803         -
}
33804         -
33805         -
impl<B>
33806         -
    ::aws_smithy_http_server::request::FromRequest<
33807         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
33808         -
        B,
33809         -
    > for crate::input::MalformedContentTypeWithGenericStringInput
33810         -
where
33811         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
33812         -
    B: 'static,
33813         -
33814         -
    B::Data: Send,
33815         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
33816         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
33817         -
{
33818         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
33819         -
    type Future = MalformedContentTypeWithGenericStringInputFuture;
33820         -
33821         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
33822         -
        let fut = async move {
33823         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
33824         -
                request.headers(),
33825         -
                &CONTENT_TYPE_MALFORMEDCONTENTTYPEWITHGENERICSTRING,
33826         -
            ) {
33827         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
33828         -
            }
33829         -
            crate::protocol_serde::shape_malformed_content_type_with_generic_string::de_malformed_content_type_with_generic_string_http_request(request)
33830         -
                            .await
33831         -
                            .map_err(Into::into)
       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  +
            }),
33832  27976   
        };
33833         -
        use ::futures_util::future::TryFutureExt;
33834         -
        let fut = fut.map_err(
33835         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
33836         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
33837         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
33838         -
                    e,
33839         -
                )
33840         -
            },
       27977  +
        use ::aws_smithy_http_server::response::IntoResponse;
       27978  +
        let http_response = output.into_response();
       27979  +
        ::pretty_assertions::assert_eq!(
       27980  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
       27981  +
            http_response.status()
       27982  +
        );
       27983  +
        let expected_headers = [("Content-Type", "application/json")];
       27984  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       27985  +
            http_response.headers(),
       27986  +
            expected_headers,
       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"))
33841  27993   
        );
33842         -
        MalformedContentTypeWithGenericStringInputFuture {
33843         -
            inner: Box::pin(fut),
33844         -
        }
33845         -
    }
33846         -
}
33847         -
impl
33848         -
    ::aws_smithy_http_server::response::IntoResponse<
33849         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
33850         -
    > for crate::output::MalformedContentTypeWithGenericStringOutput
33851         -
{
33852         -
    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) {
33854         -
                        Ok(response) => response,
33855         -
                        Err(e) => {
33856         -
                            ::tracing::error!(error = %e, "failed to serialize response");
33857         -
                            ::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         -
                        }
33859         -
                    }
33860  27994   
    }
33861  27995   
}
33862  27996   
33863         -
const CONTENT_TYPE_MALFORMEDCONTENTTYPEWITHPAYLOAD: ::mime::Mime = ::mime::APPLICATION_JSON;
       27997  +
const CONTENT_TYPE_DOCUMENTTYPEASPAYLOAD: ::mime::Mime = ::mime::APPLICATION_JSON;
33864  27998   
::pin_project_lite::pin_project! {
33865  27999   
    /// 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>>
       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>>
33869  28003   
    }
33870  28004   
}
33871  28005   
33872         -
impl std::future::Future for MalformedContentTypeWithPayloadInputFuture {
       28006  +
impl std::future::Future for DocumentTypeAsPayloadInputFuture {
33873  28007   
    type Output = Result<
33874         -
        crate::input::MalformedContentTypeWithPayloadInput,
       28008  +
        crate::input::DocumentTypeAsPayloadInput,
33875  28009   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
33876  28010   
    >;
33877  28011   
33878  28012   
    fn poll(
33879  28013   
        self: std::pin::Pin<&mut Self>,
33880  28014   
        cx: &mut std::task::Context<'_>,
33881  28015   
    ) -> std::task::Poll<Self::Output> {
33882  28016   
        let this = self.project();
33883  28017   
        this.inner.as_mut().poll(cx)
33884  28018   
    }
33885  28019   
}
33886  28020   
33887  28021   
impl<B>
33888  28022   
    ::aws_smithy_http_server::request::FromRequest<
33889  28023   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
33890  28024   
        B,
33891         -
    > for crate::input::MalformedContentTypeWithPayloadInput
       28025  +
    > for crate::input::DocumentTypeAsPayloadInput
33892  28026   
where
33893  28027   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
33894  28028   
    B: 'static,
33895  28029   
33896  28030   
    B::Data: Send,
33897  28031   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
33898  28032   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
33899  28033   
{
33900  28034   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
33901         -
    type Future = MalformedContentTypeWithPayloadInputFuture;
       28035  +
    type Future = DocumentTypeAsPayloadInputFuture;
33902  28036   
33903  28037   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
33904  28038   
        let fut = async move {
33905  28039   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
33906  28040   
                request.headers(),
33907         -
                &CONTENT_TYPE_MALFORMEDCONTENTTYPEWITHPAYLOAD,
       28041  +
                &CONTENT_TYPE_DOCUMENTTYPEASPAYLOAD,
33908  28042   
            ) {
33909  28043   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
33910  28044   
            }
33911         -
            crate::protocol_serde::shape_malformed_content_type_with_payload::de_malformed_content_type_with_payload_http_request(request)
       28045  +
            crate::protocol_serde::shape_document_type_as_payload::de_document_type_as_payload_http_request(request)
33912  28046   
                            .await
33913  28047   
                            .map_err(Into::into)
33914  28048   
        };
33915  28049   
        use ::futures_util::future::TryFutureExt;
33916  28050   
        let fut = fut.map_err(
33917  28051   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
33918  28052   
                ::tracing::debug!(error = %e, "failed to deserialize request");
33919  28053   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
33920  28054   
                    e,
33921  28055   
                )
33922  28056   
            },
33923  28057   
        );
33924         -
        MalformedContentTypeWithPayloadInputFuture {
       28058  +
        DocumentTypeAsPayloadInputFuture {
33925  28059   
            inner: Box::pin(fut),
33926  28060   
        }
33927  28061   
    }
33928  28062   
}
33929  28063   
impl
33930  28064   
    ::aws_smithy_http_server::response::IntoResponse<
33931  28065   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
33932         -
    > for crate::output::MalformedContentTypeWithPayloadOutput
       28066  +
    > for crate::output::DocumentTypeAsPayloadOutput
33933  28067   
{
33934  28068   
    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) {
       28069  +
        match crate::protocol_serde::shape_document_type_as_payload::ser_document_type_as_payload_http_response(self) {
33936  28070   
                        Ok(response) => response,
33937  28071   
                        Err(e) => {
33938  28072   
                            ::tracing::error!(error = %e, "failed to serialize response");
33939  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))
33940  28074   
                        }
33941  28075   
                    }
33942  28076   
    }
33943  28077   
}
33944  28078   
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         -
    >;
       28079  +
#[allow(unreachable_code, unused_variables)]
       28080  +
#[cfg(test)]
       28081  +
mod document_type_as_payload_test {
33959  28082   
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)
       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() {
       28088  +
        #[allow(unused_mut)]
       28089  +
        let mut http_request = http::Request::builder()
       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  +
            ))
       28096  +
            .unwrap();
       28097  +
        #[allow(unused_mut)]
       28098  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       28099  +
        let config = crate::service::RestJsonConfig::builder().build();
       28100  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       28101  +
            .document_type_as_payload(move |input: crate::input::DocumentTypeAsPayloadInput| {
       28102  +
                let sender = sender.clone();
       28103  +
                async move {
       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  +
                    };
       28130  +
                    sender.send(()).await.expect("receiver dropped early");
       28131  +
                    result
       28132  +
                }
       28133  +
            })
       28134  +
            .build_unchecked();
       28135  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       28136  +
            .await
       28137  +
            .expect("unable to make an HTTP request");
       28138  +
        assert!(
       28139  +
            receiver.recv().await.is_some(),
       28140  +
            "we expected operation handler to be invoked but it was not entered"
       28141  +
        );
33966  28142   
    }
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;
33984         -
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)
       28143  +
    /// Serializes a document as the target of the httpPayload trait using a string.
       28144  +
    /// Test ID: DocumentTypeAsPayloadInputString
       28145  +
    #[::tokio::test]
       28146  +
    #[::tracing_test::traced_test]
       28147  +
    async fn document_type_as_payload_input_string_request() {
       28148  +
        #[allow(unused_mut)]
       28149  +
        let mut http_request = http::Request::builder()
       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  +
            ))
       28156  +
            .unwrap();
       28157  +
        #[allow(unused_mut)]
       28158  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       28159  +
        let config = crate::service::RestJsonConfig::builder().build();
       28160  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       28161  +
            .document_type_as_payload(move |input: crate::input::DocumentTypeAsPayloadInput| {
       28162  +
                let sender = sender.clone();
       28163  +
                async move {
       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  +
                    };
       28188  +
                    sender.send(()).await.expect("receiver dropped early");
       28189  +
                    result
       28190  +
                }
       28191  +
            })
       28192  +
            .build_unchecked();
       28193  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       28194  +
            .await
       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  +
            }),
33996  28216   
        };
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         -
                )
34004         -
            },
       28217  +
        use ::aws_smithy_http_server::response::IntoResponse;
       28218  +
        let http_response = output.into_response();
       28219  +
        ::pretty_assertions::assert_eq!(
       28220  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
       28221  +
            http_response.status()
34005  28222   
        );
34006         -
        MalformedContentTypeWithBodyInputFuture {
34007         -
            inner: Box::pin(fut),
34008         -
        }
       28223  +
        let expected_headers = [("Content-Type", "application/json")];
       28224  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       28225  +
            http_response.headers(),
       28226  +
            expected_headers,
       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  +
        ));
34009  28236   
    }
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         -
                        }
34023         -
                    }
       28237  +
    /// Serializes a document as a payload string.
       28238  +
    /// Test ID: DocumentTypeAsPayloadOutputString
       28239  +
    #[::tokio::test]
       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();
       28253  +
        ::pretty_assertions::assert_eq!(
       28254  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
       28255  +
            http_response.status()
       28256  +
        );
       28257  +
        let expected_headers = [("Content-Type", "application/json")];
       28258  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       28259  +
            http_response.headers(),
       28260  +
            expected_headers,
       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  +
        ));
34024  28270   
    }
34025  28271   
}
34026  28272   
34027         -
const CONTENT_TYPE_MALFORMEDCONTENTTYPEWITHOUTBODY: ::mime::Mime = ::mime::APPLICATION_JSON;
       28273  +
const CONTENT_TYPE_DOCUMENTTYPE: ::mime::Mime = ::mime::APPLICATION_JSON;
34028  28274   
::pin_project_lite::pin_project! {
34029  28275   
    /// 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>>
       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>>
34033  28279   
    }
34034  28280   
}
34035  28281   
34036         -
impl std::future::Future for MalformedContentTypeWithoutBodyInputFuture {
       28282  +
impl std::future::Future for DocumentTypeInputFuture {
34037  28283   
    type Output = Result<
34038         -
        crate::input::MalformedContentTypeWithoutBodyInput,
       28284  +
        crate::input::DocumentTypeInput,
34039  28285   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
34040  28286   
    >;
34041  28287   
34042  28288   
    fn poll(
34043  28289   
        self: std::pin::Pin<&mut Self>,
34044  28290   
        cx: &mut std::task::Context<'_>,
34045  28291   
    ) -> std::task::Poll<Self::Output> {
34046  28292   
        let this = self.project();
34047  28293   
        this.inner.as_mut().poll(cx)
34048  28294   
    }
34049  28295   
}
34050  28296   
34051  28297   
impl<B>
34052  28298   
    ::aws_smithy_http_server::request::FromRequest<
34053  28299   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
34054  28300   
        B,
34055         -
    > for crate::input::MalformedContentTypeWithoutBodyInput
       28301  +
    > for crate::input::DocumentTypeInput
34056  28302   
where
34057  28303   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
34058  28304   
    B: 'static,
34059  28305   
34060  28306   
    B::Data: Send,
34061  28307   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
34062  28308   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
34063  28309   
{
34064  28310   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
34065         -
    type Future = MalformedContentTypeWithoutBodyInputFuture;
       28311  +
    type Future = DocumentTypeInputFuture;
34066  28312   
34067  28313   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
34068  28314   
        let fut = async move {
34069  28315   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
34070  28316   
                request.headers(),
34071         -
                &CONTENT_TYPE_MALFORMEDCONTENTTYPEWITHOUTBODY,
       28317  +
                &CONTENT_TYPE_DOCUMENTTYPE,
34072  28318   
            ) {
34073  28319   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
34074  28320   
            }
34075         -
            crate::protocol_serde::shape_malformed_content_type_without_body::de_malformed_content_type_without_body_http_request(request)
34076         -
                            .await
34077         -
                            .map_err(Into::into)
       28321  +
            crate::protocol_serde::shape_document_type::de_document_type_http_request(request)
       28322  +
                .await
       28323  +
                .map_err(Into::into)
34078  28324   
        };
34079  28325   
        use ::futures_util::future::TryFutureExt;
34080  28326   
        let fut = fut.map_err(
34081  28327   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
34082  28328   
                ::tracing::debug!(error = %e, "failed to deserialize request");
34083  28329   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
34084  28330   
                    e,
34085  28331   
                )
34086  28332   
            },
34087  28333   
        );
34088         -
        MalformedContentTypeWithoutBodyInputFuture {
       28334  +
        DocumentTypeInputFuture {
34089  28335   
            inner: Box::pin(fut),
34090  28336   
        }
34091  28337   
    }
34092  28338   
}
34093  28339   
impl
34094  28340   
    ::aws_smithy_http_server::response::IntoResponse<
34095  28341   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
34096         -
    > for crate::output::MalformedContentTypeWithoutBodyOutput
       28342  +
    > for crate::output::DocumentTypeOutput
34097  28343   
{
34098  28344   
    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) {
34100         -
                        Ok(response) => response,
34101         -
                        Err(e) => {
34102         -
                            ::tracing::error!(error = %e, "failed to serialize response");
34103         -
                            ::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         -
                        }
34105         -
                    }
34106         -
    }
34107         -
}
34108         -
34109         -
const CONTENT_TYPE_MALFORMEDTIMESTAMPBODYHTTPDATE: ::mime::Mime = ::mime::APPLICATION_JSON;
34110         -
::pin_project_lite::pin_project! {
34111         -
    /// 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>>
       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  +
        }
34115  28352   
    }
34116  28353   
}
34117  28354   
34118         -
impl std::future::Future for MalformedTimestampBodyHttpDateInputFuture {
34119         -
    type Output = Result<
34120         -
        crate::input::MalformedTimestampBodyHttpDateInput,
34121         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
34122         -
    >;
       28355  +
#[allow(unreachable_code, unused_variables)]
       28356  +
#[cfg(test)]
       28357  +
mod document_type_test {
34123  28358   
34124         -
    fn poll(
34125         -
        self: std::pin::Pin<&mut Self>,
34126         -
        cx: &mut std::task::Context<'_>,
34127         -
    ) -> std::task::Poll<Self::Output> {
34128         -
        let this = self.project();
34129         -
        this.inner.as_mut().poll(cx)
       28359  +
    /// Serializes document types as part of the JSON request payload with no escaping.
       28360  +
    /// Test ID: DocumentTypeInputWithObject
       28361  +
    #[::tokio::test]
       28362  +
    #[::tracing_test::traced_test]
       28363  +
    async fn document_type_input_with_object_request() {
       28364  +
        #[allow(unused_mut)]
       28365  +
                    let mut http_request = http::Request::builder()
       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();
       28370  +
        #[allow(unused_mut)]
       28371  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       28372  +
        let config = crate::service::RestJsonConfig::builder().build();
       28373  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       28374  +
            .document_type(move |input: crate::input::DocumentTypeInput| {
       28375  +
                let sender = sender.clone();
       28376  +
                async move {
       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  +
                    };
       28405  +
                    sender.send(()).await.expect("receiver dropped early");
       28406  +
                    result
       28407  +
                }
       28408  +
            })
       28409  +
            .build_unchecked();
       28410  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       28411  +
            .await
       28412  +
            .expect("unable to make an HTTP request");
       28413  +
        assert!(
       28414  +
            receiver.recv().await.is_some(),
       28415  +
            "we expected operation handler to be invoked but it was not entered"
       28416  +
        );
34130  28417   
    }
34131         -
}
34132         -
34133         -
impl<B>
34134         -
    ::aws_smithy_http_server::request::FromRequest<
34135         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
34136         -
        B,
34137         -
    > for crate::input::MalformedTimestampBodyHttpDateInput
34138         -
where
34139         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
34140         -
    B: 'static,
34141         -
34142         -
    B::Data: Send,
34143         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
34144         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
34145         -
{
34146         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
34147         -
    type Future = MalformedTimestampBodyHttpDateInputFuture;
34148         -
34149         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
34150         -
        let fut = async move {
34151         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
34152         -
                request.headers(),
34153         -
                &CONTENT_TYPE_MALFORMEDTIMESTAMPBODYHTTPDATE,
34154         -
            ) {
34155         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
34156         -
            }
34157         -
            crate::protocol_serde::shape_malformed_timestamp_body_http_date::de_malformed_timestamp_body_http_date_http_request(request)
34158         -
                            .await
34159         -
                            .map_err(Into::into)
34160         -
        };
34161         -
        use ::futures_util::future::TryFutureExt;
34162         -
        let fut = fut.map_err(
34163         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
34164         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
34165         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
34166         -
                    e,
34167         -
                )
34168         -
            },
       28418  +
    /// Serializes document types using a string.
       28419  +
    /// Test ID: DocumentInputWithString
       28420  +
    #[::tokio::test]
       28421  +
    #[::tracing_test::traced_test]
       28422  +
    async fn document_input_with_string_request() {
       28423  +
        #[allow(unused_mut)]
       28424  +
        let mut http_request = http::Request::builder()
       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  +
            ))
       28434  +
            .unwrap();
       28435  +
        #[allow(unused_mut)]
       28436  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       28437  +
        let config = crate::service::RestJsonConfig::builder().build();
       28438  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       28439  +
            .document_type(move |input: crate::input::DocumentTypeInput| {
       28440  +
                let sender = sender.clone();
       28441  +
                async move {
       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  +
                    };
       28468  +
                    sender.send(()).await.expect("receiver dropped early");
       28469  +
                    result
       28470  +
                }
       28471  +
            })
       28472  +
            .build_unchecked();
       28473  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       28474  +
            .await
       28475  +
            .expect("unable to make an HTTP request");
       28476  +
        assert!(
       28477  +
            receiver.recv().await.is_some(),
       28478  +
            "we expected operation handler to be invoked but it was not entered"
34169  28479   
        );
34170         -
        MalformedTimestampBodyHttpDateInputFuture {
34171         -
            inner: Box::pin(fut),
34172         -
        }
34173  28480   
    }
34174         -
}
34175         -
impl
34176         -
    ::aws_smithy_http_server::response::IntoResponse<
34177         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
34178         -
    > for crate::output::MalformedTimestampBodyHttpDateOutput
34179         -
{
34180         -
    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) {
34182         -
                        Ok(response) => response,
34183         -
                        Err(e) => {
34184         -
                            ::tracing::error!(error = %e, "failed to serialize response");
34185         -
                            ::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         -
                        }
34187         -
                    }
       28481  +
    /// Serializes document types using a number.
       28482  +
    /// Test ID: DocumentInputWithNumber
       28483  +
    #[::tokio::test]
       28484  +
    #[::tracing_test::traced_test]
       28485  +
    async fn document_input_with_number_request() {
       28486  +
        #[allow(unused_mut)]
       28487  +
        let mut http_request = http::Request::builder()
       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  +
            ))
       28496  +
            .unwrap();
       28497  +
        #[allow(unused_mut)]
       28498  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       28499  +
        let config = crate::service::RestJsonConfig::builder().build();
       28500  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       28501  +
            .document_type(move |input: crate::input::DocumentTypeInput| {
       28502  +
                let sender = sender.clone();
       28503  +
                async move {
       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  +
                    };
       28530  +
                    sender.send(()).await.expect("receiver dropped early");
       28531  +
                    result
       28532  +
                }
       28533  +
            })
       28534  +
            .build_unchecked();
       28535  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       28536  +
            .await
       28537  +
            .expect("unable to make an HTTP request");
       28538  +
        assert!(
       28539  +
            receiver.recv().await.is_some(),
       28540  +
            "we expected operation handler to be invoked but it was not entered"
       28541  +
        );
34188  28542   
    }
34189         -
}
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()));
34199         -
                response
34200         -
            },
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))
34204         -
            }
34205         -
        }
       28543  +
    /// Serializes document types using a boolean.
       28544  +
    /// Test ID: DocumentInputWithBoolean
       28545  +
    #[::tokio::test]
       28546  +
    #[::tracing_test::traced_test]
       28547  +
    async fn document_input_with_boolean_request() {
       28548  +
        #[allow(unused_mut)]
       28549  +
        let mut http_request = http::Request::builder()
       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  +
            ))
       28559  +
            .unwrap();
       28560  +
        #[allow(unused_mut)]
       28561  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       28562  +
        let config = crate::service::RestJsonConfig::builder().build();
       28563  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       28564  +
            .document_type(move |input: crate::input::DocumentTypeInput| {
       28565  +
                let sender = sender.clone();
       28566  +
                async move {
       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  +
                    };
       28593  +
                    sender.send(()).await.expect("receiver dropped early");
       28594  +
                    result
       28595  +
                }
       28596  +
            })
       28597  +
            .build_unchecked();
       28598  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       28599  +
            .await
       28600  +
            .expect("unable to make an HTTP request");
       28601  +
        assert!(
       28602  +
            receiver.recv().await.is_some(),
       28603  +
            "we expected operation handler to be invoked but it was not entered"
       28604  +
        );
       28605  +
    }
       28606  +
    /// Serializes document types using a list.
       28607  +
    /// Test ID: DocumentInputWithList
       28608  +
    #[::tokio::test]
       28609  +
    #[::tracing_test::traced_test]
       28610  +
    async fn document_input_with_list_request() {
       28611  +
        #[allow(unused_mut)]
       28612  +
                    let mut http_request = http::Request::builder()
       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();
       28617  +
        #[allow(unused_mut)]
       28618  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       28619  +
        let config = crate::service::RestJsonConfig::builder().build();
       28620  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       28621  +
            .document_type(move |input: crate::input::DocumentTypeInput| {
       28622  +
                let sender = sender.clone();
       28623  +
                async move {
       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  +
                    };
       28665  +
                    sender.send(()).await.expect("receiver dropped early");
       28666  +
                    result
       28667  +
                }
       28668  +
            })
       28669  +
            .build_unchecked();
       28670  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       28671  +
            .await
       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  +
        );
34206  28677   
    }
34207         -
}
34208         -
34209         -
const CONTENT_TYPE_MALFORMEDTIMESTAMPBODYDATETIME: ::mime::Mime = ::mime::APPLICATION_JSON;
34210         -
::pin_project_lite::pin_project! {
34211         -
    /// 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>>
       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();
       28697  +
        ::pretty_assertions::assert_eq!(
       28698  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
       28699  +
            http_response.status()
       28700  +
        );
       28701  +
        let expected_headers = [("Content-Type", "application/json")];
       28702  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       28703  +
            http_response.headers(),
       28704  +
            expected_headers,
       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  +
        );
34215  28712   
    }
34216         -
}
34217         -
34218         -
impl std::future::Future for MalformedTimestampBodyDateTimeInputFuture {
34219         -
    type Output = Result<
34220         -
        crate::input::MalformedTimestampBodyDateTimeInput,
34221         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
34222         -
    >;
34223         -
34224         -
    fn poll(
34225         -
        self: std::pin::Pin<&mut Self>,
34226         -
        cx: &mut std::task::Context<'_>,
34227         -
    ) -> std::task::Poll<Self::Output> {
34228         -
        let this = self.project();
34229         -
        this.inner.as_mut().poll(cx)
       28713  +
    /// Document types can be JSON scalars too.
       28714  +
    /// Test ID: DocumentOutputString
       28715  +
    #[::tokio::test]
       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();
       28730  +
        ::pretty_assertions::assert_eq!(
       28731  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
       28732  +
            http_response.status()
       28733  +
        );
       28734  +
        let expected_headers = [("Content-Type", "application/json")];
       28735  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       28736  +
            http_response.headers(),
       28737  +
            expected_headers,
       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  +
        ));
34230  28747   
    }
34231         -
}
34232         -
34233         -
impl<B>
34234         -
    ::aws_smithy_http_server::request::FromRequest<
34235         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
34236         -
        B,
34237         -
    > for crate::input::MalformedTimestampBodyDateTimeInput
34238         -
where
34239         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
34240         -
    B: 'static,
34241         -
34242         -
    B::Data: Send,
34243         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
34244         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
34245         -
{
34246         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
34247         -
    type Future = MalformedTimestampBodyDateTimeInputFuture;
34248         -
34249         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
34250         -
        let fut = async move {
34251         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
34252         -
                request.headers(),
34253         -
                &CONTENT_TYPE_MALFORMEDTIMESTAMPBODYDATETIME,
34254         -
            ) {
34255         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
34256         -
            }
34257         -
            crate::protocol_serde::shape_malformed_timestamp_body_date_time::de_malformed_timestamp_body_date_time_http_request(request)
34258         -
                            .await
34259         -
                            .map_err(Into::into)
       28748  +
    /// Document types can be JSON scalars too.
       28749  +
    /// Test ID: DocumentOutputNumber
       28750  +
    #[::tokio::test]
       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  +
            }),
34260  28762   
        };
34261         -
        use ::futures_util::future::TryFutureExt;
34262         -
        let fut = fut.map_err(
34263         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
34264         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
34265         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
34266         -
                    e,
34267         -
                )
34268         -
            },
       28763  +
        use ::aws_smithy_http_server::response::IntoResponse;
       28764  +
        let http_response = output.into_response();
       28765  +
        ::pretty_assertions::assert_eq!(
       28766  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
       28767  +
            http_response.status()
34269  28768   
        );
34270         -
        MalformedTimestampBodyDateTimeInputFuture {
34271         -
            inner: Box::pin(fut),
34272         -
        }
       28769  +
        let expected_headers = [("Content-Type", "application/json")];
       28770  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       28771  +
            http_response.headers(),
       28772  +
            expected_headers,
       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  +
        ));
34273  28782   
    }
34274         -
}
34275         -
impl
34276         -
    ::aws_smithy_http_server::response::IntoResponse<
34277         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
34278         -
    > for crate::output::MalformedTimestampBodyDateTimeOutput
34279         -
{
34280         -
    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) {
34282         -
                        Ok(response) => response,
34283         -
                        Err(e) => {
34284         -
                            ::tracing::error!(error = %e, "failed to serialize response");
34285         -
                            ::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         -
                        }
34287         -
                    }
       28783  +
    /// Document types can be JSON scalars too.
       28784  +
    /// Test ID: DocumentOutputBoolean
       28785  +
    #[::tokio::test]
       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();
       28800  +
        ::pretty_assertions::assert_eq!(
       28801  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
       28802  +
            http_response.status()
       28803  +
        );
       28804  +
        let expected_headers = [("Content-Type", "application/json")];
       28805  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       28806  +
            http_response.headers(),
       28807  +
            expected_headers,
       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  +
        ));
34288  28817   
    }
34289         -
}
34290         -
impl
34291         -
    ::aws_smithy_http_server::response::IntoResponse<
34292         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
34293         -
    > for crate::error::MalformedTimestampBodyDateTimeError
34294         -
{
34295         -
    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) {
34297         -
            Ok(mut response) => {
34298         -
                response.extensions_mut().insert(::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()));
34299         -
                response
34300         -
            },
34301         -
            Err(e) => {
34302         -
                ::tracing::error!(error = %e, "failed to serialize response");
34303         -
                ::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         -
            }
34305         -
        }
       28818  +
    /// Document types can be JSON arrays.
       28819  +
    /// Test ID: DocumentOutputArray
       28820  +
    #[::tokio::test]
       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();
       28838  +
        ::pretty_assertions::assert_eq!(
       28839  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
       28840  +
            http_response.status()
       28841  +
        );
       28842  +
        let expected_headers = [("Content-Type", "application/json")];
       28843  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       28844  +
            http_response.headers(),
       28845  +
            expected_headers,
       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  +
        );
34306  28853   
    }
34307  28854   
}
34308  28855   
34309         -
const CONTENT_TYPE_MALFORMEDTIMESTAMPBODYDEFAULT: ::mime::Mime = ::mime::APPLICATION_JSON;
       28856  +
const CONTENT_TYPE_JSONBLOBS: ::mime::Mime = ::mime::APPLICATION_JSON;
34310  28857   
::pin_project_lite::pin_project! {
34311  28858   
    /// 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>>
       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>>
34315  28862   
    }
34316  28863   
}
34317  28864   
34318         -
impl std::future::Future for MalformedTimestampBodyDefaultInputFuture {
       28865  +
impl std::future::Future for JsonBlobsInputFuture {
34319  28866   
    type Output = Result<
34320         -
        crate::input::MalformedTimestampBodyDefaultInput,
       28867  +
        crate::input::JsonBlobsInput,
34321  28868   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
34322  28869   
    >;
34323  28870   
34324  28871   
    fn poll(
34325  28872   
        self: std::pin::Pin<&mut Self>,
34326  28873   
        cx: &mut std::task::Context<'_>,
34327  28874   
    ) -> std::task::Poll<Self::Output> {
34328  28875   
        let this = self.project();
34329  28876   
        this.inner.as_mut().poll(cx)
34330  28877   
    }
34331  28878   
}
34332  28879   
34333  28880   
impl<B>
34334  28881   
    ::aws_smithy_http_server::request::FromRequest<
34335  28882   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
34336  28883   
        B,
34337         -
    > for crate::input::MalformedTimestampBodyDefaultInput
       28884  +
    > for crate::input::JsonBlobsInput
34338  28885   
where
34339  28886   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
34340  28887   
    B: 'static,
34341  28888   
34342  28889   
    B::Data: Send,
34343  28890   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
34344  28891   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
34345  28892   
{
34346  28893   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
34347         -
    type Future = MalformedTimestampBodyDefaultInputFuture;
       28894  +
    type Future = JsonBlobsInputFuture;
34348  28895   
34349  28896   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
34350  28897   
        let fut = async move {
34351  28898   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
34352  28899   
                request.headers(),
34353         -
                &CONTENT_TYPE_MALFORMEDTIMESTAMPBODYDEFAULT,
       28900  +
                &CONTENT_TYPE_JSONBLOBS,
34354  28901   
            ) {
34355  28902   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
34356  28903   
            }
34357         -
            crate::protocol_serde::shape_malformed_timestamp_body_default::de_malformed_timestamp_body_default_http_request(request)
34358         -
                            .await
34359         -
                            .map_err(Into::into)
       28904  +
            crate::protocol_serde::shape_json_blobs::de_json_blobs_http_request(request)
       28905  +
                .await
       28906  +
                .map_err(Into::into)
34360  28907   
        };
34361  28908   
        use ::futures_util::future::TryFutureExt;
34362  28909   
        let fut = fut.map_err(
34363  28910   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
34364  28911   
                ::tracing::debug!(error = %e, "failed to deserialize request");
34365  28912   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
34366  28913   
                    e,
34367  28914   
                )
34368  28915   
            },
34369  28916   
        );
34370         -
        MalformedTimestampBodyDefaultInputFuture {
       28917  +
        JsonBlobsInputFuture {
34371  28918   
            inner: Box::pin(fut),
34372  28919   
        }
34373  28920   
    }
34374  28921   
}
34375  28922   
impl
34376  28923   
    ::aws_smithy_http_server::response::IntoResponse<
34377  28924   
        ::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
       28925  +
    > for crate::output::JsonBlobsOutput
34394  28926   
{
34395  28927   
    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         -
            },
       28928  +
        match crate::protocol_serde::shape_json_blobs::ser_json_blobs_http_response(self) {
       28929  +
            Ok(response) => response,
34401  28930   
            Err(e) => {
34402  28931   
                ::tracing::error!(error = %e, "failed to serialize response");
34403  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))
34404  28933   
            }
34405  28934   
        }
34406  28935   
    }
34407  28936   
}
34408  28937   
34409         -
const CONTENT_TYPE_MALFORMEDTIMESTAMPHEADEREPOCH: ::mime::Mime = ::mime::APPLICATION_JSON;
34410         -
::pin_project_lite::pin_project! {
34411         -
    /// 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>>
34415         -
    }
34416         -
}
34417         -
34418         -
impl std::future::Future for MalformedTimestampHeaderEpochInputFuture {
34419         -
    type Output = Result<
34420         -
        crate::input::MalformedTimestampHeaderEpochInput,
34421         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
34422         -
    >;
       28938  +
#[allow(unreachable_code, unused_variables)]
       28939  +
#[cfg(test)]
       28940  +
mod json_blobs_test {
34423  28941   
34424         -
    fn poll(
34425         -
        self: std::pin::Pin<&mut Self>,
34426         -
        cx: &mut std::task::Context<'_>,
34427         -
    ) -> std::task::Poll<Self::Output> {
34428         -
        let this = self.project();
34429         -
        this.inner.as_mut().poll(cx)
       28942  +
    /// Blobs are base64 encoded
       28943  +
    /// Test ID: RestJsonJsonBlobs
       28944  +
    #[::tokio::test]
       28945  +
    #[::tracing_test::traced_test]
       28946  +
    async fn rest_json_json_blobs_request() {
       28947  +
        #[allow(unused_mut)]
       28948  +
        let mut http_request = http::Request::builder()
       28949  +
            .uri("/JsonBlobs")
       28950  +
            .method("POST")
       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  +
            ))
       28955  +
            .unwrap();
       28956  +
        #[allow(unused_mut)]
       28957  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       28958  +
        let config = crate::service::RestJsonConfig::builder().build();
       28959  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       28960  +
            .json_blobs(move |input: crate::input::JsonBlobsInput| {
       28961  +
                let sender = sender.clone();
       28962  +
                async move {
       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  +
                    };
       28975  +
                    sender.send(()).await.expect("receiver dropped early");
       28976  +
                    result
       28977  +
                }
       28978  +
            })
       28979  +
            .build_unchecked();
       28980  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       28981  +
            .await
       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  +
        );
34430  28987   
    }
34431         -
}
34432         -
34433         -
impl<B>
34434         -
    ::aws_smithy_http_server::request::FromRequest<
34435         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
34436         -
        B,
34437         -
    > for crate::input::MalformedTimestampHeaderEpochInput
34438         -
where
34439         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
34440         -
    B: 'static,
34441         -
34442         -
    B::Data: Send,
34443         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
34444         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
34445         -
{
34446         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
34447         -
    type Future = MalformedTimestampHeaderEpochInputFuture;
34448         -
34449         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
34450         -
        let fut = async move {
34451         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
34452         -
                request.headers(),
34453         -
                &CONTENT_TYPE_MALFORMEDTIMESTAMPHEADEREPOCH,
34454         -
            ) {
34455         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
34456         -
            }
34457         -
            crate::protocol_serde::shape_malformed_timestamp_header_epoch::de_malformed_timestamp_header_epoch_http_request(request)
34458         -
                            .await
34459         -
                            .map_err(Into::into)
       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")),
34460  28995   
        };
34461         -
        use ::futures_util::future::TryFutureExt;
34462         -
        let fut = fut.map_err(
34463         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
34464         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
34465         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
34466         -
                    e,
34467         -
                )
34468         -
            },
       28996  +
        use ::aws_smithy_http_server::response::IntoResponse;
       28997  +
        let http_response = output.into_response();
       28998  +
        ::pretty_assertions::assert_eq!(
       28999  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
       29000  +
            http_response.status()
34469  29001   
        );
34470         -
        MalformedTimestampHeaderEpochInputFuture {
34471         -
            inner: Box::pin(fut),
34472         -
        }
34473         -
    }
34474         -
}
34475         -
impl
34476         -
    ::aws_smithy_http_server::response::IntoResponse<
34477         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
34478         -
    > for crate::output::MalformedTimestampHeaderEpochOutput
34479         -
{
34480         -
    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) {
34482         -
                        Ok(response) => response,
34483         -
                        Err(e) => {
34484         -
                            ::tracing::error!(error = %e, "failed to serialize response");
34485         -
                            ::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         -
                        }
34487         -
                    }
34488         -
    }
34489         -
}
34490         -
impl
34491         -
    ::aws_smithy_http_server::response::IntoResponse<
34492         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
34493         -
    > for crate::error::MalformedTimestampHeaderEpochError
34494         -
{
34495         -
    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) {
34497         -
            Ok(mut response) => {
34498         -
                response.extensions_mut().insert(::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()));
34499         -
                response
34500         -
            },
34501         -
            Err(e) => {
34502         -
                ::tracing::error!(error = %e, "failed to serialize response");
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))
34504         -
            }
34505         -
        }
       29002  +
        let expected_headers = [("Content-Type", "application/json")];
       29003  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       29004  +
            http_response.headers(),
       29005  +
            expected_headers,
       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  +
        ));
34506  29015   
    }
34507  29016   
}
34508  29017   
34509         -
const CONTENT_TYPE_MALFORMEDTIMESTAMPHEADERDATETIME: ::mime::Mime = ::mime::APPLICATION_JSON;
       29018  +
const CONTENT_TYPE_SPARSEJSONMAPS: ::mime::Mime = ::mime::APPLICATION_JSON;
34510  29019   
::pin_project_lite::pin_project! {
34511  29020   
    /// 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>>
       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>>
34515  29024   
    }
34516  29025   
}
34517  29026   
34518         -
impl std::future::Future for MalformedTimestampHeaderDateTimeInputFuture {
       29027  +
impl std::future::Future for SparseJsonMapsInputFuture {
34519  29028   
    type Output = Result<
34520         -
        crate::input::MalformedTimestampHeaderDateTimeInput,
       29029  +
        crate::input::SparseJsonMapsInput,
34521  29030   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
34522  29031   
    >;
34523  29032   
34524  29033   
    fn poll(
34525  29034   
        self: std::pin::Pin<&mut Self>,
34526  29035   
        cx: &mut std::task::Context<'_>,
34527  29036   
    ) -> std::task::Poll<Self::Output> {
34528  29037   
        let this = self.project();
34529  29038   
        this.inner.as_mut().poll(cx)
34530  29039   
    }
34531  29040   
}
34532  29041   
34533  29042   
impl<B>
34534  29043   
    ::aws_smithy_http_server::request::FromRequest<
34535  29044   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
34536  29045   
        B,
34537         -
    > for crate::input::MalformedTimestampHeaderDateTimeInput
       29046  +
    > for crate::input::SparseJsonMapsInput
34538  29047   
where
34539  29048   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
34540  29049   
    B: 'static,
34541  29050   
34542  29051   
    B::Data: Send,
34543  29052   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
34544  29053   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
34545  29054   
{
34546  29055   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
34547         -
    type Future = MalformedTimestampHeaderDateTimeInputFuture;
       29056  +
    type Future = SparseJsonMapsInputFuture;
34548  29057   
34549  29058   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
34550  29059   
        let fut = async move {
34551  29060   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
34552  29061   
                request.headers(),
34553         -
                &CONTENT_TYPE_MALFORMEDTIMESTAMPHEADERDATETIME,
       29062  +
                &CONTENT_TYPE_SPARSEJSONMAPS,
34554  29063   
            ) {
34555  29064   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
34556  29065   
            }
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)
       29066  +
            crate::protocol_serde::shape_sparse_json_maps::de_sparse_json_maps_http_request(request)
       29067  +
                .await
       29068  +
                .map_err(Into::into)
34560  29069   
        };
34561  29070   
        use ::futures_util::future::TryFutureExt;
34562  29071   
        let fut = fut.map_err(
34563  29072   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
34564  29073   
                ::tracing::debug!(error = %e, "failed to deserialize request");
34565  29074   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
34566  29075   
                    e,
34567  29076   
                )
34568  29077   
            },
34569  29078   
        );
34570         -
        MalformedTimestampHeaderDateTimeInputFuture {
       29079  +
        SparseJsonMapsInputFuture {
34571  29080   
            inner: Box::pin(fut),
34572  29081   
        }
34573  29082   
    }
34574  29083   
}
34575  29084   
impl
34576  29085   
    ::aws_smithy_http_server::response::IntoResponse<
34577  29086   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
34578         -
    > for crate::output::MalformedTimestampHeaderDateTimeOutput
       29087  +
    > for crate::output::SparseJsonMapsOutput
34579  29088   
{
34580  29089   
    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         -
                    }
       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  +
        }
34588  29099   
    }
34589  29100   
}
34590  29101   
impl
34591  29102   
    ::aws_smithy_http_server::response::IntoResponse<
34592  29103   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
34593         -
    > for crate::error::MalformedTimestampHeaderDateTimeError
       29104  +
    > for crate::error::SparseJsonMapsError
34594  29105   
{
34595  29106   
    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) {
       29107  +
        match crate::protocol_serde::shape_sparse_json_maps::ser_sparse_json_maps_http_error(&self)
       29108  +
        {
34597  29109   
            Ok(mut response) => {
34598         -
                response.extensions_mut().insert(::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()));
       29110  +
                response.extensions_mut().insert(
       29111  +
                    ::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()),
       29112  +
                );
34599  29113   
                response
34600         -
            },
       29114  +
            }
34601  29115   
            Err(e) => {
34602  29116   
                ::tracing::error!(error = %e, "failed to serialize response");
34603  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))
34604  29118   
            }
34605  29119   
        }
34606  29120   
    }
34607  29121   
}
34608  29122   
34609         -
const CONTENT_TYPE_MALFORMEDTIMESTAMPHEADERDEFAULT: ::mime::Mime = ::mime::APPLICATION_JSON;
       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() {
       29132  +
        #[allow(unused_mut)]
       29133  +
                    let mut http_request = http::Request::builder()
       29134  +
                        .uri("/SparseJsonMaps")
       29135  +
                        .method("POST")
       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();
       29138  +
        #[allow(unused_mut)]
       29139  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       29140  +
        let config = crate::service::RestJsonConfig::builder().build();
       29141  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       29142  +
            .sparse_json_maps(move |input: crate::input::SparseJsonMapsInput| {
       29143  +
                let sender = sender.clone();
       29144  +
                async move {
       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  +
                    };
       29178  +
                    sender.send(()).await.expect("receiver dropped early");
       29179  +
                    result
       29180  +
                }
       29181  +
            })
       29182  +
            .build_unchecked();
       29183  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       29184  +
            .await
       29185  +
            .expect("unable to make an HTTP request");
       29186  +
        assert!(
       29187  +
            receiver.recv().await.is_some(),
       29188  +
            "we expected operation handler to be invoked but it was not entered"
       29189  +
        );
       29190  +
    }
       29191  +
    /// Serializes JSON map values in sparse maps
       29192  +
    /// Test ID: RestJsonSerializesSparseNullMapValues
       29193  +
    #[::tokio::test]
       29194  +
    #[::tracing_test::traced_test]
       29195  +
    async fn rest_json_serializes_sparse_null_map_values_request() {
       29196  +
        #[allow(unused_mut)]
       29197  +
                    let mut http_request = http::Request::builder()
       29198  +
                        .uri("/SparseJsonMaps")
       29199  +
                        .method("POST")
       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();
       29202  +
        #[allow(unused_mut)]
       29203  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       29204  +
        let config = crate::service::RestJsonConfig::builder().build();
       29205  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       29206  +
            .sparse_json_maps(move |input: crate::input::SparseJsonMapsInput| {
       29207  +
                let sender = sender.clone();
       29208  +
                async move {
       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  +
                    };
       29243  +
                    sender.send(()).await.expect("receiver dropped early");
       29244  +
                    result
       29245  +
                }
       29246  +
            })
       29247  +
            .build_unchecked();
       29248  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       29249  +
            .await
       29250  +
            .expect("unable to make an HTTP request");
       29251  +
        assert!(
       29252  +
            receiver.recv().await.is_some(),
       29253  +
            "we expected operation handler to be invoked but it was not entered"
       29254  +
        );
       29255  +
    }
       29256  +
    /// Ensure that 0 and false are sent over the wire in all maps and lists
       29257  +
    /// Test ID: RestJsonSerializesZeroValuesInSparseMaps
       29258  +
    #[::tokio::test]
       29259  +
    #[::tracing_test::traced_test]
       29260  +
    async fn rest_json_serializes_zero_values_in_sparse_maps_request() {
       29261  +
        #[allow(unused_mut)]
       29262  +
                    let mut http_request = http::Request::builder()
       29263  +
                        .uri("/SparseJsonMaps")
       29264  +
                        .method("POST")
       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();
       29267  +
        #[allow(unused_mut)]
       29268  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       29269  +
        let config = crate::service::RestJsonConfig::builder().build();
       29270  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       29271  +
            .sparse_json_maps(move |input: crate::input::SparseJsonMapsInput| {
       29272  +
                let sender = sender.clone();
       29273  +
                async move {
       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  +
                    };
       29300  +
                    sender.send(()).await.expect("receiver dropped early");
       29301  +
                    result
       29302  +
                }
       29303  +
            })
       29304  +
            .build_unchecked();
       29305  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       29306  +
            .await
       29307  +
            .expect("unable to make an HTTP request");
       29308  +
        assert!(
       29309  +
            receiver.recv().await.is_some(),
       29310  +
            "we expected operation handler to be invoked but it was not entered"
       29311  +
        );
       29312  +
    }
       29313  +
    /// A request that contains a sparse map of sets
       29314  +
    /// Test ID: RestJsonSerializesSparseSetMap
       29315  +
    #[::tokio::test]
       29316  +
    #[::tracing_test::traced_test]
       29317  +
    async fn rest_json_serializes_sparse_set_map_request() {
       29318  +
        #[allow(unused_mut)]
       29319  +
                    let mut http_request = http::Request::builder()
       29320  +
                        .uri("/SparseJsonMaps")
       29321  +
                        .method("POST")
       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();
       29324  +
        #[allow(unused_mut)]
       29325  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       29326  +
        let config = crate::service::RestJsonConfig::builder().build();
       29327  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       29328  +
            .sparse_json_maps(move |input: crate::input::SparseJsonMapsInput| {
       29329  +
                let sender = sender.clone();
       29330  +
                async move {
       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  +
                    };
       29366  +
                    sender.send(()).await.expect("receiver dropped early");
       29367  +
                    result
       29368  +
                }
       29369  +
            })
       29370  +
            .build_unchecked();
       29371  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       29372  +
            .await
       29373  +
            .expect("unable to make an HTTP request");
       29374  +
        assert!(
       29375  +
            receiver.recv().await.is_some(),
       29376  +
            "we expected operation handler to be invoked but it was not entered"
       29377  +
        );
       29378  +
    }
       29379  +
    /// A request that contains a sparse map of sets.
       29380  +
    /// Test ID: RestJsonSerializesSparseSetMapAndRetainsNull
       29381  +
    #[::tokio::test]
       29382  +
    #[::tracing_test::traced_test]
       29383  +
    async fn rest_json_serializes_sparse_set_map_and_retains_null_request() {
       29384  +
        #[allow(unused_mut)]
       29385  +
                    let mut http_request = http::Request::builder()
       29386  +
                        .uri("/SparseJsonMaps")
       29387  +
                        .method("POST")
       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();
       29390  +
        #[allow(unused_mut)]
       29391  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       29392  +
        let config = crate::service::RestJsonConfig::builder().build();
       29393  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       29394  +
            .sparse_json_maps(move |input: crate::input::SparseJsonMapsInput| {
       29395  +
                let sender = sender.clone();
       29396  +
                async move {
       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  +
                    };
       29433  +
                    sender.send(()).await.expect("receiver dropped early");
       29434  +
                    result
       29435  +
                }
       29436  +
            })
       29437  +
            .build_unchecked();
       29438  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       29439  +
            .await
       29440  +
            .expect("unable to make an HTTP request");
       29441  +
        assert!(
       29442  +
            receiver.recv().await.is_some(),
       29443  +
            "we expected operation handler to be invoked but it was not entered"
       29444  +
        );
       29445  +
    }
       29446  +
    /// Deserializes JSON maps
       29447  +
    /// Test ID: RestJsonSparseJsonMaps
       29448  +
    #[::tokio::test]
       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();
       29475  +
        ::pretty_assertions::assert_eq!(
       29476  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
       29477  +
            http_response.status()
       29478  +
        );
       29479  +
        let expected_headers = [("Content-Type", "application/json")];
       29480  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       29481  +
            http_response.headers(),
       29482  +
            expected_headers,
       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  +
        );
       29490  +
    }
       29491  +
    /// Deserializes null JSON map values
       29492  +
    /// Test ID: RestJsonDeserializesSparseNullMapValues
       29493  +
    #[::tokio::test]
       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();
       29521  +
        ::pretty_assertions::assert_eq!(
       29522  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
       29523  +
            http_response.status()
       29524  +
        );
       29525  +
        let expected_headers = [("Content-Type", "application/json")];
       29526  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       29527  +
            http_response.headers(),
       29528  +
            expected_headers,
       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  +
        );
       29536  +
    }
       29537  +
    /// Ensure that 0 and false are sent over the wire in all maps and lists
       29538  +
    /// Test ID: RestJsonDeserializesZeroValuesInSparseMaps
       29539  +
    #[::tokio::test]
       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();
       29559  +
        ::pretty_assertions::assert_eq!(
       29560  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
       29561  +
            http_response.status()
       29562  +
        );
       29563  +
        let expected_headers = [("Content-Type", "application/json")];
       29564  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       29565  +
            http_response.headers(),
       29566  +
            expected_headers,
       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  +
        );
       29574  +
    }
       29575  +
    /// A response that contains a sparse map of sets
       29576  +
    /// Test ID: RestJsonDeserializesSparseSetMap
       29577  +
    #[::tokio::test]
       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();
       29606  +
        ::pretty_assertions::assert_eq!(
       29607  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
       29608  +
            http_response.status()
       29609  +
        );
       29610  +
        let expected_headers = [("Content-Type", "application/json")];
       29611  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       29612  +
            http_response.headers(),
       29613  +
            expected_headers,
       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  +
        );
       29621  +
    }
       29622  +
    /// A response that contains a sparse map of sets.
       29623  +
    /// Test ID: RestJsonDeserializesSparseSetMapAndRetainsNull
       29624  +
    #[::tokio::test]
       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();
       29654  +
        ::pretty_assertions::assert_eq!(
       29655  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
       29656  +
            http_response.status()
       29657  +
        );
       29658  +
        let expected_headers = [("Content-Type", "application/json")];
       29659  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       29660  +
            http_response.headers(),
       29661  +
            expected_headers,
       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  +
        );
       29669  +
    }
       29670  +
}
       29671  +
       29672  +
const CONTENT_TYPE_JSONMAPS: ::mime::Mime = ::mime::APPLICATION_JSON;
34610  29673   
::pin_project_lite::pin_project! {
34611  29674   
    /// 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>>
       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>>
34615  29678   
    }
34616  29679   
}
34617  29680   
34618         -
impl std::future::Future for MalformedTimestampHeaderDefaultInputFuture {
       29681  +
impl std::future::Future for JsonMapsInputFuture {
34619  29682   
    type Output = Result<
34620         -
        crate::input::MalformedTimestampHeaderDefaultInput,
       29683  +
        crate::input::JsonMapsInput,
34621  29684   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
34622  29685   
    >;
34623  29686   
34624  29687   
    fn poll(
34625  29688   
        self: std::pin::Pin<&mut Self>,
34626  29689   
        cx: &mut std::task::Context<'_>,
34627  29690   
    ) -> std::task::Poll<Self::Output> {
34628  29691   
        let this = self.project();
34629  29692   
        this.inner.as_mut().poll(cx)
34630  29693   
    }
34631  29694   
}
34632  29695   
34633  29696   
impl<B>
34634  29697   
    ::aws_smithy_http_server::request::FromRequest<
34635  29698   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
34636  29699   
        B,
34637         -
    > for crate::input::MalformedTimestampHeaderDefaultInput
       29700  +
    > for crate::input::JsonMapsInput
34638  29701   
where
34639  29702   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
34640  29703   
    B: 'static,
34641  29704   
34642  29705   
    B::Data: Send,
34643  29706   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
34644  29707   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
34645  29708   
{
34646  29709   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
34647         -
    type Future = MalformedTimestampHeaderDefaultInputFuture;
       29710  +
    type Future = JsonMapsInputFuture;
34648  29711   
34649  29712   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
34650  29713   
        let fut = async move {
34651  29714   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
34652  29715   
                request.headers(),
34653         -
                &CONTENT_TYPE_MALFORMEDTIMESTAMPHEADERDEFAULT,
       29716  +
                &CONTENT_TYPE_JSONMAPS,
34654  29717   
            ) {
34655  29718   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
34656  29719   
            }
34657         -
            crate::protocol_serde::shape_malformed_timestamp_header_default::de_malformed_timestamp_header_default_http_request(request)
34658         -
                            .await
34659         -
                            .map_err(Into::into)
       29720  +
            crate::protocol_serde::shape_json_maps::de_json_maps_http_request(request)
       29721  +
                .await
       29722  +
                .map_err(Into::into)
34660  29723   
        };
34661  29724   
        use ::futures_util::future::TryFutureExt;
34662  29725   
        let fut = fut.map_err(
34663  29726   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
34664  29727   
                ::tracing::debug!(error = %e, "failed to deserialize request");
34665  29728   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
34666  29729   
                    e,
34667  29730   
                )
34668  29731   
            },
34669  29732   
        );
34670         -
        MalformedTimestampHeaderDefaultInputFuture {
       29733  +
        JsonMapsInputFuture {
34671  29734   
            inner: Box::pin(fut),
34672  29735   
        }
34673  29736   
    }
34674  29737   
}
34675  29738   
impl
34676  29739   
    ::aws_smithy_http_server::response::IntoResponse<
34677  29740   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
34678         -
    > for crate::output::MalformedTimestampHeaderDefaultOutput
       29741  +
    > for crate::output::JsonMapsOutput
34679  29742   
{
34680  29743   
    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         -
                    }
       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))
       29749  +
            }
       29750  +
        }
34688  29751   
    }
34689  29752   
}
34690  29753   
impl
34691  29754   
    ::aws_smithy_http_server::response::IntoResponse<
34692  29755   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
34693         -
    > for crate::error::MalformedTimestampHeaderDefaultError
       29756  +
    > for crate::error::JsonMapsError
34694  29757   
{
34695  29758   
    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) {
       29759  +
        match crate::protocol_serde::shape_json_maps::ser_json_maps_http_error(&self) {
34697  29760   
            Ok(mut response) => {
34698         -
                response.extensions_mut().insert(::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()));
       29761  +
                response.extensions_mut().insert(
       29762  +
                    ::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()),
       29763  +
                );
34699  29764   
                response
34700         -
            },
       29765  +
            }
34701  29766   
            Err(e) => {
34702  29767   
                ::tracing::error!(error = %e, "failed to serialize response");
34703  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))
34704  29769   
            }
34705  29770   
        }
34706  29771   
    }
34707  29772   
}
34708  29773   
34709         -
const CONTENT_TYPE_MALFORMEDTIMESTAMPQUERYEPOCH: ::mime::Mime = ::mime::APPLICATION_JSON;
       29774  +
#[allow(unreachable_code, unused_variables)]
       29775  +
#[cfg(test)]
       29776  +
mod json_maps_test {
       29777  +
       29778  +
    /// Serializes JSON maps
       29779  +
    /// Test ID: RestJsonJsonMaps
       29780  +
    #[::tokio::test]
       29781  +
    #[::tracing_test::traced_test]
       29782  +
    async fn rest_json_json_maps_request() {
       29783  +
        #[allow(unused_mut)]
       29784  +
                    let mut http_request = http::Request::builder()
       29785  +
                        .uri("/JsonMaps")
       29786  +
                        .method("POST")
       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();
       29789  +
        #[allow(unused_mut)]
       29790  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       29791  +
        let config = crate::service::RestJsonConfig::builder().build();
       29792  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       29793  +
            .json_maps(move |input: crate::input::JsonMapsInput| {
       29794  +
                let sender = sender.clone();
       29795  +
                async move {
       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  +
                    };
       29829  +
                    sender.send(()).await.expect("receiver dropped early");
       29830  +
                    result
       29831  +
                }
       29832  +
            })
       29833  +
            .build_unchecked();
       29834  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       29835  +
            .await
       29836  +
            .expect("unable to make an HTTP request");
       29837  +
        assert!(
       29838  +
            receiver.recv().await.is_some(),
       29839  +
            "we expected operation handler to be invoked but it was not entered"
       29840  +
        );
       29841  +
    }
       29842  +
    /// Ensure that 0 and false are sent over the wire in all maps and lists
       29843  +
    /// Test ID: RestJsonSerializesZeroValuesInMaps
       29844  +
    #[::tokio::test]
       29845  +
    #[::tracing_test::traced_test]
       29846  +
    async fn rest_json_serializes_zero_values_in_maps_request() {
       29847  +
        #[allow(unused_mut)]
       29848  +
                    let mut http_request = http::Request::builder()
       29849  +
                        .uri("/JsonMaps")
       29850  +
                        .method("POST")
       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();
       29853  +
        #[allow(unused_mut)]
       29854  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       29855  +
        let config = crate::service::RestJsonConfig::builder().build();
       29856  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       29857  +
            .json_maps(move |input: crate::input::JsonMapsInput| {
       29858  +
                let sender = sender.clone();
       29859  +
                async move {
       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  +
                    };
       29886  +
                    sender.send(()).await.expect("receiver dropped early");
       29887  +
                    result
       29888  +
                }
       29889  +
            })
       29890  +
            .build_unchecked();
       29891  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       29892  +
            .await
       29893  +
            .expect("unable to make an HTTP request");
       29894  +
        assert!(
       29895  +
            receiver.recv().await.is_some(),
       29896  +
            "we expected operation handler to be invoked but it was not entered"
       29897  +
        );
       29898  +
    }
       29899  +
    /// A request that contains a dense map of sets.
       29900  +
    /// Test ID: RestJsonSerializesDenseSetMap
       29901  +
    #[::tokio::test]
       29902  +
    #[::tracing_test::traced_test]
       29903  +
    async fn rest_json_serializes_dense_set_map_request() {
       29904  +
        #[allow(unused_mut)]
       29905  +
                    let mut http_request = http::Request::builder()
       29906  +
                        .uri("/JsonMaps")
       29907  +
                        .method("POST")
       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();
       29910  +
        #[allow(unused_mut)]
       29911  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       29912  +
        let config = crate::service::RestJsonConfig::builder().build();
       29913  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       29914  +
            .json_maps(move |input: crate::input::JsonMapsInput| {
       29915  +
                let sender = sender.clone();
       29916  +
                async move {
       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  +
                    };
       29948  +
                    sender.send(()).await.expect("receiver dropped early");
       29949  +
                    result
       29950  +
                }
       29951  +
            })
       29952  +
            .build_unchecked();
       29953  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       29954  +
            .await
       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();
       29990  +
        ::pretty_assertions::assert_eq!(
       29991  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
       29992  +
            http_response.status()
       29993  +
        );
       29994  +
        let expected_headers = [("Content-Type", "application/json")];
       29995  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       29996  +
            http_response.headers(),
       29997  +
            expected_headers,
       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  +
        );
       30005  +
    }
       30006  +
    /// Ensure that 0 and false are sent over the wire in all maps and lists
       30007  +
    /// Test ID: RestJsonDeserializesZeroValuesInMaps
       30008  +
    #[::tokio::test]
       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();
       30028  +
        ::pretty_assertions::assert_eq!(
       30029  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
       30030  +
            http_response.status()
       30031  +
        );
       30032  +
        let expected_headers = [("Content-Type", "application/json")];
       30033  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       30034  +
            http_response.headers(),
       30035  +
            expected_headers,
       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  +
        );
       30043  +
    }
       30044  +
    /// A response that contains a dense map of sets.
       30045  +
    /// Test ID: RestJsonDeserializesDenseSetMap
       30046  +
    #[::tokio::test]
       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();
       30071  +
        ::pretty_assertions::assert_eq!(
       30072  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
       30073  +
            http_response.status()
       30074  +
        );
       30075  +
        let expected_headers = [("Content-Type", "application/json")];
       30076  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       30077  +
            http_response.headers(),
       30078  +
            expected_headers,
       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;
34710  30090   
::pin_project_lite::pin_project! {
34711  30091   
    /// 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>>
       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>>
34715  30095   
    }
34716  30096   
}
34717  30097   
34718         -
impl std::future::Future for MalformedTimestampQueryEpochInputFuture {
       30098  +
impl std::future::Future for SparseJsonListsInputFuture {
34719  30099   
    type Output = Result<
34720         -
        crate::input::MalformedTimestampQueryEpochInput,
       30100  +
        crate::input::SparseJsonListsInput,
34721  30101   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
34722  30102   
    >;
34723  30103   
34724  30104   
    fn poll(
34725  30105   
        self: std::pin::Pin<&mut Self>,
34726  30106   
        cx: &mut std::task::Context<'_>,
34727  30107   
    ) -> std::task::Poll<Self::Output> {
34728  30108   
        let this = self.project();
34729  30109   
        this.inner.as_mut().poll(cx)
34730  30110   
    }
34731  30111   
}
34732  30112   
34733  30113   
impl<B>
34734  30114   
    ::aws_smithy_http_server::request::FromRequest<
34735  30115   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
34736  30116   
        B,
34737         -
    > for crate::input::MalformedTimestampQueryEpochInput
       30117  +
    > for crate::input::SparseJsonListsInput
34738  30118   
where
34739  30119   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
34740  30120   
    B: 'static,
34741  30121   
34742  30122   
    B::Data: Send,
34743  30123   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
34744  30124   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
34745  30125   
{
34746  30126   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
34747         -
    type Future = MalformedTimestampQueryEpochInputFuture;
       30127  +
    type Future = SparseJsonListsInputFuture;
34748  30128   
34749  30129   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
34750  30130   
        let fut = async move {
34751  30131   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
34752  30132   
                request.headers(),
34753         -
                &CONTENT_TYPE_MALFORMEDTIMESTAMPQUERYEPOCH,
       30133  +
                &CONTENT_TYPE_SPARSEJSONLISTS,
34754  30134   
            ) {
34755  30135   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
34756  30136   
            }
34757         -
            crate::protocol_serde::shape_malformed_timestamp_query_epoch::de_malformed_timestamp_query_epoch_http_request(request)
34758         -
                            .await
34759         -
                            .map_err(Into::into)
       30137  +
            crate::protocol_serde::shape_sparse_json_lists::de_sparse_json_lists_http_request(
       30138  +
                request,
       30139  +
            )
       30140  +
            .await
       30141  +
            .map_err(Into::into)
34760  30142   
        };
34761  30143   
        use ::futures_util::future::TryFutureExt;
34762  30144   
        let fut = fut.map_err(
34763  30145   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
34764  30146   
                ::tracing::debug!(error = %e, "failed to deserialize request");
34765  30147   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
34766  30148   
                    e,
34767  30149   
                )
34768  30150   
            },
34769  30151   
        );
34770         -
        MalformedTimestampQueryEpochInputFuture {
       30152  +
        SparseJsonListsInputFuture {
34771  30153   
            inner: Box::pin(fut),
34772  30154   
        }
34773  30155   
    }
34774  30156   
}
34775  30157   
impl
34776  30158   
    ::aws_smithy_http_server::response::IntoResponse<
34777  30159   
        ::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
       30160  +
    > for crate::output::SparseJsonListsOutput
34794  30161   
{
34795  30162   
    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         -
            },
       30163  +
        match crate::protocol_serde::shape_sparse_json_lists::ser_sparse_json_lists_http_response(
       30164  +
            self,
       30165  +
        ) {
       30166  +
            Ok(response) => response,
34801  30167   
            Err(e) => {
34802  30168   
                ::tracing::error!(error = %e, "failed to serialize response");
34803  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))
34804  30170   
            }
34805  30171   
        }
34806  30172   
    }
34807  30173   
}
34808  30174   
34809         -
const CONTENT_TYPE_MALFORMEDTIMESTAMPQUERYHTTPDATE: ::mime::Mime = ::mime::APPLICATION_JSON;
       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
       30181  +
    #[::tokio::test]
       30182  +
    #[::tracing_test::traced_test]
       30183  +
    async fn rest_json_sparse_lists_serialize_null_request() {
       30184  +
        #[allow(unused_mut)]
       30185  +
        let mut http_request = http::Request::builder()
       30186  +
            .uri("/SparseJsonLists")
       30187  +
            .method("PUT")
       30188  +
            .header("Content-Type", "application/json")
       30189  +
            .body(::aws_smithy_http_server::body::Body::from(
       30190  +
                ::bytes::Bytes::from_static(
       30191  +
                    "{\n    \"sparseStringList\": [\n        null,\n        \"hi\"\n    ]\n}"
       30192  +
                        .as_bytes(),
       30193  +
                ),
       30194  +
            ))
       30195  +
            .unwrap();
       30196  +
        #[allow(unused_mut)]
       30197  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       30198  +
        let config = crate::service::RestJsonConfig::builder().build();
       30199  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       30200  +
            .sparse_json_lists(move |input: crate::input::SparseJsonListsInput| {
       30201  +
                let sender = sender.clone();
       30202  +
                async move {
       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  +
                    };
       30216  +
                    sender.send(()).await.expect("receiver dropped early");
       30217  +
                    result
       30218  +
                }
       30219  +
            })
       30220  +
            .build_unchecked();
       30221  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       30222  +
            .await
       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();
       30242  +
        ::pretty_assertions::assert_eq!(
       30243  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
       30244  +
            http_response.status()
       30245  +
        );
       30246  +
        let expected_headers = [("Content-Type", "application/json")];
       30247  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       30248  +
            http_response.headers(),
       30249  +
            expected_headers,
       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  +
        ));
       30259  +
    }
       30260  +
}
       30261  +
       30262  +
const CONTENT_TYPE_JSONLISTS: ::mime::Mime = ::mime::APPLICATION_JSON;
34810  30263   
::pin_project_lite::pin_project! {
34811  30264   
    /// 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>>
       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>>
34815  30268   
    }
34816  30269   
}
34817  30270   
34818         -
impl std::future::Future for MalformedTimestampQueryHttpDateInputFuture {
       30271  +
impl std::future::Future for JsonListsInputFuture {
34819  30272   
    type Output = Result<
34820         -
        crate::input::MalformedTimestampQueryHttpDateInput,
       30273  +
        crate::input::JsonListsInput,
34821  30274   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
34822  30275   
    >;
34823  30276   
34824  30277   
    fn poll(
34825  30278   
        self: std::pin::Pin<&mut Self>,
34826  30279   
        cx: &mut std::task::Context<'_>,
34827  30280   
    ) -> std::task::Poll<Self::Output> {
34828  30281   
        let this = self.project();
34829  30282   
        this.inner.as_mut().poll(cx)
34830  30283   
    }
34831  30284   
}
34832  30285   
34833  30286   
impl<B>
34834  30287   
    ::aws_smithy_http_server::request::FromRequest<
34835  30288   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
34836  30289   
        B,
34837         -
    > for crate::input::MalformedTimestampQueryHttpDateInput
       30290  +
    > for crate::input::JsonListsInput
34838  30291   
where
34839  30292   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
34840  30293   
    B: 'static,
34841  30294   
34842  30295   
    B::Data: Send,
34843  30296   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
34844  30297   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
34845  30298   
{
34846  30299   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
34847         -
    type Future = MalformedTimestampQueryHttpDateInputFuture;
       30300  +
    type Future = JsonListsInputFuture;
34848  30301   
34849  30302   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
34850  30303   
        let fut = async move {
34851  30304   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
34852  30305   
                request.headers(),
34853         -
                &CONTENT_TYPE_MALFORMEDTIMESTAMPQUERYHTTPDATE,
       30306  +
                &CONTENT_TYPE_JSONLISTS,
34854  30307   
            ) {
34855  30308   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
34856  30309   
            }
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)
       30310  +
            crate::protocol_serde::shape_json_lists::de_json_lists_http_request(request)
       30311  +
                .await
       30312  +
                .map_err(Into::into)
34860  30313   
        };
34861  30314   
        use ::futures_util::future::TryFutureExt;
34862  30315   
        let fut = fut.map_err(
34863  30316   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
34864  30317   
                ::tracing::debug!(error = %e, "failed to deserialize request");
34865  30318   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
34866  30319   
                    e,
34867  30320   
                )
34868  30321   
            },
34869  30322   
        );
34870         -
        MalformedTimestampQueryHttpDateInputFuture {
       30323  +
        JsonListsInputFuture {
34871  30324   
            inner: Box::pin(fut),
34872  30325   
        }
34873  30326   
    }
34874  30327   
}
34875  30328   
impl
34876  30329   
    ::aws_smithy_http_server::response::IntoResponse<
34877  30330   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
34878         -
    > for crate::output::MalformedTimestampQueryHttpDateOutput
       30331  +
    > for crate::output::JsonListsOutput
34879  30332   
{
34880  30333   
    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         -
                    }
       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  +
        }
34888  30341   
    }
34889  30342   
}
34890  30343   
impl
34891  30344   
    ::aws_smithy_http_server::response::IntoResponse<
34892  30345   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
34893         -
    > for crate::error::MalformedTimestampQueryHttpDateError
       30346  +
    > for crate::error::JsonListsError
34894  30347   
{
34895  30348   
    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) {
       30349  +
        match crate::protocol_serde::shape_json_lists::ser_json_lists_http_error(&self) {
34897  30350   
            Ok(mut response) => {
34898         -
                response.extensions_mut().insert(::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()));
       30351  +
                response.extensions_mut().insert(
       30352  +
                    ::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()),
       30353  +
                );
34899  30354   
                response
34900         -
            },
       30355  +
            }
34901  30356   
            Err(e) => {
34902  30357   
                ::tracing::error!(error = %e, "failed to serialize response");
34903  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))
34904  30359   
            }
34905  30360   
        }
34906  30361   
    }
34907  30362   
}
34908  30363   
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         -
    >;
       30364  +
#[allow(unreachable_code, unused_variables)]
       30365  +
#[cfg(test)]
       30366  +
mod json_lists_test {
34923  30367   
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)
       30368  +
    /// Serializes JSON lists
       30369  +
    /// Test ID: RestJsonLists
       30370  +
    #[::tokio::test]
       30371  +
    #[::tracing_test::traced_test]
       30372  +
    async fn rest_json_lists_request() {
       30373  +
        #[allow(unused_mut)]
       30374  +
                    let mut http_request = http::Request::builder()
       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();
       30379  +
        #[allow(unused_mut)]
       30380  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       30381  +
        let config = crate::service::RestJsonConfig::builder().build();
       30382  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       30383  +
            .json_lists(move |input: crate::input::JsonListsInput| {
       30384  +
                let sender = sender.clone();
       30385  +
                async move {
       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  +
                    };
       30444  +
                    sender.send(()).await.expect("receiver dropped early");
       30445  +
                    result
       30446  +
                }
       30447  +
            })
       30448  +
            .build_unchecked();
       30449  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       30450  +
            .await
       30451  +
            .expect("unable to make an HTTP request");
       30452  +
        assert!(
       30453  +
            receiver.recv().await.is_some(),
       30454  +
            "we expected operation handler to be invoked but it was not entered"
       30455  +
        );
34930  30456   
    }
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         -
            },
       30457  +
    /// Serializes empty JSON lists
       30458  +
    /// Test ID: RestJsonListsEmpty
       30459  +
    #[::tokio::test]
       30460  +
    #[::tracing_test::traced_test]
       30461  +
    async fn rest_json_lists_empty_request() {
       30462  +
        #[allow(unused_mut)]
       30463  +
        let mut http_request = http::Request::builder()
       30464  +
            .uri("/JsonLists")
       30465  +
            .method("PUT")
       30466  +
            .header("Content-Type", "application/json")
       30467  +
            .body(::aws_smithy_http_server::body::Body::from(
       30468  +
                ::bytes::Bytes::from_static("{\n    \"stringList\": []\n}".as_bytes()),
       30469  +
            ))
       30470  +
            .unwrap();
       30471  +
        #[allow(unused_mut)]
       30472  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       30473  +
        let config = crate::service::RestJsonConfig::builder().build();
       30474  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       30475  +
            .json_lists(move |input: crate::input::JsonListsInput| {
       30476  +
                let sender = sender.clone();
       30477  +
                async move {
       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  +
                    };
       30504  +
                    sender.send(()).await.expect("receiver dropped early");
       30505  +
                    result
       30506  +
                }
       30507  +
            })
       30508  +
            .build_unchecked();
       30509  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       30510  +
            .await
       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"
34969  30515   
        );
34970         -
        MalformedTimestampQueryDefaultInputFuture {
34971         -
            inner: Box::pin(fut),
34972         -
        }
34973  30516   
    }
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         -
                    }
       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();
       30560  +
        ::pretty_assertions::assert_eq!(
       30561  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
       30562  +
            http_response.status()
       30563  +
        );
       30564  +
        let expected_headers = [("Content-Type", "application/json")];
       30565  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       30566  +
            http_response.headers(),
       30567  +
            expected_headers,
       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  +
        );
34988  30575   
    }
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         -
        }
       30576  +
    /// Serializes empty JSON lists
       30577  +
    /// Test ID: RestJsonListsEmpty
       30578  +
    #[::tokio::test]
       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();
       30594  +
        ::pretty_assertions::assert_eq!(
       30595  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
       30596  +
            http_response.status()
       30597  +
        );
       30598  +
        let expected_headers = [("Content-Type", "application/json")];
       30599  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       30600  +
            http_response.headers(),
       30601  +
            expected_headers,
       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  +
        ));
35006  30611   
    }
35007  30612   
}
35008  30613   
35009         -
const CONTENT_TYPE_MALFORMEDTIMESTAMPPATHEPOCH: ::mime::Mime = ::mime::APPLICATION_JSON;
       30614  +
const CONTENT_TYPE_RECURSIVESHAPES: ::mime::Mime = ::mime::APPLICATION_JSON;
35010  30615   
::pin_project_lite::pin_project! {
35011  30616   
    /// 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>>
       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>>
35015  30620   
    }
35016  30621   
}
35017  30622   
35018         -
impl std::future::Future for MalformedTimestampPathEpochInputFuture {
       30623  +
impl std::future::Future for RecursiveShapesInputFuture {
35019  30624   
    type Output = Result<
35020         -
        crate::input::MalformedTimestampPathEpochInput,
       30625  +
        crate::input::RecursiveShapesInput,
35021  30626   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
35022  30627   
    >;
35023  30628   
35024  30629   
    fn poll(
35025  30630   
        self: std::pin::Pin<&mut Self>,
35026  30631   
        cx: &mut std::task::Context<'_>,
35027  30632   
    ) -> std::task::Poll<Self::Output> {
35028  30633   
        let this = self.project();
35029  30634   
        this.inner.as_mut().poll(cx)
35030  30635   
    }
35031  30636   
}
35032  30637   
35033  30638   
impl<B>
35034  30639   
    ::aws_smithy_http_server::request::FromRequest<
35035  30640   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
35036  30641   
        B,
35037         -
    > for crate::input::MalformedTimestampPathEpochInput
       30642  +
    > for crate::input::RecursiveShapesInput
35038  30643   
where
35039  30644   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
35040  30645   
    B: 'static,
35041  30646   
35042  30647   
    B::Data: Send,
35043  30648   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
35044  30649   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
35045  30650   
{
35046  30651   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
35047         -
    type Future = MalformedTimestampPathEpochInputFuture;
       30652  +
    type Future = RecursiveShapesInputFuture;
35048  30653   
35049  30654   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
35050  30655   
        let fut = async move {
35051  30656   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
35052  30657   
                request.headers(),
35053         -
                &CONTENT_TYPE_MALFORMEDTIMESTAMPPATHEPOCH,
       30658  +
                &CONTENT_TYPE_RECURSIVESHAPES,
35054  30659   
            ) {
35055  30660   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
35056  30661   
            }
35057         -
            crate::protocol_serde::shape_malformed_timestamp_path_epoch::de_malformed_timestamp_path_epoch_http_request(request)
35058         -
                            .await
35059         -
                            .map_err(Into::into)
       30662  +
            crate::protocol_serde::shape_recursive_shapes::de_recursive_shapes_http_request(request)
       30663  +
                .await
       30664  +
                .map_err(Into::into)
35060  30665   
        };
35061  30666   
        use ::futures_util::future::TryFutureExt;
35062  30667   
        let fut = fut.map_err(
35063  30668   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
35064  30669   
                ::tracing::debug!(error = %e, "failed to deserialize request");
35065  30670   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
35066  30671   
                    e,
35067  30672   
                )
35068  30673   
            },
35069  30674   
        );
35070         -
        MalformedTimestampPathEpochInputFuture {
       30675  +
        RecursiveShapesInputFuture {
35071  30676   
            inner: Box::pin(fut),
35072  30677   
        }
35073  30678   
    }
35074  30679   
}
35075  30680   
impl
35076  30681   
    ::aws_smithy_http_server::response::IntoResponse<
35077  30682   
        ::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
       30683  +
    > for crate::output::RecursiveShapesOutput
35094  30684   
{
35095  30685   
    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         -
            },
       30686  +
        match crate::protocol_serde::shape_recursive_shapes::ser_recursive_shapes_http_response(
       30687  +
            self,
       30688  +
        ) {
       30689  +
            Ok(response) => response,
35101  30690   
            Err(e) => {
35102  30691   
                ::tracing::error!(error = %e, "failed to serialize response");
35103  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))
35104  30693   
            }
35105         -
        }
       30694  +
        }
       30695  +
    }
       30696  +
}
       30697  +
       30698  +
#[allow(unreachable_code, unused_variables)]
       30699  +
#[cfg(test)]
       30700  +
mod recursive_shapes_test {
       30701  +
       30702  +
    /// Serializes recursive structures
       30703  +
    /// Test ID: RestJsonRecursiveShapes
       30704  +
    #[::tokio::test]
       30705  +
    #[::tracing_test::traced_test]
       30706  +
    async fn rest_json_recursive_shapes_request() {
       30707  +
        #[allow(unused_mut)]
       30708  +
                    let mut http_request = http::Request::builder()
       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();
       30713  +
        #[allow(unused_mut)]
       30714  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       30715  +
        let config = crate::service::RestJsonConfig::builder().build();
       30716  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       30717  +
                        .recursive_shapes(move |input: crate::input::RecursiveShapesInput| {
       30718  +
                            let sender = sender.clone();
       30719  +
                            async move {
       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  +
        ;
       30775  +
        ::pretty_assertions::assert_eq!(input, expected);
       30776  +
        let response =
       30777  +
            crate::output::RecursiveShapesOutput {
       30778  +
                nested:
       30779  +
                    ::std::option::Option::None
       30780  +
                ,
       30781  +
            }
       30782  +
        ;
       30783  +
        response };
       30784  +
                                sender.send(()).await.expect("receiver dropped early");
       30785  +
                                result
       30786  +
                            }
       30787  +
                        })
       30788  +
                        .build_unchecked();
       30789  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       30790  +
            .await
       30791  +
            .expect("unable to make an HTTP request");
       30792  +
        assert!(
       30793  +
            receiver.recv().await.is_some(),
       30794  +
            "we expected operation handler to be invoked but it was not entered"
       30795  +
        );
       30796  +
    }
       30797  +
    /// Serializes recursive structures
       30798  +
    /// Test ID: RestJsonRecursiveShapes
       30799  +
    #[::tokio::test]
       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  +
            }),
       30822  +
        };
       30823  +
        use ::aws_smithy_http_server::response::IntoResponse;
       30824  +
        let http_response = output.into_response();
       30825  +
        ::pretty_assertions::assert_eq!(
       30826  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
       30827  +
            http_response.status()
       30828  +
        );
       30829  +
        let expected_headers = [("Content-Type", "application/json")];
       30830  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       30831  +
            http_response.headers(),
       30832  +
            expected_headers,
       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  +
        );
35106  30840   
    }
35107  30841   
}
35108  30842   
35109         -
const CONTENT_TYPE_MALFORMEDTIMESTAMPPATHHTTPDATE: ::mime::Mime = ::mime::APPLICATION_JSON;
       30843  +
const CONTENT_TYPE_JSONINTENUMS: ::mime::Mime = ::mime::APPLICATION_JSON;
35110  30844   
::pin_project_lite::pin_project! {
35111  30845   
    /// 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>>
       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>>
35115  30849   
    }
35116  30850   
}
35117  30851   
35118         -
impl std::future::Future for MalformedTimestampPathHttpDateInputFuture {
       30852  +
impl std::future::Future for JsonIntEnumsInputFuture {
35119  30853   
    type Output = Result<
35120         -
        crate::input::MalformedTimestampPathHttpDateInput,
       30854  +
        crate::input::JsonIntEnumsInput,
35121  30855   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
35122  30856   
    >;
35123  30857   
35124  30858   
    fn poll(
35125  30859   
        self: std::pin::Pin<&mut Self>,
35126  30860   
        cx: &mut std::task::Context<'_>,
35127  30861   
    ) -> std::task::Poll<Self::Output> {
35128  30862   
        let this = self.project();
35129  30863   
        this.inner.as_mut().poll(cx)
35130  30864   
    }
35131  30865   
}
35132  30866   
35133  30867   
impl<B>
35134  30868   
    ::aws_smithy_http_server::request::FromRequest<
35135  30869   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
35136  30870   
        B,
35137         -
    > for crate::input::MalformedTimestampPathHttpDateInput
       30871  +
    > for crate::input::JsonIntEnumsInput
35138  30872   
where
35139  30873   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
35140  30874   
    B: 'static,
35141  30875   
35142  30876   
    B::Data: Send,
35143  30877   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
35144  30878   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
35145  30879   
{
35146  30880   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
35147         -
    type Future = MalformedTimestampPathHttpDateInputFuture;
       30881  +
    type Future = JsonIntEnumsInputFuture;
35148  30882   
35149  30883   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
35150  30884   
        let fut = async move {
35151  30885   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
35152  30886   
                request.headers(),
35153         -
                &CONTENT_TYPE_MALFORMEDTIMESTAMPPATHHTTPDATE,
       30887  +
                &CONTENT_TYPE_JSONINTENUMS,
35154  30888   
            ) {
35155  30889   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
35156  30890   
            }
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)
       30891  +
            crate::protocol_serde::shape_json_int_enums::de_json_int_enums_http_request(request)
       30892  +
                .await
       30893  +
                .map_err(Into::into)
35160  30894   
        };
35161  30895   
        use ::futures_util::future::TryFutureExt;
35162  30896   
        let fut = fut.map_err(
35163  30897   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
35164  30898   
                ::tracing::debug!(error = %e, "failed to deserialize request");
35165  30899   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
35166  30900   
                    e,
35167  30901   
                )
35168  30902   
            },
35169  30903   
        );
35170         -
        MalformedTimestampPathHttpDateInputFuture {
       30904  +
        JsonIntEnumsInputFuture {
35171  30905   
            inner: Box::pin(fut),
35172  30906   
        }
35173  30907   
    }
35174  30908   
}
35175  30909   
impl
35176  30910   
    ::aws_smithy_http_server::response::IntoResponse<
35177  30911   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
35178         -
    > for crate::output::MalformedTimestampPathHttpDateOutput
       30912  +
    > for crate::output::JsonIntEnumsOutput
35179  30913   
{
35180  30914   
    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         -
                    }
       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  +
        }
35188  30922   
    }
35189  30923   
}
35190  30924   
impl
35191  30925   
    ::aws_smithy_http_server::response::IntoResponse<
35192  30926   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
35193         -
    > for crate::error::MalformedTimestampPathHttpDateError
       30927  +
    > for crate::error::JsonIntEnumsError
35194  30928   
{
35195  30929   
    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) {
       30930  +
        match crate::protocol_serde::shape_json_int_enums::ser_json_int_enums_http_error(&self) {
35197  30931   
            Ok(mut response) => {
35198         -
                response.extensions_mut().insert(::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()));
       30932  +
                response.extensions_mut().insert(
       30933  +
                    ::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()),
       30934  +
                );
35199  30935   
                response
35200         -
            },
       30936  +
            }
35201  30937   
            Err(e) => {
35202  30938   
                ::tracing::error!(error = %e, "failed to serialize response");
35203  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))
35204  30940   
            }
35205  30941   
        }
35206  30942   
    }
35207  30943   
}
35208  30944   
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         -
    >;
       30945  +
#[allow(unreachable_code, unused_variables)]
       30946  +
#[cfg(test)]
       30947  +
mod json_int_enums_test {
35223  30948   
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)
       30949  +
    /// Serializes intEnums as integers
       30950  +
    /// Test ID: RestJsonJsonIntEnums
       30951  +
    #[::tokio::test]
       30952  +
    #[::tracing_test::traced_test]
       30953  +
    async fn rest_json_json_int_enums_request() {
       30954  +
        #[allow(unused_mut)]
       30955  +
                    let mut http_request = http::Request::builder()
       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();
       30960  +
        #[allow(unused_mut)]
       30961  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       30962  +
        let config = crate::service::RestJsonConfig::builder().build();
       30963  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       30964  +
            .json_int_enums(move |input: crate::input::JsonIntEnumsInput| {
       30965  +
                let sender = sender.clone();
       30966  +
                async move {
       30967  +
                    let result = {
       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  +
                        };
       30983  +
                        ::pretty_assertions::assert_eq!(input, expected);
       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)
       30993  +
                    };
       30994  +
                    sender.send(()).await.expect("receiver dropped early");
       30995  +
                    result
       30996  +
                }
       30997  +
            })
       30998  +
            .build_unchecked();
       30999  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       31000  +
            .await
       31001  +
            .expect("unable to make an HTTP request");
       31002  +
        assert!(
       31003  +
            receiver.recv().await.is_some(),
       31004  +
            "we expected operation handler to be invoked but it was not entered"
       31005  +
        );
35230  31006   
    }
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)
       31007  +
    /// Serializes intEnums as integers
       31008  +
    /// Test ID: RestJsonJsonIntEnums
       31009  +
    #[::tokio::test]
       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  +
            }),
35260  31026   
        };
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         -
            },
       31027  +
        use ::aws_smithy_http_server::response::IntoResponse;
       31028  +
        let http_response = output.into_response();
       31029  +
        ::pretty_assertions::assert_eq!(
       31030  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
       31031  +
            http_response.status()
       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  +
        ));
       31038  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
       31039  +
            .await
       31040  +
            .expect("unable to extract body to bytes");
       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"))
35269  31043   
        );
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  31044   
    }
35307  31045   
}
35308  31046   
35309         -
const CONTENT_TYPE_MALFORMEDSTRING: ::mime::Mime = ::mime::APPLICATION_JSON;
       31047  +
const CONTENT_TYPE_JSONENUMS: ::mime::Mime = ::mime::APPLICATION_JSON;
35310  31048   
::pin_project_lite::pin_project! {
35311  31049   
    /// 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>>
       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>>
35315  31053   
    }
35316  31054   
}
35317  31055   
35318         -
impl std::future::Future for MalformedStringInputFuture {
       31056  +
impl std::future::Future for JsonEnumsInputFuture {
35319  31057   
    type Output = Result<
35320         -
        crate::input::MalformedStringInput,
       31058  +
        crate::input::JsonEnumsInput,
35321  31059   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
35322  31060   
    >;
35323  31061   
35324  31062   
    fn poll(
35325  31063   
        self: std::pin::Pin<&mut Self>,
35326  31064   
        cx: &mut std::task::Context<'_>,
35327  31065   
    ) -> std::task::Poll<Self::Output> {
35328  31066   
        let this = self.project();
35329  31067   
        this.inner.as_mut().poll(cx)
35330  31068   
    }
35331  31069   
}
35332  31070   
35333  31071   
impl<B>
35334  31072   
    ::aws_smithy_http_server::request::FromRequest<
35335  31073   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
35336  31074   
        B,
35337         -
    > for crate::input::MalformedStringInput
       31075  +
    > for crate::input::JsonEnumsInput
35338  31076   
where
35339  31077   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
35340  31078   
    B: 'static,
35341  31079   
35342  31080   
    B::Data: Send,
35343  31081   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
35344  31082   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
35345  31083   
{
35346  31084   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
35347         -
    type Future = MalformedStringInputFuture;
       31085  +
    type Future = JsonEnumsInputFuture;
35348  31086   
35349  31087   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
35350  31088   
        let fut = async move {
35351  31089   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
35352  31090   
                request.headers(),
35353         -
                &CONTENT_TYPE_MALFORMEDSTRING,
       31091  +
                &CONTENT_TYPE_JSONENUMS,
35354  31092   
            ) {
35355  31093   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
35356  31094   
            }
35357         -
            crate::protocol_serde::shape_malformed_string::de_malformed_string_http_request(request)
       31095  +
            crate::protocol_serde::shape_json_enums::de_json_enums_http_request(request)
35358  31096   
                .await
35359  31097   
                .map_err(Into::into)
35360  31098   
        };
35361  31099   
        use ::futures_util::future::TryFutureExt;
35362  31100   
        let fut = fut.map_err(
35363  31101   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
35364  31102   
                ::tracing::debug!(error = %e, "failed to deserialize request");
35365  31103   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
35366  31104   
                    e,
35367  31105   
                )
35368  31106   
            },
35369  31107   
        );
35370         -
        MalformedStringInputFuture {
       31108  +
        JsonEnumsInputFuture {
35371  31109   
            inner: Box::pin(fut),
35372  31110   
        }
35373  31111   
    }
35374  31112   
}
35375  31113   
impl
35376  31114   
    ::aws_smithy_http_server::response::IntoResponse<
35377  31115   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
35378         -
    > for crate::output::MalformedStringOutput
       31116  +
    > for crate::output::JsonEnumsOutput
35379  31117   
{
35380  31118   
    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         -
        ) {
       31119  +
        match crate::protocol_serde::shape_json_enums::ser_json_enums_http_response(self) {
35384  31120   
            Ok(response) => response,
35385  31121   
            Err(e) => {
35386  31122   
                ::tracing::error!(error = %e, "failed to serialize response");
35387  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))
35388  31124   
            }
35389  31125   
        }
35390  31126   
    }
35391  31127   
}
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>>
       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  +
        }
35399  31146   
    }
35400  31147   
}
35401  31148   
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         -
    >;
       31149  +
#[allow(unreachable_code, unused_variables)]
       31150  +
#[cfg(test)]
       31151  +
mod json_enums_test {
35407  31152   
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)
       31153  +
    /// Serializes simple scalar properties
       31154  +
    /// Test ID: RestJsonJsonEnums
       31155  +
    #[::tokio::test]
       31156  +
    #[::tracing_test::traced_test]
       31157  +
    async fn rest_json_json_enums_request() {
       31158  +
        #[allow(unused_mut)]
       31159  +
                    let mut http_request = http::Request::builder()
       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();
       31164  +
        #[allow(unused_mut)]
       31165  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       31166  +
        let config = crate::service::RestJsonConfig::builder().build();
       31167  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       31168  +
            .json_enums(move |input: crate::input::JsonEnumsInput| {
       31169  +
                let sender = sender.clone();
       31170  +
                async move {
       31171  +
                    let result = {
       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  +
                        };
       31220  +
                        ::pretty_assertions::assert_eq!(input, expected);
       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)
       31230  +
                    };
       31231  +
                    sender.send(()).await.expect("receiver dropped early");
       31232  +
                    result
       31233  +
                }
       31234  +
            })
       31235  +
            .build_unchecked();
       31236  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       31237  +
            .await
       31238  +
            .expect("unable to make an HTTP request");
       31239  +
        assert!(
       31240  +
            receiver.recv().await.is_some(),
       31241  +
            "we expected operation handler to be invoked but it was not entered"
       31242  +
        );
35414  31243   
    }
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)
       31244  +
    /// Serializes simple scalar properties
       31245  +
    /// Test ID: RestJsonJsonEnums
       31246  +
    #[::tokio::test]
       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  +
            }),
35444  31296   
        };
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         -
            },
       31297  +
        use ::aws_smithy_http_server::response::IntoResponse;
       31298  +
        let http_response = output.into_response();
       31299  +
        ::pretty_assertions::assert_eq!(
       31300  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
       31301  +
            http_response.status()
       31302  +
        );
       31303  +
        let expected_headers = [("Content-Type", "application/json")];
       31304  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       31305  +
            http_response.headers(),
       31306  +
            expected_headers,
       31307  +
        ));
       31308  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
       31309  +
            .await
       31310  +
            .expect("unable to extract body to bytes");
       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"))
35453  31313   
        );
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  31314   
    }
35496  31315   
}
35497  31316   
35498         -
const CONTENT_TYPE_MALFORMEDFLOAT: ::mime::Mime = ::mime::APPLICATION_JSON;
       31317  +
const CONTENT_TYPE_JSONTIMESTAMPS: ::mime::Mime = ::mime::APPLICATION_JSON;
35499  31318   
::pin_project_lite::pin_project! {
35500  31319   
    /// 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>>
       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>>
35504  31323   
    }
35505  31324   
}
35506  31325   
35507         -
impl std::future::Future for MalformedFloatInputFuture {
       31326  +
impl std::future::Future for JsonTimestampsInputFuture {
35508  31327   
    type Output = Result<
35509         -
        crate::input::MalformedFloatInput,
       31328  +
        crate::input::JsonTimestampsInput,
35510  31329   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
35511  31330   
    >;
35512  31331   
35513  31332   
    fn poll(
35514  31333   
        self: std::pin::Pin<&mut Self>,
35515  31334   
        cx: &mut std::task::Context<'_>,
35516  31335   
    ) -> std::task::Poll<Self::Output> {
35517  31336   
        let this = self.project();
35518  31337   
        this.inner.as_mut().poll(cx)
35519  31338   
    }
35520  31339   
}
35521  31340   
35522  31341   
impl<B>
35523  31342   
    ::aws_smithy_http_server::request::FromRequest<
35524  31343   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
35525  31344   
        B,
35526         -
    > for crate::input::MalformedFloatInput
       31345  +
    > for crate::input::JsonTimestampsInput
35527  31346   
where
35528  31347   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
35529  31348   
    B: 'static,
35530  31349   
35531  31350   
    B::Data: Send,
35532  31351   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
35533  31352   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
35534  31353   
{
35535  31354   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
35536         -
    type Future = MalformedFloatInputFuture;
       31355  +
    type Future = JsonTimestampsInputFuture;
35537  31356   
35538  31357   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
35539  31358   
        let fut = async move {
35540  31359   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
35541  31360   
                request.headers(),
35542         -
                &CONTENT_TYPE_MALFORMEDFLOAT,
       31361  +
                &CONTENT_TYPE_JSONTIMESTAMPS,
35543  31362   
            ) {
35544  31363   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
35545  31364   
            }
35546         -
            crate::protocol_serde::shape_malformed_float::de_malformed_float_http_request(request)
       31365  +
            crate::protocol_serde::shape_json_timestamps::de_json_timestamps_http_request(request)
35547  31366   
                .await
35548  31367   
                .map_err(Into::into)
35549  31368   
        };
35550  31369   
        use ::futures_util::future::TryFutureExt;
35551  31370   
        let fut = fut.map_err(
35552  31371   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
35553  31372   
                ::tracing::debug!(error = %e, "failed to deserialize request");
35554  31373   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
35555  31374   
                    e,
35556  31375   
                )
35557  31376   
            },
35558  31377   
        );
35559         -
        MalformedFloatInputFuture {
       31378  +
        JsonTimestampsInputFuture {
35560  31379   
            inner: Box::pin(fut),
35561  31380   
        }
35562  31381   
    }
35563  31382   
}
35564  31383   
impl
35565  31384   
    ::aws_smithy_http_server::response::IntoResponse<
35566  31385   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
35567         -
    > for crate::output::MalformedFloatOutput
       31386  +
    > for crate::output::JsonTimestampsOutput
35568  31387   
{
35569  31388   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
35570         -
        match crate::protocol_serde::shape_malformed_float::ser_malformed_float_http_response(self)
       31389  +
        match crate::protocol_serde::shape_json_timestamps::ser_json_timestamps_http_response(self)
35571  31390   
        {
35572  31391   
            Ok(response) => response,
35573  31392   
            Err(e) => {
35574  31393   
                ::tracing::error!(error = %e, "failed to serialize response");
35575  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))
35576  31395   
            }
35577  31396   
        }
35578  31397   
    }
35579  31398   
}
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  31399   
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         -
    >;
       31400  +
#[allow(unreachable_code, unused_variables)]
       31401  +
#[cfg(test)]
       31402  +
mod json_timestamps_test {
35615  31403   
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)
       31404  +
    /// Tests how normal timestamps are serialized
       31405  +
    /// Test ID: RestJsonJsonTimestamps
       31406  +
    #[::tokio::test]
       31407  +
    #[::tracing_test::traced_test]
       31408  +
    async fn rest_json_json_timestamps_request() {
       31409  +
        #[allow(unused_mut)]
       31410  +
        let mut http_request = http::Request::builder()
       31411  +
            .uri("/JsonTimestamps")
       31412  +
            .method("POST")
       31413  +
            .header("Content-Type", "application/json")
       31414  +
            .body(::aws_smithy_http_server::body::Body::from(
       31415  +
                ::bytes::Bytes::from_static("{\n    \"normal\": 1398796238\n}".as_bytes()),
       31416  +
            ))
       31417  +
            .unwrap();
       31418  +
        #[allow(unused_mut)]
       31419  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       31420  +
        let config = crate::service::RestJsonConfig::builder().build();
       31421  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       31422  +
            .json_timestamps(move |input: crate::input::JsonTimestampsInput| {
       31423  +
                let sender = sender.clone();
       31424  +
                async move {
       31425  +
                    let result = {
       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,
       31438  +
                        };
       31439  +
                        ::pretty_assertions::assert_eq!(input, expected);
       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  +
                        };
       31449  +
                        response
       31450  +
                    };
       31451  +
                    sender.send(()).await.expect("receiver dropped early");
       31452  +
                    result
       31453  +
                }
       31454  +
            })
       31455  +
            .build_unchecked();
       31456  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       31457  +
            .await
       31458  +
            .expect("unable to make an HTTP request");
       31459  +
        assert!(
       31460  +
            receiver.recv().await.is_some(),
       31461  +
            "we expected operation handler to be invoked but it was not entered"
       31462  +
        );
35622  31463   
    }
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         -
            },
       31464  +
    /// Ensures that the timestampFormat of date-time works like normal timestamps
       31465  +
    /// Test ID: RestJsonJsonTimestampsWithDateTimeFormat
       31466  +
    #[::tokio::test]
       31467  +
    #[::tracing_test::traced_test]
       31468  +
    async fn rest_json_json_timestamps_with_date_time_format_request() {
       31469  +
        #[allow(unused_mut)]
       31470  +
        let mut http_request = http::Request::builder()
       31471  +
            .uri("/JsonTimestamps")
       31472  +
            .method("POST")
       31473  +
            .header("Content-Type", "application/json")
       31474  +
            .body(::aws_smithy_http_server::body::Body::from(
       31475  +
                ::bytes::Bytes::from_static(
       31476  +
                    "{\n    \"dateTime\": \"2014-04-29T18:30:38Z\"\n}".as_bytes(),
       31477  +
                ),
       31478  +
            ))
       31479  +
            .unwrap();
       31480  +
        #[allow(unused_mut)]
       31481  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       31482  +
        let config = crate::service::RestJsonConfig::builder().build();
       31483  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       31484  +
            .json_timestamps(move |input: crate::input::JsonTimestampsInput| {
       31485  +
                let sender = sender.clone();
       31486  +
                async move {
       31487  +
                    let result = {
       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,
       31500  +
                        };
       31501  +
                        ::pretty_assertions::assert_eq!(input, expected);
       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  +
                        };
       31511  +
                        response
       31512  +
                    };
       31513  +
                    sender.send(()).await.expect("receiver dropped early");
       31514  +
                    result
       31515  +
                }
       31516  +
            })
       31517  +
            .build_unchecked();
       31518  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       31519  +
            .await
       31520  +
            .expect("unable to make an HTTP request");
       31521  +
        assert!(
       31522  +
            receiver.recv().await.is_some(),
       31523  +
            "we expected operation handler to be invoked but it was not entered"
       31524  +
        );
       31525  +
    }
       31526  +
    /// Ensures that the timestampFormat of date-time on the target shape works like normal timestamps
       31527  +
    /// Test ID: RestJsonJsonTimestampsWithDateTimeOnTargetFormat
       31528  +
    #[::tokio::test]
       31529  +
    #[::tracing_test::traced_test]
       31530  +
    async fn rest_json_json_timestamps_with_date_time_on_target_format_request() {
       31531  +
        #[allow(unused_mut)]
       31532  +
        let mut http_request = http::Request::builder()
       31533  +
            .uri("/JsonTimestamps")
       31534  +
            .method("POST")
       31535  +
            .header("Content-Type", "application/json")
       31536  +
            .body(::aws_smithy_http_server::body::Body::from(
       31537  +
                ::bytes::Bytes::from_static(
       31538  +
                    "{\n    \"dateTimeOnTarget\": \"2014-04-29T18:30:38Z\"\n}".as_bytes(),
       31539  +
                ),
       31540  +
            ))
       31541  +
            .unwrap();
       31542  +
        #[allow(unused_mut)]
       31543  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       31544  +
        let config = crate::service::RestJsonConfig::builder().build();
       31545  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       31546  +
            .json_timestamps(move |input: crate::input::JsonTimestampsInput| {
       31547  +
                let sender = sender.clone();
       31548  +
                async move {
       31549  +
                    let result = {
       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,
       31562  +
                        };
       31563  +
                        ::pretty_assertions::assert_eq!(input, expected);
       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
       31574  +
                    };
       31575  +
                    sender.send(()).await.expect("receiver dropped early");
       31576  +
                    result
       31577  +
                }
       31578  +
            })
       31579  +
            .build_unchecked();
       31580  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       31581  +
            .await
       31582  +
            .expect("unable to make an HTTP request");
       31583  +
        assert!(
       31584  +
            receiver.recv().await.is_some(),
       31585  +
            "we expected operation handler to be invoked but it was not entered"
       31586  +
        );
       31587  +
    }
       31588  +
    /// Ensures that the timestampFormat of epoch-seconds works
       31589  +
    /// Test ID: RestJsonJsonTimestampsWithEpochSecondsFormat
       31590  +
    #[::tokio::test]
       31591  +
    #[::tracing_test::traced_test]
       31592  +
    async fn rest_json_json_timestamps_with_epoch_seconds_format_request() {
       31593  +
        #[allow(unused_mut)]
       31594  +
        let mut http_request = http::Request::builder()
       31595  +
            .uri("/JsonTimestamps")
       31596  +
            .method("POST")
       31597  +
            .header("Content-Type", "application/json")
       31598  +
            .body(::aws_smithy_http_server::body::Body::from(
       31599  +
                ::bytes::Bytes::from_static("{\n    \"epochSeconds\": 1398796238\n}".as_bytes()),
       31600  +
            ))
       31601  +
            .unwrap();
       31602  +
        #[allow(unused_mut)]
       31603  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       31604  +
        let config = crate::service::RestJsonConfig::builder().build();
       31605  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       31606  +
            .json_timestamps(move |input: crate::input::JsonTimestampsInput| {
       31607  +
                let sender = sender.clone();
       31608  +
                async move {
       31609  +
                    let result = {
       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,
       31622  +
                        };
       31623  +
                        ::pretty_assertions::assert_eq!(input, expected);
       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,
       31632  +
                        };
       31633  +
                        response
       31634  +
                    };
       31635  +
                    sender.send(()).await.expect("receiver dropped early");
       31636  +
                    result
       31637  +
                }
       31638  +
            })
       31639  +
            .build_unchecked();
       31640  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       31641  +
            .await
       31642  +
            .expect("unable to make an HTTP request");
       31643  +
        assert!(
       31644  +
            receiver.recv().await.is_some(),
       31645  +
            "we expected operation handler to be invoked but it was not entered"
       31646  +
        );
       31647  +
    }
       31648  +
    /// Ensures that the timestampFormat of epoch-seconds on the target shape works
       31649  +
    /// Test ID: RestJsonJsonTimestampsWithEpochSecondsOnTargetFormat
       31650  +
    #[::tokio::test]
       31651  +
    #[::tracing_test::traced_test]
       31652  +
    async fn rest_json_json_timestamps_with_epoch_seconds_on_target_format_request() {
       31653  +
        #[allow(unused_mut)]
       31654  +
        let mut http_request = http::Request::builder()
       31655  +
            .uri("/JsonTimestamps")
       31656  +
            .method("POST")
       31657  +
            .header("Content-Type", "application/json")
       31658  +
            .body(::aws_smithy_http_server::body::Body::from(
       31659  +
                ::bytes::Bytes::from_static(
       31660  +
                    "{\n    \"epochSecondsOnTarget\": 1398796238\n}".as_bytes(),
       31661  +
                ),
       31662  +
            ))
       31663  +
            .unwrap();
       31664  +
        #[allow(unused_mut)]
       31665  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       31666  +
        let config = crate::service::RestJsonConfig::builder().build();
       31667  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       31668  +
            .json_timestamps(move |input: crate::input::JsonTimestampsInput| {
       31669  +
                let sender = sender.clone();
       31670  +
                async move {
       31671  +
                    let result = {
       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,
       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,
       31684  +
                        };
       31685  +
                        ::pretty_assertions::assert_eq!(input, expected);
       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,
       31694  +
                        };
       31695  +
                        response
       31696  +
                    };
       31697  +
                    sender.send(()).await.expect("receiver dropped early");
       31698  +
                    result
       31699  +
                }
       31700  +
            })
       31701  +
            .build_unchecked();
       31702  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       31703  +
            .await
       31704  +
            .expect("unable to make an HTTP request");
       31705  +
        assert!(
       31706  +
            receiver.recv().await.is_some(),
       31707  +
            "we expected operation handler to be invoked but it was not entered"
       31708  +
        );
       31709  +
    }
       31710  +
    /// Ensures that the timestampFormat of http-date works
       31711  +
    /// Test ID: RestJsonJsonTimestampsWithHttpDateFormat
       31712  +
    #[::tokio::test]
       31713  +
    #[::tracing_test::traced_test]
       31714  +
    async fn rest_json_json_timestamps_with_http_date_format_request() {
       31715  +
        #[allow(unused_mut)]
       31716  +
        let mut http_request = http::Request::builder()
       31717  +
            .uri("/JsonTimestamps")
       31718  +
            .method("POST")
       31719  +
            .header("Content-Type", "application/json")
       31720  +
            .body(::aws_smithy_http_server::body::Body::from(
       31721  +
                ::bytes::Bytes::from_static(
       31722  +
                    "{\n    \"httpDate\": \"Tue, 29 Apr 2014 18:30:38 GMT\"\n}".as_bytes(),
       31723  +
                ),
       31724  +
            ))
       31725  +
            .unwrap();
       31726  +
        #[allow(unused_mut)]
       31727  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       31728  +
        let config = crate::service::RestJsonConfig::builder().build();
       31729  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       31730  +
            .json_timestamps(move |input: crate::input::JsonTimestampsInput| {
       31731  +
                let sender = sender.clone();
       31732  +
                async move {
       31733  +
                    let result = {
       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,
       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,
       31746  +
                        };
       31747  +
                        ::pretty_assertions::assert_eq!(input, expected);
       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,
       31756  +
                        };
       31757  +
                        response
       31758  +
                    };
       31759  +
                    sender.send(()).await.expect("receiver dropped early");
       31760  +
                    result
       31761  +
                }
       31762  +
            })
       31763  +
            .build_unchecked();
       31764  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       31765  +
            .await
       31766  +
            .expect("unable to make an HTTP request");
       31767  +
        assert!(
       31768  +
            receiver.recv().await.is_some(),
       31769  +
            "we expected operation handler to be invoked but it was not entered"
35661  31770   
        );
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  31771   
    }
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)
       31772  +
    /// Ensures that the timestampFormat of http-date on the target shape works
       31773  +
    /// Test ID: RestJsonJsonTimestampsWithHttpDateOnTargetFormat
       31774  +
    #[::tokio::test]
       31775  +
    #[::tracing_test::traced_test]
       31776  +
    async fn rest_json_json_timestamps_with_http_date_on_target_format_request() {
       31777  +
        #[allow(unused_mut)]
       31778  +
        let mut http_request = http::Request::builder()
       31779  +
            .uri("/JsonTimestamps")
       31780  +
            .method("POST")
       31781  +
            .header("Content-Type", "application/json")
       31782  +
            .body(::aws_smithy_http_server::body::Body::from(
       31783  +
                ::bytes::Bytes::from_static(
       31784  +
                    "{\n    \"httpDateOnTarget\": \"Tue, 29 Apr 2014 18:30:38 GMT\"\n}".as_bytes(),
       31785  +
                ),
       31786  +
            ))
       31787  +
            .unwrap();
       31788  +
        #[allow(unused_mut)]
       31789  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       31790  +
        let config = crate::service::RestJsonConfig::builder().build();
       31791  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       31792  +
            .json_timestamps(move |input: crate::input::JsonTimestampsInput| {
       31793  +
                let sender = sender.clone();
       31794  +
                async move {
       31795  +
                    let result = {
       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,
       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,
       31808  +
                        };
       31809  +
                        ::pretty_assertions::assert_eq!(input, expected);
       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,
       31818  +
                        };
       31819  +
                        response
       31820  +
                    };
       31821  +
                    sender.send(()).await.expect("receiver dropped early");
       31822  +
                    result
       31823  +
                }
       31824  +
            })
       31825  +
            .build_unchecked();
       31826  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       31827  +
            .await
       31828  +
            .expect("unable to make an HTTP request");
       31829  +
        assert!(
       31830  +
            receiver.recv().await.is_some(),
       31831  +
            "we expected operation handler to be invoked but it was not entered"
       31832  +
        );
35724  31833   
    }
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)
       31834  +
    /// Tests how normal timestamps are serialized
       31835  +
    /// Test ID: RestJsonJsonTimestamps
       31836  +
    #[::tokio::test]
       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,
35754  31849   
        };
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         -
            },
       31850  +
        use ::aws_smithy_http_server::response::IntoResponse;
       31851  +
        let http_response = output.into_response();
       31852  +
        ::pretty_assertions::assert_eq!(
       31853  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
       31854  +
            http_response.status()
35763  31855   
        );
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)
       31856  +
        let expected_headers = [("Content-Type", "application/json")];
       31857  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       31858  +
            http_response.headers(),
       31859  +
            expected_headers,
       31860  +
        ));
       31861  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
       31862  +
            .await
       31863  +
            .expect("unable to extract body to bytes");
       31864  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
       31865  +
            &body,
       31866  +
            "{\n    \"normal\": 1398796238\n}",
       31867  +
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
       31868  +
        ));
35827  31869   
    }
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)
       31870  +
    /// Ensures that the timestampFormat of date-time works like normal timestamps
       31871  +
    /// Test ID: RestJsonJsonTimestampsWithDateTimeFormat
       31872  +
    #[::tokio::test]
       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,
35857  31885   
        };
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         -
            },
       31886  +
        use ::aws_smithy_http_server::response::IntoResponse;
       31887  +
        let http_response = output.into_response();
       31888  +
        ::pretty_assertions::assert_eq!(
       31889  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
       31890  +
            http_response.status()
35866  31891   
        );
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         -
        }
       31892  +
        let expected_headers = [("Content-Type", "application/json")];
       31893  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       31894  +
            http_response.headers(),
       31895  +
            expected_headers,
       31896  +
        ));
       31897  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
       31898  +
            .await
       31899  +
            .expect("unable to extract body to bytes");
       31900  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
       31901  +
            &body,
       31902  +
            "{\n    \"dateTime\": \"2014-04-29T18:30:38Z\"\n}",
       31903  +
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
       31904  +
        ));
35905  31905   
    }
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>>
       31906  +
    /// Ensures that the timestampFormat of date-time on the target shape works like normal timestamps
       31907  +
    /// Test ID: RestJsonJsonTimestampsWithDateTimeOnTargetFormat
       31908  +
    #[::tokio::test]
       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,
       31921  +
        };
       31922  +
        use ::aws_smithy_http_server::response::IntoResponse;
       31923  +
        let http_response = output.into_response();
       31924  +
        ::pretty_assertions::assert_eq!(
       31925  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
       31926  +
            http_response.status()
       31927  +
        );
       31928  +
        let expected_headers = [("Content-Type", "application/json")];
       31929  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       31930  +
            http_response.headers(),
       31931  +
            expected_headers,
       31932  +
        ));
       31933  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
       31934  +
            .await
       31935  +
            .expect("unable to extract body to bytes");
       31936  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
       31937  +
            &body,
       31938  +
            "{\n    \"dateTimeOnTarget\": \"2014-04-29T18:30:38Z\"\n}",
       31939  +
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
       31940  +
        ));
35914  31941   
    }
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)
       31942  +
    /// Ensures that the timestampFormat of epoch-seconds works
       31943  +
    /// Test ID: RestJsonJsonTimestampsWithEpochSecondsFormat
       31944  +
    #[::tokio::test]
       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,
       31957  +
        };
       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())
       31970  +
            .await
       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  +
        ));
35929  31977   
    }
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)
       31978  +
    /// Ensures that the timestampFormat of epoch-seconds on the target shape works
       31979  +
    /// Test ID: RestJsonJsonTimestampsWithEpochSecondsOnTargetFormat
       31980  +
    #[::tokio::test]
       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),
       31986  +
            ),
       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,
       31993  +
        };
       31994  +
        use ::aws_smithy_http_server::response::IntoResponse;
       31995  +
        let http_response = output.into_response();
       31996  +
        ::pretty_assertions::assert_eq!(
       31997  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
       31998  +
            http_response.status()
       31999  +
        );
       32000  +
        let expected_headers = [("Content-Type", "application/json")];
       32001  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       32002  +
            http_response.headers(),
       32003  +
            expected_headers,
       32004  +
        ));
       32005  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
       32006  +
            .await
       32007  +
            .expect("unable to extract body to bytes");
       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  +
        ));
       32013  +
    }
       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,
35959  32029   
        };
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         -
            },
       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()
35968  32035   
        );
35969         -
        MalformedBlobInputFuture {
35970         -
            inner: Box::pin(fut),
35971         -
        }
       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  +
        ));
35972  32049   
    }
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         -
        }
       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  +
        ));
35987  32085   
    }
35988  32086   
}
35989  32087   
35990         -
const CONTENT_TYPE_MALFORMEDMAP: ::mime::Mime = ::mime::APPLICATION_JSON;
       32088  +
const CONTENT_TYPE_SIMPLESCALARPROPERTIES: ::mime::Mime = ::mime::APPLICATION_JSON;
35991  32089   
::pin_project_lite::pin_project! {
35992  32090   
    /// 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>>
       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>>
35996  32094   
    }
35997  32095   
}
35998  32096   
35999         -
impl std::future::Future for MalformedMapInputFuture {
       32097  +
impl std::future::Future for SimpleScalarPropertiesInputFuture {
36000  32098   
    type Output = Result<
36001         -
        crate::input::MalformedMapInput,
       32099  +
        crate::input::SimpleScalarPropertiesInput,
36002  32100   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
36003  32101   
    >;
36004  32102   
36005  32103   
    fn poll(
36006  32104   
        self: std::pin::Pin<&mut Self>,
36007  32105   
        cx: &mut std::task::Context<'_>,
36008  32106   
    ) -> std::task::Poll<Self::Output> {
36009  32107   
        let this = self.project();
36010  32108   
        this.inner.as_mut().poll(cx)
36011  32109   
    }
36012  32110   
}
36013  32111   
36014  32112   
impl<B>
36015  32113   
    ::aws_smithy_http_server::request::FromRequest<
36016  32114   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
36017  32115   
        B,
36018         -
    > for crate::input::MalformedMapInput
       32116  +
    > for crate::input::SimpleScalarPropertiesInput
36019  32117   
where
36020  32118   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
36021  32119   
    B: 'static,
36022  32120   
36023  32121   
    B::Data: Send,
36024  32122   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
36025  32123   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
36026  32124   
{
36027  32125   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
36028         -
    type Future = MalformedMapInputFuture;
       32126  +
    type Future = SimpleScalarPropertiesInputFuture;
36029  32127   
36030  32128   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
36031  32129   
        let fut = async move {
36032  32130   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
36033  32131   
                request.headers(),
36034         -
                &CONTENT_TYPE_MALFORMEDMAP,
       32132  +
                &CONTENT_TYPE_SIMPLESCALARPROPERTIES,
36035  32133   
            ) {
36036  32134   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
36037  32135   
            }
36038         -
            crate::protocol_serde::shape_malformed_map::de_malformed_map_http_request(request)
36039         -
                .await
36040         -
                .map_err(Into::into)
       32136  +
            crate::protocol_serde::shape_simple_scalar_properties::de_simple_scalar_properties_http_request(request)
       32137  +
                            .await
       32138  +
                            .map_err(Into::into)
36041  32139   
        };
36042  32140   
        use ::futures_util::future::TryFutureExt;
36043  32141   
        let fut = fut.map_err(
36044  32142   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
36045  32143   
                ::tracing::debug!(error = %e, "failed to deserialize request");
36046  32144   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
36047  32145   
                    e,
36048  32146   
                )
36049  32147   
            },
36050  32148   
        );
36051         -
        MalformedMapInputFuture {
       32149  +
        SimpleScalarPropertiesInputFuture {
36052  32150   
            inner: Box::pin(fut),
36053  32151   
        }
36054  32152   
    }
36055  32153   
}
36056  32154   
impl
36057  32155   
    ::aws_smithy_http_server::response::IntoResponse<
36058  32156   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
36059         -
    > for crate::output::MalformedMapOutput
       32157  +
    > for crate::output::SimpleScalarPropertiesOutput
36060  32158   
{
36061  32159   
    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>>
       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  +
                    }
36078  32167   
    }
36079  32168   
}
36080  32169   
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         -
    >;
       32170  +
#[allow(unreachable_code, unused_variables)]
       32171  +
#[cfg(test)]
       32172  +
mod simple_scalar_properties_test {
36086  32173   
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)
       32174  +
    /// Serializes simple scalar properties
       32175  +
    /// Test ID: RestJsonSimpleScalarProperties
       32176  +
    #[::tokio::test]
       32177  +
    #[::tracing_test::traced_test]
       32178  +
    async fn rest_json_simple_scalar_properties_request() {
       32179  +
        #[allow(unused_mut)]
       32180  +
                    let mut http_request = http::Request::builder()
       32181  +
                        .uri("/SimpleScalarProperties")
       32182  +
                        .method("PUT")
       32183  +
        .header("Content-Type", "application/json")
       32184  +
        .header("X-Foo", "Foo")
       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();
       32186  +
        #[allow(unused_mut)]
       32187  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       32188  +
        let config = crate::service::RestJsonConfig::builder().build();
       32189  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       32190  +
            .simple_scalar_properties(move |input: crate::input::SimpleScalarPropertiesInput| {
       32191  +
                let sender = sender.clone();
       32192  +
                async move {
       32193  +
                    let result = {
       32194  +
                        use ::aws_smithy_protocol_test::FloatEquals;
       32195  +
                        let expected = crate::input::SimpleScalarPropertiesInput {
       32196  +
                            foo: ::std::option::Option::Some("Foo".to_owned()),
       32197  +
                            string_value: ::std::option::Option::Some("string".to_owned()),
       32198  +
                            true_boolean_value: ::std::option::Option::Some(true),
       32199  +
                            false_boolean_value: ::std::option::Option::Some(false),
       32200  +
                            byte_value: ::std::option::Option::Some(1),
       32201  +
                            short_value: ::std::option::Option::Some(2),
       32202  +
                            integer_value: ::std::option::Option::Some(3),
       32203  +
                            long_value: ::std::option::Option::Some(4),
       32204  +
                            float_value: ::std::option::Option::Some(5.5_f32),
       32205  +
                            double_value: ::std::option::Option::Some(6.5_f64),
       32206  +
                        };
       32207  +
                        ::pretty_assertions::assert_eq!(
       32208  +
                            input.foo,
       32209  +
                            expected.foo,
       32210  +
                            "Unexpected value for `foo`"
       32211  +
                        );
       32212  +
                        ::pretty_assertions::assert_eq!(
       32213  +
                            input.string_value,
       32214  +
                            expected.string_value,
       32215  +
                            "Unexpected value for `string_value`"
       32216  +
                        );
       32217  +
                        ::pretty_assertions::assert_eq!(
       32218  +
                            input.true_boolean_value,
       32219  +
                            expected.true_boolean_value,
       32220  +
                            "Unexpected value for `true_boolean_value`"
       32221  +
                        );
       32222  +
                        ::pretty_assertions::assert_eq!(
       32223  +
                            input.false_boolean_value,
       32224  +
                            expected.false_boolean_value,
       32225  +
                            "Unexpected value for `false_boolean_value`"
       32226  +
                        );
       32227  +
                        ::pretty_assertions::assert_eq!(
       32228  +
                            input.byte_value,
       32229  +
                            expected.byte_value,
       32230  +
                            "Unexpected value for `byte_value`"
       32231  +
                        );
       32232  +
                        ::pretty_assertions::assert_eq!(
       32233  +
                            input.short_value,
       32234  +
                            expected.short_value,
       32235  +
                            "Unexpected value for `short_value`"
       32236  +
                        );
       32237  +
                        ::pretty_assertions::assert_eq!(
       32238  +
                            input.integer_value,
       32239  +
                            expected.integer_value,
       32240  +
                            "Unexpected value for `integer_value`"
       32241  +
                        );
       32242  +
                        ::pretty_assertions::assert_eq!(
       32243  +
                            input.long_value,
       32244  +
                            expected.long_value,
       32245  +
                            "Unexpected value for `long_value`"
       32246  +
                        );
       32247  +
                        assert!(
       32248  +
                            input.float_value.float_equals(&expected.float_value),
       32249  +
                            "Unexpected value for `float_value` {:?} vs. {:?}",
       32250  +
                            expected.float_value,
       32251  +
                            input.float_value
       32252  +
                        );
       32253  +
                        assert!(
       32254  +
                            input.double_value.float_equals(&expected.double_value),
       32255  +
                            "Unexpected value for `double_value` {:?} vs. {:?}",
       32256  +
                            expected.double_value,
       32257  +
                            input.double_value
       32258  +
                        );
       32259  +
                        let response = crate::output::SimpleScalarPropertiesOutput {
       32260  +
                            foo: ::std::option::Option::None,
       32261  +
                            string_value: ::std::option::Option::None,
       32262  +
                            true_boolean_value: ::std::option::Option::None,
       32263  +
                            false_boolean_value: ::std::option::Option::None,
       32264  +
                            byte_value: ::std::option::Option::None,
       32265  +
                            short_value: ::std::option::Option::None,
       32266  +
                            integer_value: ::std::option::Option::None,
       32267  +
                            long_value: ::std::option::Option::None,
       32268  +
                            float_value: ::std::option::Option::None,
       32269  +
                            double_value: ::std::option::Option::None,
       32270  +
                        };
       32271  +
                        response
       32272  +
                    };
       32273  +
                    sender.send(()).await.expect("receiver dropped early");
       32274  +
                    result
       32275  +
                }
       32276  +
            })
       32277  +
            .build_unchecked();
       32278  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       32279  +
            .await
       32280  +
            .expect("unable to make an HTTP request");
       32281  +
        assert!(
       32282  +
            receiver.recv().await.is_some(),
       32283  +
            "we expected operation handler to be invoked but it was not entered"
       32284  +
        );
36093  32285   
    }
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);
       32286  +
    /// Rest Json should not deserialize null structure values
       32287  +
    /// Test ID: RestJsonServersDontSerializeNullStructureValues
       32288  +
    #[::tokio::test]
       32289  +
    #[::tracing_test::traced_test]
       32290  +
    async fn rest_json_servers_dont_serialize_null_structure_values_request() {
       32291  +
        #[allow(unused_mut)]
       32292  +
        let mut http_request = http::Request::builder()
       32293  +
            .uri("/SimpleScalarProperties")
       32294  +
            .method("PUT")
       32295  +
            .header("Content-Type", "application/json")
       32296  +
            .body(::aws_smithy_http_server::body::Body::from(
       32297  +
                ::bytes::Bytes::from_static("{\n    \"stringValue\": null\n}".as_bytes()),
       32298  +
            ))
       32299  +
            .unwrap();
       32300  +
        #[allow(unused_mut)]
       32301  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       32302  +
        let config = crate::service::RestJsonConfig::builder().build();
       32303  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       32304  +
            .simple_scalar_properties(move |input: crate::input::SimpleScalarPropertiesInput| {
       32305  +
                let sender = sender.clone();
       32306  +
                async move {
       32307  +
                    let result = {
       32308  +
                        use ::aws_smithy_protocol_test::FloatEquals;
       32309  +
                        let expected = crate::input::SimpleScalarPropertiesInput {
       32310  +
                            foo: ::std::option::Option::None,
       32311  +
                            string_value: ::std::option::Option::None,
       32312  +
                            true_boolean_value: ::std::option::Option::None,
       32313  +
                            false_boolean_value: ::std::option::Option::None,
       32314  +
                            byte_value: ::std::option::Option::None,
       32315  +
                            short_value: ::std::option::Option::None,
       32316  +
                            integer_value: ::std::option::Option::None,
       32317  +
                            long_value: ::std::option::Option::None,
       32318  +
                            float_value: ::std::option::Option::None,
       32319  +
                            double_value: ::std::option::Option::None,
       32320  +
                        };
       32321  +
                        ::pretty_assertions::assert_eq!(
       32322  +
                            input.foo,
       32323  +
                            expected.foo,
       32324  +
                            "Unexpected value for `foo`"
       32325  +
                        );
       32326  +
                        ::pretty_assertions::assert_eq!(
       32327  +
                            input.string_value,
       32328  +
                            expected.string_value,
       32329  +
                            "Unexpected value for `string_value`"
       32330  +
                        );
       32331  +
                        ::pretty_assertions::assert_eq!(
       32332  +
                            input.true_boolean_value,
       32333  +
                            expected.true_boolean_value,
       32334  +
                            "Unexpected value for `true_boolean_value`"
       32335  +
                        );
       32336  +
                        ::pretty_assertions::assert_eq!(
       32337  +
                            input.false_boolean_value,
       32338  +
                            expected.false_boolean_value,
       32339  +
                            "Unexpected value for `false_boolean_value`"
       32340  +
                        );
       32341  +
                        ::pretty_assertions::assert_eq!(
       32342  +
                            input.byte_value,
       32343  +
                            expected.byte_value,
       32344  +
                            "Unexpected value for `byte_value`"
       32345  +
                        );
       32346  +
                        ::pretty_assertions::assert_eq!(
       32347  +
                            input.short_value,
       32348  +
                            expected.short_value,
       32349  +
                            "Unexpected value for `short_value`"
       32350  +
                        );
       32351  +
                        ::pretty_assertions::assert_eq!(
       32352  +
                            input.integer_value,
       32353  +
                            expected.integer_value,
       32354  +
                            "Unexpected value for `integer_value`"
       32355  +
                        );
       32356  +
                        ::pretty_assertions::assert_eq!(
       32357  +
                            input.long_value,
       32358  +
                            expected.long_value,
       32359  +
                            "Unexpected value for `long_value`"
       32360  +
                        );
       32361  +
                        assert!(
       32362  +
                            input.float_value.float_equals(&expected.float_value),
       32363  +
                            "Unexpected value for `float_value` {:?} vs. {:?}",
       32364  +
                            expected.float_value,
       32365  +
                            input.float_value
       32366  +
                        );
       32367  +
                        assert!(
       32368  +
                            input.double_value.float_equals(&expected.double_value),
       32369  +
                            "Unexpected value for `double_value` {:?} vs. {:?}",
       32370  +
                            expected.double_value,
       32371  +
                            input.double_value
       32372  +
                        );
       32373  +
                        let response = crate::output::SimpleScalarPropertiesOutput {
       32374  +
                            foo: ::std::option::Option::None,
       32375  +
                            string_value: ::std::option::Option::None,
       32376  +
                            true_boolean_value: ::std::option::Option::None,
       32377  +
                            false_boolean_value: ::std::option::Option::None,
       32378  +
                            byte_value: ::std::option::Option::None,
       32379  +
                            short_value: ::std::option::Option::None,
       32380  +
                            integer_value: ::std::option::Option::None,
       32381  +
                            long_value: ::std::option::Option::None,
       32382  +
                            float_value: ::std::option::Option::None,
       32383  +
                            double_value: ::std::option::Option::None,
       32384  +
                        };
       32385  +
                        response
       32386  +
                    };
       32387  +
                    sender.send(()).await.expect("receiver dropped early");
       32388  +
                    result
       32389  +
                }
       32390  +
            })
       32391  +
            .build_unchecked();
       32392  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       32393  +
            .await
       32394  +
            .expect("unable to make an HTTP request");
       32395  +
        assert!(
       32396  +
            receiver.recv().await.is_some(),
       32397  +
            "we expected operation handler to be invoked but it was not entered"
       32398  +
        );
       32399  +
    }
       32400  +
    /// Supports handling NaN float values.
       32401  +
    /// Test ID: RestJsonSupportsNaNFloatInputs
       32402  +
    #[::tokio::test]
       32403  +
    #[::tracing_test::traced_test]
       32404  +
    async fn rest_json_supports_na_n_float_inputs_request() {
       32405  +
        #[allow(unused_mut)]
       32406  +
        let mut http_request = http::Request::builder()
       32407  +
            .uri("/SimpleScalarProperties")
       32408  +
            .method("PUT")
       32409  +
            .header("Content-Type", "application/json")
       32410  +
            .body(::aws_smithy_http_server::body::Body::from(
       32411  +
                ::bytes::Bytes::from_static(
       32412  +
                    "{\n    \"floatValue\": \"NaN\",\n    \"DoubleDribble\": \"NaN\"\n}".as_bytes(),
       32413  +
                ),
       32414  +
            ))
       32415  +
            .unwrap();
       32416  +
        #[allow(unused_mut)]
       32417  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       32418  +
        let config = crate::service::RestJsonConfig::builder().build();
       32419  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       32420  +
                        .simple_scalar_properties(move |input: crate::input::SimpleScalarPropertiesInput| {
       32421  +
                            let sender = sender.clone();
       32422  +
                            async move {
       32423  +
                                let result = { use ::aws_smithy_protocol_test::FloatEquals;
       32424  +
        let expected =
       32425  +
            crate::input::SimpleScalarPropertiesInput {
       32426  +
                float_value:
       32427  +
                    ::std::option::Option::Some(
       32428  +
                        <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("NaN").expect("invalid string for number")
       32429  +
                    )
       32430  +
                ,
       32431  +
                double_value:
       32432  +
                    ::std::option::Option::Some(
       32433  +
                        <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("NaN").expect("invalid string for number")
       32434  +
                    )
       32435  +
                ,
       32436  +
                foo:
       32437  +
                    ::std::option::Option::None
       32438  +
                ,
       32439  +
                string_value:
       32440  +
                    ::std::option::Option::None
       32441  +
                ,
       32442  +
                true_boolean_value:
       32443  +
                    ::std::option::Option::None
       32444  +
                ,
       32445  +
                false_boolean_value:
       32446  +
                    ::std::option::Option::None
       32447  +
                ,
       32448  +
                byte_value:
       32449  +
                    ::std::option::Option::None
       32450  +
                ,
       32451  +
                short_value:
       32452  +
                    ::std::option::Option::None
       32453  +
                ,
       32454  +
                integer_value:
       32455  +
                    ::std::option::Option::None
       32456  +
                ,
       32457  +
                long_value:
       32458  +
                    ::std::option::Option::None
       32459  +
                ,
       32460  +
            }
       32461  +
        ;
       32462  +
        ::pretty_assertions::assert_eq!(input.foo, expected.foo, "Unexpected value for `foo`");
       32463  +
        ::pretty_assertions::assert_eq!(input.string_value, expected.string_value, "Unexpected value for `string_value`");
       32464  +
        ::pretty_assertions::assert_eq!(input.true_boolean_value, expected.true_boolean_value, "Unexpected value for `true_boolean_value`");
       32465  +
        ::pretty_assertions::assert_eq!(input.false_boolean_value, expected.false_boolean_value, "Unexpected value for `false_boolean_value`");
       32466  +
        ::pretty_assertions::assert_eq!(input.byte_value, expected.byte_value, "Unexpected value for `byte_value`");
       32467  +
        ::pretty_assertions::assert_eq!(input.short_value, expected.short_value, "Unexpected value for `short_value`");
       32468  +
        ::pretty_assertions::assert_eq!(input.integer_value, expected.integer_value, "Unexpected value for `integer_value`");
       32469  +
        ::pretty_assertions::assert_eq!(input.long_value, expected.long_value, "Unexpected value for `long_value`");
       32470  +
        assert!(input.float_value.float_equals(&expected.float_value),
       32471  +
                                            "Unexpected value for `float_value` {:?} vs. {:?}", expected.float_value, input.float_value);
       32472  +
        assert!(input.double_value.float_equals(&expected.double_value),
       32473  +
                                            "Unexpected value for `double_value` {:?} vs. {:?}", expected.double_value, input.double_value);
       32474  +
        let response =
       32475  +
            crate::output::SimpleScalarPropertiesOutput {
       32476  +
                foo:
       32477  +
                    ::std::option::Option::None
       32478  +
                ,
       32479  +
                string_value:
       32480  +
                    ::std::option::Option::None
       32481  +
                ,
       32482  +
                true_boolean_value:
       32483  +
                    ::std::option::Option::None
       32484  +
                ,
       32485  +
                false_boolean_value:
       32486  +
                    ::std::option::Option::None
       32487  +
                ,
       32488  +
                byte_value:
       32489  +
                    ::std::option::Option::None
       32490  +
                ,
       32491  +
                short_value:
       32492  +
                    ::std::option::Option::None
       32493  +
                ,
       32494  +
                integer_value:
       32495  +
                    ::std::option::Option::None
       32496  +
                ,
       32497  +
                long_value:
       32498  +
                    ::std::option::Option::None
       32499  +
                ,
       32500  +
                float_value:
       32501  +
                    ::std::option::Option::None
       32502  +
                ,
       32503  +
                double_value:
       32504  +
                    ::std::option::Option::None
       32505  +
                ,
36119  32506   
            }
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         -
            },
       32507  +
        ;
       32508  +
        response };
       32509  +
                                sender.send(()).await.expect("receiver dropped early");
       32510  +
                                result
       32511  +
                            }
       32512  +
                        })
       32513  +
                        .build_unchecked();
       32514  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       32515  +
            .await
       32516  +
            .expect("unable to make an HTTP request");
       32517  +
        assert!(
       32518  +
            receiver.recv().await.is_some(),
       32519  +
            "we expected operation handler to be invoked but it was not entered"
36132  32520   
        );
36133         -
        MalformedListInputFuture {
36134         -
            inner: Box::pin(fut),
36135         -
        }
36136  32521   
    }
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))
       32522  +
    /// Supports handling Infinity float values.
       32523  +
    /// Test ID: RestJsonSupportsInfinityFloatInputs
       32524  +
    #[::tokio::test]
       32525  +
    #[::tracing_test::traced_test]
       32526  +
    async fn rest_json_supports_infinity_float_inputs_request() {
       32527  +
        #[allow(unused_mut)]
       32528  +
        let mut http_request = http::Request::builder()
       32529  +
            .uri("/SimpleScalarProperties")
       32530  +
            .method("PUT")
       32531  +
            .header("Content-Type", "application/json")
       32532  +
            .body(::aws_smithy_http_server::body::Body::from(
       32533  +
                ::bytes::Bytes::from_static(
       32534  +
                    "{\n    \"floatValue\": \"Infinity\",\n    \"DoubleDribble\": \"Infinity\"\n}"
       32535  +
                        .as_bytes(),
       32536  +
                ),
       32537  +
            ))
       32538  +
            .unwrap();
       32539  +
        #[allow(unused_mut)]
       32540  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       32541  +
        let config = crate::service::RestJsonConfig::builder().build();
       32542  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       32543  +
                        .simple_scalar_properties(move |input: crate::input::SimpleScalarPropertiesInput| {
       32544  +
                            let sender = sender.clone();
       32545  +
                            async move {
       32546  +
                                let result = { use ::aws_smithy_protocol_test::FloatEquals;
       32547  +
        let expected =
       32548  +
            crate::input::SimpleScalarPropertiesInput {
       32549  +
                float_value:
       32550  +
                    ::std::option::Option::Some(
       32551  +
                        <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("Infinity").expect("invalid string for number")
       32552  +
                    )
       32553  +
                ,
       32554  +
                double_value:
       32555  +
                    ::std::option::Option::Some(
       32556  +
                        <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("Infinity").expect("invalid string for number")
       32557  +
                    )
       32558  +
                ,
       32559  +
                foo:
       32560  +
                    ::std::option::Option::None
       32561  +
                ,
       32562  +
                string_value:
       32563  +
                    ::std::option::Option::None
       32564  +
                ,
       32565  +
                true_boolean_value:
       32566  +
                    ::std::option::Option::None
       32567  +
                ,
       32568  +
                false_boolean_value:
       32569  +
                    ::std::option::Option::None
       32570  +
                ,
       32571  +
                byte_value:
       32572  +
                    ::std::option::Option::None
       32573  +
                ,
       32574  +
                short_value:
       32575  +
                    ::std::option::Option::None
       32576  +
                ,
       32577  +
                integer_value:
       32578  +
                    ::std::option::Option::None
       32579  +
                ,
       32580  +
                long_value:
       32581  +
                    ::std::option::Option::None
       32582  +
                ,
36149  32583   
            }
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);
       32584  +
        ;
       32585  +
        ::pretty_assertions::assert_eq!(input.foo, expected.foo, "Unexpected value for `foo`");
       32586  +
        ::pretty_assertions::assert_eq!(input.string_value, expected.string_value, "Unexpected value for `string_value`");
       32587  +
        ::pretty_assertions::assert_eq!(input.true_boolean_value, expected.true_boolean_value, "Unexpected value for `true_boolean_value`");
       32588  +
        ::pretty_assertions::assert_eq!(input.false_boolean_value, expected.false_boolean_value, "Unexpected value for `false_boolean_value`");
       32589  +
        ::pretty_assertions::assert_eq!(input.byte_value, expected.byte_value, "Unexpected value for `byte_value`");
       32590  +
        ::pretty_assertions::assert_eq!(input.short_value, expected.short_value, "Unexpected value for `short_value`");
       32591  +
        ::pretty_assertions::assert_eq!(input.integer_value, expected.integer_value, "Unexpected value for `integer_value`");
       32592  +
        ::pretty_assertions::assert_eq!(input.long_value, expected.long_value, "Unexpected value for `long_value`");
       32593  +
        assert!(input.float_value.float_equals(&expected.float_value),
       32594  +
                                            "Unexpected value for `float_value` {:?} vs. {:?}", expected.float_value, input.float_value);
       32595  +
        assert!(input.double_value.float_equals(&expected.double_value),
       32596  +
                                            "Unexpected value for `double_value` {:?} vs. {:?}", expected.double_value, input.double_value);
       32597  +
        let response =
       32598  +
            crate::output::SimpleScalarPropertiesOutput {
       32599  +
                foo:
       32600  +
                    ::std::option::Option::None
       32601  +
                ,
       32602  +
                string_value:
       32603  +
                    ::std::option::Option::None
       32604  +
                ,
       32605  +
                true_boolean_value:
       32606  +
                    ::std::option::Option::None
       32607  +
                ,
       32608  +
                false_boolean_value:
       32609  +
                    ::std::option::Option::None
       32610  +
                ,
       32611  +
                byte_value:
       32612  +
                    ::std::option::Option::None
       32613  +
                ,
       32614  +
                short_value:
       32615  +
                    ::std::option::Option::None
       32616  +
                ,
       32617  +
                integer_value:
       32618  +
                    ::std::option::Option::None
       32619  +
                ,
       32620  +
                long_value:
       32621  +
                    ::std::option::Option::None
       32622  +
                ,
       32623  +
                float_value:
       32624  +
                    ::std::option::Option::None
       32625  +
                ,
       32626  +
                double_value:
       32627  +
                    ::std::option::Option::None
       32628  +
                ,
36201  32629   
            }
36202         -
            crate::protocol_serde::shape_malformed_boolean::de_malformed_boolean_http_request(
36203         -
                request,
36204         -
            )
       32630  +
        ;
       32631  +
        response };
       32632  +
                                sender.send(()).await.expect("receiver dropped early");
       32633  +
                                result
       32634  +
                            }
       32635  +
                        })
       32636  +
                        .build_unchecked();
       32637  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
36205  32638   
            .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         -
            },
       32639  +
            .expect("unable to make an HTTP request");
       32640  +
        assert!(
       32641  +
            receiver.recv().await.is_some(),
       32642  +
            "we expected operation handler to be invoked but it was not entered"
36216  32643   
        );
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  32644   
    }
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
       32645  +
    /// Supports handling -Infinity float values.
       32646  +
    /// Test ID: RestJsonSupportsNegativeInfinityFloatInputs
       32647  +
    #[::tokio::test]
       32648  +
    #[::tracing_test::traced_test]
       32649  +
    async fn rest_json_supports_negative_infinity_float_inputs_request() {
       32650  +
        #[allow(unused_mut)]
       32651  +
                    let mut http_request = http::Request::builder()
       32652  +
                        .uri("/SimpleScalarProperties")
       32653  +
                        .method("PUT")
       32654  +
        .header("Content-Type", "application/json")
       32655  +
        .body(::aws_smithy_http_server::body::Body::from(::bytes::Bytes::from_static("{\n    \"floatValue\": \"-Infinity\",\n    \"DoubleDribble\": \"-Infinity\"\n}".as_bytes()))).unwrap();
       32656  +
        #[allow(unused_mut)]
       32657  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       32658  +
        let config = crate::service::RestJsonConfig::builder().build();
       32659  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       32660  +
                        .simple_scalar_properties(move |input: crate::input::SimpleScalarPropertiesInput| {
       32661  +
                            let sender = sender.clone();
       32662  +
                            async move {
       32663  +
                                let result = { use ::aws_smithy_protocol_test::FloatEquals;
       32664  +
        let expected =
       32665  +
            crate::input::SimpleScalarPropertiesInput {
       32666  +
                float_value:
       32667  +
                    ::std::option::Option::Some(
       32668  +
                        <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("-Infinity").expect("invalid string for number")
       32669  +
                    )
       32670  +
                ,
       32671  +
                double_value:
       32672  +
                    ::std::option::Option::Some(
       32673  +
                        <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("-Infinity").expect("invalid string for number")
       32674  +
                    )
       32675  +
                ,
       32676  +
                foo:
       32677  +
                    ::std::option::Option::None
       32678  +
                ,
       32679  +
                string_value:
       32680  +
                    ::std::option::Option::None
       32681  +
                ,
       32682  +
                true_boolean_value:
       32683  +
                    ::std::option::Option::None
       32684  +
                ,
       32685  +
                false_boolean_value:
       32686  +
                    ::std::option::Option::None
       32687  +
                ,
       32688  +
                byte_value:
       32689  +
                    ::std::option::Option::None
       32690  +
                ,
       32691  +
                short_value:
       32692  +
                    ::std::option::Option::None
       32693  +
                ,
       32694  +
                integer_value:
       32695  +
                    ::std::option::Option::None
       32696  +
                ,
       32697  +
                long_value:
       32698  +
                    ::std::option::Option::None
       32699  +
                ,
36253  32700   
            }
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))
       32701  +
        ;
       32702  +
        ::pretty_assertions::assert_eq!(input.foo, expected.foo, "Unexpected value for `foo`");
       32703  +
        ::pretty_assertions::assert_eq!(input.string_value, expected.string_value, "Unexpected value for `string_value`");
       32704  +
        ::pretty_assertions::assert_eq!(input.true_boolean_value, expected.true_boolean_value, "Unexpected value for `true_boolean_value`");
       32705  +
        ::pretty_assertions::assert_eq!(input.false_boolean_value, expected.false_boolean_value, "Unexpected value for `false_boolean_value`");
       32706  +
        ::pretty_assertions::assert_eq!(input.byte_value, expected.byte_value, "Unexpected value for `byte_value`");
       32707  +
        ::pretty_assertions::assert_eq!(input.short_value, expected.short_value, "Unexpected value for `short_value`");
       32708  +
        ::pretty_assertions::assert_eq!(input.integer_value, expected.integer_value, "Unexpected value for `integer_value`");
       32709  +
        ::pretty_assertions::assert_eq!(input.long_value, expected.long_value, "Unexpected value for `long_value`");
       32710  +
        assert!(input.float_value.float_equals(&expected.float_value),
       32711  +
                                            "Unexpected value for `float_value` {:?} vs. {:?}", expected.float_value, input.float_value);
       32712  +
        assert!(input.double_value.float_equals(&expected.double_value),
       32713  +
                                            "Unexpected value for `double_value` {:?} vs. {:?}", expected.double_value, input.double_value);
       32714  +
        let response =
       32715  +
            crate::output::SimpleScalarPropertiesOutput {
       32716  +
                foo:
       32717  +
                    ::std::option::Option::None
       32718  +
                ,
       32719  +
                string_value:
       32720  +
                    ::std::option::Option::None
       32721  +
                ,
       32722  +
                true_boolean_value:
       32723  +
                    ::std::option::Option::None
       32724  +
                ,
       32725  +
                false_boolean_value:
       32726  +
                    ::std::option::Option::None
       32727  +
                ,
       32728  +
                byte_value:
       32729  +
                    ::std::option::Option::None
       32730  +
                ,
       32731  +
                short_value:
       32732  +
                    ::std::option::Option::None
       32733  +
                ,
       32734  +
                integer_value:
       32735  +
                    ::std::option::Option::None
       32736  +
                ,
       32737  +
                long_value:
       32738  +
                    ::std::option::Option::None
       32739  +
                ,
       32740  +
                float_value:
       32741  +
                    ::std::option::Option::None
       32742  +
                ,
       32743  +
                double_value:
       32744  +
                    ::std::option::Option::None
       32745  +
                ,
36257  32746   
            }
36258         -
        }
       32747  +
        ;
       32748  +
        response };
       32749  +
                                sender.send(()).await.expect("receiver dropped early");
       32750  +
                                result
       32751  +
                            }
       32752  +
                        })
       32753  +
                        .build_unchecked();
       32754  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       32755  +
            .await
       32756  +
            .expect("unable to make an HTTP request");
       32757  +
        assert!(
       32758  +
            receiver.recv().await.is_some(),
       32759  +
            "we expected operation handler to be invoked but it was not entered"
       32760  +
        );
36259  32761   
    }
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>>
       32762  +
    /// Serializes simple scalar properties
       32763  +
    /// Test ID: RestJsonSimpleScalarProperties
       32764  +
    #[::tokio::test]
       32765  +
    #[::tracing_test::traced_test]
       32766  +
    async fn rest_json_simple_scalar_properties_response() {
       32767  +
        let output = crate::output::SimpleScalarPropertiesOutput {
       32768  +
            foo: ::std::option::Option::Some("Foo".to_owned()),
       32769  +
            string_value: ::std::option::Option::Some("string".to_owned()),
       32770  +
            true_boolean_value: ::std::option::Option::Some(true),
       32771  +
            false_boolean_value: ::std::option::Option::Some(false),
       32772  +
            byte_value: ::std::option::Option::Some(1),
       32773  +
            short_value: ::std::option::Option::Some(2),
       32774  +
            integer_value: ::std::option::Option::Some(3),
       32775  +
            long_value: ::std::option::Option::Some(4),
       32776  +
            float_value: ::std::option::Option::Some(5.5_f32),
       32777  +
            double_value: ::std::option::Option::Some(6.5_f64),
       32778  +
        };
       32779  +
        use ::aws_smithy_http_server::response::IntoResponse;
       32780  +
        let http_response = output.into_response();
       32781  +
        ::pretty_assertions::assert_eq!(
       32782  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
       32783  +
            http_response.status()
       32784  +
        );
       32785  +
        let expected_headers = [("Content-Type", "application/json"), ("X-Foo", "Foo")];
       32786  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       32787  +
            http_response.headers(),
       32788  +
            expected_headers,
       32789  +
        ));
       32790  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
       32791  +
            .await
       32792  +
            .expect("unable to extract body to bytes");
       32793  +
        ::aws_smithy_protocol_test::assert_ok(
       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"))
       32795  +
        );
36268  32796   
    }
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)
       32797  +
    /// Rest Json should not serialize null structure values
       32798  +
    /// Test ID: RestJsonServersDontSerializeNullStructureValues
       32799  +
    #[::tokio::test]
       32800  +
    #[::tracing_test::traced_test]
       32801  +
    async fn rest_json_servers_dont_serialize_null_structure_values_response() {
       32802  +
        let output = crate::output::SimpleScalarPropertiesOutput {
       32803  +
            string_value: ::std::option::Option::None,
       32804  +
            foo: ::std::option::Option::None,
       32805  +
            true_boolean_value: ::std::option::Option::None,
       32806  +
            false_boolean_value: ::std::option::Option::None,
       32807  +
            byte_value: ::std::option::Option::None,
       32808  +
            short_value: ::std::option::Option::None,
       32809  +
            integer_value: ::std::option::Option::None,
       32810  +
            long_value: ::std::option::Option::None,
       32811  +
            float_value: ::std::option::Option::None,
       32812  +
            double_value: ::std::option::Option::None,
       32813  +
        };
       32814  +
        use ::aws_smithy_http_server::response::IntoResponse;
       32815  +
        let http_response = output.into_response();
       32816  +
        ::pretty_assertions::assert_eq!(
       32817  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
       32818  +
            http_response.status()
       32819  +
        );
       32820  +
        let expected_headers = [("Content-Type", "application/json")];
       32821  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       32822  +
            http_response.headers(),
       32823  +
            expected_headers,
       32824  +
        ));
       32825  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
       32826  +
            .await
       32827  +
            .expect("unable to extract body to bytes");
       32828  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
       32829  +
            &body,
       32830  +
            "{}",
       32831  +
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
       32832  +
        ));
36283  32833   
    }
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)
       32834  +
    /// Supports handling NaN float values.
       32835  +
    /// Test ID: RestJsonSupportsNaNFloatInputs
       32836  +
    #[::tokio::test]
       32837  +
    #[::tracing_test::traced_test]
       32838  +
    async fn rest_json_supports_na_n_float_inputs_response() {
       32839  +
        let output = crate::output::SimpleScalarPropertiesOutput {
       32840  +
            float_value: ::std::option::Option::Some(
       32841  +
                <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("NaN")
       32842  +
                    .expect("invalid string for number"),
       32843  +
            ),
       32844  +
            double_value: ::std::option::Option::Some(
       32845  +
                <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("NaN")
       32846  +
                    .expect("invalid string for number"),
       32847  +
            ),
       32848  +
            foo: ::std::option::Option::None,
       32849  +
            string_value: ::std::option::Option::None,
       32850  +
            true_boolean_value: ::std::option::Option::None,
       32851  +
            false_boolean_value: ::std::option::Option::None,
       32852  +
            byte_value: ::std::option::Option::None,
       32853  +
            short_value: ::std::option::Option::None,
       32854  +
            integer_value: ::std::option::Option::None,
       32855  +
            long_value: ::std::option::Option::None,
       32856  +
        };
       32857  +
        use ::aws_smithy_http_server::response::IntoResponse;
       32858  +
        let http_response = output.into_response();
       32859  +
        ::pretty_assertions::assert_eq!(
       32860  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
       32861  +
            http_response.status()
       32862  +
        );
       32863  +
        let expected_headers = [("Content-Type", "application/json")];
       32864  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       32865  +
            http_response.headers(),
       32866  +
            expected_headers,
       32867  +
        ));
       32868  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
       32869  +
            .await
       32870  +
            .expect("unable to extract body to bytes");
       32871  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
       32872  +
            &body,
       32873  +
            "{\n    \"floatValue\": \"NaN\",\n    \"DoubleDribble\": \"NaN\"\n}",
       32874  +
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
       32875  +
        ));
       32876  +
    }
       32877  +
    /// Supports handling Infinity float values.
       32878  +
    /// Test ID: RestJsonSupportsInfinityFloatInputs
       32879  +
    #[::tokio::test]
       32880  +
    #[::tracing_test::traced_test]
       32881  +
    async fn rest_json_supports_infinity_float_inputs_response() {
       32882  +
        let output = crate::output::SimpleScalarPropertiesOutput {
       32883  +
            float_value: ::std::option::Option::Some(
       32884  +
                <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("Infinity")
       32885  +
                    .expect("invalid string for number"),
       32886  +
            ),
       32887  +
            double_value: ::std::option::Option::Some(
       32888  +
                <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("Infinity")
       32889  +
                    .expect("invalid string for number"),
       32890  +
            ),
       32891  +
            foo: ::std::option::Option::None,
       32892  +
            string_value: ::std::option::Option::None,
       32893  +
            true_boolean_value: ::std::option::Option::None,
       32894  +
            false_boolean_value: ::std::option::Option::None,
       32895  +
            byte_value: ::std::option::Option::None,
       32896  +
            short_value: ::std::option::Option::None,
       32897  +
            integer_value: ::std::option::Option::None,
       32898  +
            long_value: ::std::option::Option::None,
36313  32899   
        };
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         -
            },
       32900  +
        use ::aws_smithy_http_server::response::IntoResponse;
       32901  +
        let http_response = output.into_response();
       32902  +
        ::pretty_assertions::assert_eq!(
       32903  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
       32904  +
            http_response.status()
36322  32905   
        );
36323         -
        MalformedUnionInputFuture {
36324         -
            inner: Box::pin(fut),
36325         -
        }
       32906  +
        let expected_headers = [("Content-Type", "application/json")];
       32907  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       32908  +
            http_response.headers(),
       32909  +
            expected_headers,
       32910  +
        ));
       32911  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
       32912  +
            .await
       32913  +
            .expect("unable to extract body to bytes");
       32914  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
       32915  +
            &body,
       32916  +
            "{\n    \"floatValue\": \"Infinity\",\n    \"DoubleDribble\": \"Infinity\"\n}",
       32917  +
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
       32918  +
        ));
36326  32919   
    }
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         -
        }
       32920  +
    /// Supports handling -Infinity float values.
       32921  +
    /// Test ID: RestJsonSupportsNegativeInfinityFloatInputs
       32922  +
    #[::tokio::test]
       32923  +
    #[::tracing_test::traced_test]
       32924  +
    async fn rest_json_supports_negative_infinity_float_inputs_response() {
       32925  +
        let output = crate::output::SimpleScalarPropertiesOutput {
       32926  +
            float_value: ::std::option::Option::Some(
       32927  +
                <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("-Infinity")
       32928  +
                    .expect("invalid string for number"),
       32929  +
            ),
       32930  +
            double_value: ::std::option::Option::Some(
       32931  +
                <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("-Infinity")
       32932  +
                    .expect("invalid string for number"),
       32933  +
            ),
       32934  +
            foo: ::std::option::Option::None,
       32935  +
            string_value: ::std::option::Option::None,
       32936  +
            true_boolean_value: ::std::option::Option::None,
       32937  +
            false_boolean_value: ::std::option::Option::None,
       32938  +
            byte_value: ::std::option::Option::None,
       32939  +
            short_value: ::std::option::Option::None,
       32940  +
            integer_value: ::std::option::Option::None,
       32941  +
            long_value: ::std::option::Option::None,
       32942  +
        };
       32943  +
        use ::aws_smithy_http_server::response::IntoResponse;
       32944  +
        let http_response = output.into_response();
       32945  +
        ::pretty_assertions::assert_eq!(
       32946  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
       32947  +
            http_response.status()
       32948  +
        );
       32949  +
        let expected_headers = [("Content-Type", "application/json")];
       32950  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       32951  +
            http_response.headers(),
       32952  +
            expected_headers,
       32953  +
        ));
       32954  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
       32955  +
            .await
       32956  +
            .expect("unable to extract body to bytes");
       32957  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
       32958  +
            &body,
       32959  +
            "{\n    \"floatValue\": \"-Infinity\",\n    \"DoubleDribble\": \"-Infinity\"\n}",
       32960  +
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
       32961  +
        ));
36342  32962   
    }
36343  32963   
}
36344  32964   
36345         -
const CONTENT_TYPE_MALFORMEDINTEGER: ::mime::Mime = ::mime::APPLICATION_JSON;
       32965  +
const CONTENT_TYPE_GREETINGWITHERRORS: ::mime::Mime = ::mime::APPLICATION_JSON;
36346  32966   
::pin_project_lite::pin_project! {
36347  32967   
    /// 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>>
       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>>
36351  32971   
    }
36352  32972   
}
36353  32973   
36354         -
impl std::future::Future for MalformedIntegerInputFuture {
       32974  +
impl std::future::Future for GreetingWithErrorsInputFuture {
36355  32975   
    type Output = Result<
36356         -
        crate::input::MalformedIntegerInput,
       32976  +
        crate::input::GreetingWithErrorsInput,
36357  32977   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
36358  32978   
    >;
36359  32979   
36360  32980   
    fn poll(
36361  32981   
        self: std::pin::Pin<&mut Self>,
36362  32982   
        cx: &mut std::task::Context<'_>,
36363  32983   
    ) -> std::task::Poll<Self::Output> {
36364  32984   
        let this = self.project();
36365  32985   
        this.inner.as_mut().poll(cx)
36366  32986   
    }
36367  32987   
}
36368  32988   
36369  32989   
impl<B>
36370  32990   
    ::aws_smithy_http_server::request::FromRequest<
36371  32991   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
36372  32992   
        B,
36373         -
    > for crate::input::MalformedIntegerInput
       32993  +
    > for crate::input::GreetingWithErrorsInput
36374  32994   
where
36375  32995   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
36376  32996   
    B: 'static,
36377  32997   
36378  32998   
    B::Data: Send,
36379  32999   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
36380  33000   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
36381  33001   
{
36382  33002   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
36383         -
    type Future = MalformedIntegerInputFuture;
       33003  +
    type Future = GreetingWithErrorsInputFuture;
36384  33004   
36385  33005   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
36386  33006   
        let fut = async move {
36387  33007   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
36388  33008   
                request.headers(),
36389         -
                &CONTENT_TYPE_MALFORMEDINTEGER,
       33009  +
                &CONTENT_TYPE_GREETINGWITHERRORS,
36390  33010   
            ) {
36391  33011   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
36392  33012   
            }
36393         -
            crate::protocol_serde::shape_malformed_integer::de_malformed_integer_http_request(
       33013  +
            crate::protocol_serde::shape_greeting_with_errors::de_greeting_with_errors_http_request(
36394  33014   
                request,
36395  33015   
            )
36396  33016   
            .await
36397  33017   
            .map_err(Into::into)
36398  33018   
        };
36399  33019   
        use ::futures_util::future::TryFutureExt;
36400  33020   
        let fut = fut.map_err(
36401  33021   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
36402  33022   
                ::tracing::debug!(error = %e, "failed to deserialize request");
36403  33023   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
36404  33024   
                    e,
36405  33025   
                )
36406  33026   
            },
36407  33027   
        );
36408         -
        MalformedIntegerInputFuture {
       33028  +
        GreetingWithErrorsInputFuture {
36409  33029   
            inner: Box::pin(fut),
36410  33030   
        }
36411  33031   
    }
36412  33032   
}
36413  33033   
impl
36414  33034   
    ::aws_smithy_http_server::response::IntoResponse<
36415  33035   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
36416         -
    > for crate::output::MalformedIntegerOutput
       33036  +
    > for crate::output::GreetingWithErrorsOutput
36417  33037   
{
36418  33038   
    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         -
        }
       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  +
                    }
36428  33046   
    }
36429  33047   
}
36430  33048   
impl
36431  33049   
    ::aws_smithy_http_server::response::IntoResponse<
36432  33050   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
36433         -
    > for crate::error::MalformedIntegerError
       33051  +
    > for crate::error::GreetingWithErrorsError
36434  33052   
{
36435  33053   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
36436         -
        match crate::protocol_serde::shape_malformed_integer::ser_malformed_integer_http_error(
       33054  +
        match crate::protocol_serde::shape_greeting_with_errors::ser_greeting_with_errors_http_error(
36437  33055   
            &self,
36438  33056   
        ) {
36439  33057   
            Ok(mut response) => {
36440  33058   
                response.extensions_mut().insert(
36441  33059   
                    ::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()),
36442  33060   
                );
36443  33061   
                response
36444  33062   
            }
36445  33063   
            Err(e) => {
36446  33064   
                ::tracing::error!(error = %e, "failed to serialize response");
36447  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))
36448  33066   
            }
36449  33067   
        }
36450  33068   
    }
36451  33069   
}
36452  33070   
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;
       33071  +
#[allow(unreachable_code, unused_variables)]
       33072  +
#[cfg(test)]
       33073  +
mod greeting_with_errors_test {
36492  33074   
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)
       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
       33081  +
    #[::tokio::test]
       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()),
36504  33086   
        };
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         -
            },
       33087  +
        use ::aws_smithy_http_server::response::IntoResponse;
       33088  +
        let http_response = output.into_response();
       33089  +
        ::pretty_assertions::assert_eq!(
       33090  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
       33091  +
            http_response.status()
36513  33092   
        );
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)
       33093  +
        let expected_headers = [("X-Greeting", "Hello")];
       33094  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       33095  +
            http_response.headers(),
       33096  +
            expected_headers,
       33097  +
        ));
       33098  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
       33099  +
            .await
       33100  +
            .expect("unable to extract body to bytes");
       33101  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
       33102  +
            &body,
       33103  +
            "{}",
       33104  +
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
       33105  +
        ));
36556  33106   
    }
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)
       33107  +
    /// Parses simple JSON errors
       33108  +
    /// Test ID: RestJsonInvalidGreetingError
       33109  +
    #[::tokio::test]
       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()),
36586  33114   
        };
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         -
            },
       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()
36595  33121   
        );
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)
       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())
       33131  +
            .await
       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  +
        ));
36638  33138   
    }
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)
       33139  +
    /// Serializes a complex error with no message member
       33140  +
    /// Test ID: RestJsonComplexErrorWithNoMessage
       33141  +
    #[::tokio::test]
       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()),
       33149  +
            }),
36668  33150   
        };
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         -
            },
       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())
       33168  +
            .await
       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"))
36677  33172   
        );
36678         -
        HostWithPathOperationInputFuture {
36679         -
            inner: Box::pin(fut),
36680         -
        }
36681  33173   
    }
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         -
                    }
       33174  +
    /// Test ID: RestJsonEmptyComplexErrorWithNoMessage
       33175  +
    #[::tokio::test]
       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,
       33182  +
        };
       33183  +
        let output = crate::error::GreetingWithErrorsError::ComplexError(output);
       33184  +
        use ::aws_smithy_http_server::response::IntoResponse;
       33185  +
        let http_response = output.into_response();
       33186  +
        ::pretty_assertions::assert_eq!(
       33187  +
            http::StatusCode::from_u16(403).expect("invalid expected HTTP status code"),
       33188  +
            http_response.status()
       33189  +
        );
       33190  +
        let expected_headers = [
       33191  +
            ("Content-Type", "application/json"),
       33192  +
            ("X-Amzn-Errortype", "ComplexError"),
       33193  +
        ];
       33194  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       33195  +
            http_response.headers(),
       33196  +
            expected_headers,
       33197  +
        ));
       33198  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
       33199  +
            .await
       33200  +
            .expect("unable to extract body to bytes");
       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"),
       33205  +
        ));
36696  33206   
    }
36697  33207   
}
36698  33208   
36699         -
const CONTENT_TYPE_ENDPOINTWITHHOSTLABELOPERATION: ::mime::Mime = ::mime::APPLICATION_JSON;
       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  +
    });
36700  33215   
::pin_project_lite::pin_project! {
36701  33216   
    /// 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>>
       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>>
36705  33220   
    }
36706  33221   
}
36707  33222   
36708         -
impl std::future::Future for EndpointWithHostLabelOperationInputFuture {
       33223  +
impl std::future::Future for StreamingTraitsWithMediaTypeInputFuture {
36709  33224   
    type Output = Result<
36710         -
        crate::input::EndpointWithHostLabelOperationInput,
       33225  +
        crate::input::StreamingTraitsWithMediaTypeInput,
36711  33226   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
36712  33227   
    >;
36713  33228   
36714  33229   
    fn poll(
36715  33230   
        self: std::pin::Pin<&mut Self>,
36716  33231   
        cx: &mut std::task::Context<'_>,
36717  33232   
    ) -> std::task::Poll<Self::Output> {
36718  33233   
        let this = self.project();
36719  33234   
        this.inner.as_mut().poll(cx)
36720  33235   
    }
36721  33236   
}
36722  33237   
36723  33238   
impl<B>
36724  33239   
    ::aws_smithy_http_server::request::FromRequest<
36725  33240   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
36726  33241   
        B,
36727         -
    > for crate::input::EndpointWithHostLabelOperationInput
       33242  +
    > for crate::input::StreamingTraitsWithMediaTypeInput
36728  33243   
where
36729  33244   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
36730  33245   
    B: 'static,
36731  33246   
       33247  +
    B: Into<::aws_smithy_types::byte_stream::ByteStream>,
36732  33248   
    B::Data: Send,
36733  33249   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
36734  33250   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
36735  33251   
{
36736  33252   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
36737         -
    type Future = EndpointWithHostLabelOperationInputFuture;
       33253  +
    type Future = StreamingTraitsWithMediaTypeInputFuture;
36738  33254   
36739  33255   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
36740  33256   
        let fut = async move {
36741  33257   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
36742  33258   
                request.headers(),
36743         -
                &CONTENT_TYPE_ENDPOINTWITHHOSTLABELOPERATION,
       33259  +
                &CONTENT_TYPE_STREAMINGTRAITSWITHMEDIATYPE,
36744  33260   
            ) {
36745  33261   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
36746  33262   
            }
36747         -
            crate::protocol_serde::shape_endpoint_with_host_label_operation::de_endpoint_with_host_label_operation_http_request(request)
       33263  +
            crate::protocol_serde::shape_streaming_traits_with_media_type::de_streaming_traits_with_media_type_http_request(request)
36748  33264   
                            .await
36749  33265   
                            .map_err(Into::into)
36750  33266   
        };
36751  33267   
        use ::futures_util::future::TryFutureExt;
36752  33268   
        let fut = fut.map_err(
36753  33269   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
36754  33270   
                ::tracing::debug!(error = %e, "failed to deserialize request");
36755  33271   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
36756  33272   
                    e,
36757  33273   
                )
36758  33274   
            },
36759  33275   
        );
36760         -
        EndpointWithHostLabelOperationInputFuture {
       33276  +
        StreamingTraitsWithMediaTypeInputFuture {
36761  33277   
            inner: Box::pin(fut),
36762  33278   
        }
36763  33279   
    }
36764  33280   
}
36765  33281   
impl
36766  33282   
    ::aws_smithy_http_server::response::IntoResponse<
36767  33283   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
36768         -
    > for crate::output::EndpointWithHostLabelOperationOutput
       33284  +
    > for crate::output::StreamingTraitsWithMediaTypeOutput
36769  33285   
{
36770  33286   
    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) {
       33287  +
        match crate::protocol_serde::shape_streaming_traits_with_media_type::ser_streaming_traits_with_media_type_http_response(self) {
36772  33288   
                        Ok(response) => response,
36773  33289   
                        Err(e) => {
36774  33290   
                            ::tracing::error!(error = %e, "failed to serialize response");
36775  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))
36776  33292   
                        }
36777  33293   
                    }
36778  33294   
    }
36779  33295   
}
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         -
        }
       33296  +
       33297  +
#[allow(unreachable_code, unused_variables)]
       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
       33303  +
    #[::tokio::test]
       33304  +
    #[::tracing_test::traced_test]
       33305  +
    async fn rest_json_streaming_traits_with_media_type_with_blob_request() {
       33306  +
        #[allow(unused_mut)]
       33307  +
        let mut http_request = http::Request::builder()
       33308  +
            .uri("/StreamingTraitsWithMediaType")
       33309  +
            .method("POST")
       33310  +
            .header("Content-Type", "text/plain")
       33311  +
            .header("X-Foo", "Foo")
       33312  +
            .body(::aws_smithy_http_server::body::Body::from(
       33313  +
                ::bytes::Bytes::from_static("blobby blob blob".as_bytes()),
       33314  +
            ))
       33315  +
            .unwrap();
       33316  +
        #[allow(unused_mut)]
       33317  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       33318  +
        let config = crate::service::RestJsonConfig::builder().build();
       33319  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       33320  +
            .streaming_traits_with_media_type(
       33321  +
                move |input: crate::input::StreamingTraitsWithMediaTypeInput| {
       33322  +
                    let sender = sender.clone();
       33323  +
                    async move {
       33324  +
                        let result = {
       33325  +
                            let expected = crate::input::StreamingTraitsWithMediaTypeInput {
       33326  +
                                foo: ::std::option::Option::Some("Foo".to_owned()),
       33327  +
                                blob: ::aws_smithy_types::byte_stream::ByteStream::from_static(
       33328  +
                                    b"blobby blob blob",
       33329  +
                                ),
       33330  +
                            };
       33331  +
                            ::pretty_assertions::assert_eq!(
       33332  +
                                input.foo,
       33333  +
                                expected.foo,
       33334  +
                                "Unexpected value for `foo`"
       33335  +
                            );
       33336  +
                            ::pretty_assertions::assert_eq!(
       33337  +
                                input.blob.collect().await.unwrap().into_bytes(),
       33338  +
                                expected.blob.collect().await.unwrap().into_bytes()
       33339  +
                            );
       33340  +
                            let response = crate::output::StreamingTraitsWithMediaTypeOutput {
       33341  +
                                blob: ::aws_smithy_types::byte_stream::ByteStream::from_static(b""),
       33342  +
                                foo: ::std::option::Option::None,
       33343  +
                            };
       33344  +
                            response
       33345  +
                        };
       33346  +
                        sender.send(()).await.expect("receiver dropped early");
       33347  +
                        result
       33348  +
                    }
       33349  +
                },
       33350  +
            )
       33351  +
            .build_unchecked();
       33352  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       33353  +
            .await
       33354  +
            .expect("unable to make an HTTP request");
       33355  +
        assert!(
       33356  +
            receiver.recv().await.is_some(),
       33357  +
            "we expected operation handler to be invoked but it was not entered"
       33358  +
        );
       33359  +
    }
       33360  +
    /// Serializes a blob in the HTTP payload with a content-type
       33361  +
    /// Test ID: RestJsonStreamingTraitsWithMediaTypeWithBlob
       33362  +
    #[::tokio::test]
       33363  +
    #[::tracing_test::traced_test]
       33364  +
    async fn rest_json_streaming_traits_with_media_type_with_blob_response() {
       33365  +
        let output = crate::output::StreamingTraitsWithMediaTypeOutput {
       33366  +
            foo: ::std::option::Option::Some("Foo".to_owned()),
       33367  +
            blob: ::aws_smithy_types::byte_stream::ByteStream::from_static(b"blobby blob blob"),
       33368  +
        };
       33369  +
        use ::aws_smithy_http_server::response::IntoResponse;
       33370  +
        let http_response = output.into_response();
       33371  +
        ::pretty_assertions::assert_eq!(
       33372  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
       33373  +
            http_response.status()
       33374  +
        );
       33375  +
        let expected_headers = [("Content-Type", "text/plain"), ("X-Foo", "Foo")];
       33376  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       33377  +
            http_response.headers(),
       33378  +
            expected_headers,
       33379  +
        ));
       33380  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
       33381  +
            .await
       33382  +
            .expect("unable to extract body to bytes");
       33383  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
       33384  +
            &body,
       33385  +
            "blobby blob blob",
       33386  +
            ::aws_smithy_protocol_test::MediaType::from("application/octet-stream"),
       33387  +
        ));
36796  33388   
    }
36797  33389   
}
36798  33390   
36799         -
const CONTENT_TYPE_ENDPOINTOPERATION: ::mime::Mime = ::mime::APPLICATION_JSON;
       33391  +
const CONTENT_TYPE_STREAMINGTRAITSREQUIRELENGTH: ::mime::Mime = ::mime::APPLICATION_JSON;
36800  33392   
::pin_project_lite::pin_project! {
36801  33393   
    /// 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>>
       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>>
36805  33397   
    }
36806  33398   
}
36807  33399   
36808         -
impl std::future::Future for EndpointOperationInputFuture {
       33400  +
impl std::future::Future for StreamingTraitsRequireLengthInputFuture {
36809  33401   
    type Output = Result<
36810         -
        crate::input::EndpointOperationInput,
       33402  +
        crate::input::StreamingTraitsRequireLengthInput,
36811  33403   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
36812  33404   
    >;
36813  33405   
36814  33406   
    fn poll(
36815  33407   
        self: std::pin::Pin<&mut Self>,
36816  33408   
        cx: &mut std::task::Context<'_>,
36817  33409   
    ) -> std::task::Poll<Self::Output> {
36818  33410   
        let this = self.project();
36819  33411   
        this.inner.as_mut().poll(cx)
36820  33412   
    }
36821  33413   
}
36822  33414   
36823  33415   
impl<B>
36824  33416   
    ::aws_smithy_http_server::request::FromRequest<
36825  33417   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
36826  33418   
        B,
36827         -
    > for crate::input::EndpointOperationInput
       33419  +
    > for crate::input::StreamingTraitsRequireLengthInput
36828  33420   
where
36829  33421   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
36830  33422   
    B: 'static,
36831  33423   
       33424  +
    B: Into<::aws_smithy_types::byte_stream::ByteStream>,
36832  33425   
    B::Data: Send,
36833  33426   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
36834  33427   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
36835  33428   
{
36836  33429   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
36837         -
    type Future = EndpointOperationInputFuture;
       33430  +
    type Future = StreamingTraitsRequireLengthInputFuture;
36838  33431   
36839  33432   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
36840  33433   
        let fut = async move {
36841  33434   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
36842  33435   
                request.headers(),
36843         -
                &CONTENT_TYPE_ENDPOINTOPERATION,
       33436  +
                &CONTENT_TYPE_STREAMINGTRAITSREQUIRELENGTH,
36844  33437   
            ) {
36845  33438   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
36846  33439   
            }
36847         -
            crate::protocol_serde::shape_endpoint_operation::de_endpoint_operation_http_request(
36848         -
                request,
36849         -
            )
36850         -
            .await
36851         -
            .map_err(Into::into)
       33440  +
            crate::protocol_serde::shape_streaming_traits_require_length::de_streaming_traits_require_length_http_request(request)
       33441  +
                            .await
       33442  +
                            .map_err(Into::into)
36852  33443   
        };
36853  33444   
        use ::futures_util::future::TryFutureExt;
36854  33445   
        let fut = fut.map_err(
36855  33446   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
36856  33447   
                ::tracing::debug!(error = %e, "failed to deserialize request");
36857  33448   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
36858  33449   
                    e,
36859  33450   
                )
36860  33451   
            },
36861  33452   
        );
36862         -
        EndpointOperationInputFuture {
       33453  +
        StreamingTraitsRequireLengthInputFuture {
36863  33454   
            inner: Box::pin(fut),
36864  33455   
        }
36865  33456   
    }
36866  33457   
}
36867  33458   
impl
36868  33459   
    ::aws_smithy_http_server::response::IntoResponse<
36869  33460   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
36870         -
    > for crate::output::EndpointOperationOutput
       33461  +
    > for crate::output::StreamingTraitsRequireLengthOutput
36871  33462   
{
36872  33463   
    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         -
        }
       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  +
                    }
36882  33471   
    }
36883  33472   
}
36884  33473   
36885         -
const CONTENT_TYPE_POSTUNIONWITHJSONNAME: ::mime::Mime = ::mime::APPLICATION_JSON;
       33474  +
#[allow(unreachable_code, unused_variables)]
       33475  +
#[cfg(test)]
       33476  +
mod streaming_traits_require_length_test {
       33477  +
       33478  +
    /// Serializes a blob in the HTTP payload with a required length
       33479  +
    /// Test ID: RestJsonStreamingTraitsRequireLengthWithBlob
       33480  +
    #[::tokio::test]
       33481  +
    #[::tracing_test::traced_test]
       33482  +
    async fn rest_json_streaming_traits_require_length_with_blob_request() {
       33483  +
        #[allow(unused_mut)]
       33484  +
        let mut http_request = http::Request::builder()
       33485  +
            .uri("/StreamingTraitsRequireLength")
       33486  +
            .method("POST")
       33487  +
            .header("Content-Type", "application/octet-stream")
       33488  +
            .header("X-Foo", "Foo")
       33489  +
            .body(::aws_smithy_http_server::body::Body::from(
       33490  +
                ::bytes::Bytes::from_static("blobby blob blob".as_bytes()),
       33491  +
            ))
       33492  +
            .unwrap();
       33493  +
        #[allow(unused_mut)]
       33494  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       33495  +
        let config = crate::service::RestJsonConfig::builder().build();
       33496  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       33497  +
            .streaming_traits_require_length(
       33498  +
                move |input: crate::input::StreamingTraitsRequireLengthInput| {
       33499  +
                    let sender = sender.clone();
       33500  +
                    async move {
       33501  +
                        let result = {
       33502  +
                            let expected = crate::input::StreamingTraitsRequireLengthInput {
       33503  +
                                foo: ::std::option::Option::Some("Foo".to_owned()),
       33504  +
                                blob: ::aws_smithy_types::byte_stream::ByteStream::from_static(
       33505  +
                                    b"blobby blob blob",
       33506  +
                                ),
       33507  +
                            };
       33508  +
                            ::pretty_assertions::assert_eq!(
       33509  +
                                input.foo,
       33510  +
                                expected.foo,
       33511  +
                                "Unexpected value for `foo`"
       33512  +
                            );
       33513  +
                            ::pretty_assertions::assert_eq!(
       33514  +
                                input.blob.collect().await.unwrap().into_bytes(),
       33515  +
                                expected.blob.collect().await.unwrap().into_bytes()
       33516  +
                            );
       33517  +
                            let response = crate::output::StreamingTraitsRequireLengthOutput {};
       33518  +
                            response
       33519  +
                        };
       33520  +
                        sender.send(()).await.expect("receiver dropped early");
       33521  +
                        result
       33522  +
                    }
       33523  +
                },
       33524  +
            )
       33525  +
            .build_unchecked();
       33526  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       33527  +
            .await
       33528  +
            .expect("unable to make an HTTP request");
       33529  +
        assert!(
       33530  +
            receiver.recv().await.is_some(),
       33531  +
            "we expected operation handler to be invoked but it was not entered"
       33532  +
        );
       33533  +
    }
       33534  +
    /// Serializes an empty blob in the HTTP payload
       33535  +
    /// Test ID: RestJsonStreamingTraitsRequireLengthWithNoBlobBody
       33536  +
    #[::tokio::test]
       33537  +
    #[::tracing_test::traced_test]
       33538  +
    async fn rest_json_streaming_traits_require_length_with_no_blob_body_request() {
       33539  +
        #[allow(unused_mut)]
       33540  +
        let mut http_request = http::Request::builder()
       33541  +
            .uri("/StreamingTraitsRequireLength")
       33542  +
            .method("POST")
       33543  +
            .header("X-Foo", "Foo")
       33544  +
            .body(::aws_smithy_http_server::body::Body::from(
       33545  +
                ::bytes::Bytes::from_static("".as_bytes()),
       33546  +
            ))
       33547  +
            .unwrap();
       33548  +
        #[allow(unused_mut)]
       33549  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       33550  +
        let config = crate::service::RestJsonConfig::builder().build();
       33551  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       33552  +
            .streaming_traits_require_length(
       33553  +
                move |input: crate::input::StreamingTraitsRequireLengthInput| {
       33554  +
                    let sender = sender.clone();
       33555  +
                    async move {
       33556  +
                        let result = {
       33557  +
                            let expected = crate::input::StreamingTraitsRequireLengthInput {
       33558  +
                                blob: ::aws_smithy_types::byte_stream::ByteStream::from_static(b""),
       33559  +
                                foo: ::std::option::Option::Some("Foo".to_owned()),
       33560  +
                            };
       33561  +
                            ::pretty_assertions::assert_eq!(
       33562  +
                                input.foo,
       33563  +
                                expected.foo,
       33564  +
                                "Unexpected value for `foo`"
       33565  +
                            );
       33566  +
                            ::pretty_assertions::assert_eq!(
       33567  +
                                input.blob.collect().await.unwrap().into_bytes(),
       33568  +
                                expected.blob.collect().await.unwrap().into_bytes()
       33569  +
                            );
       33570  +
                            let response = crate::output::StreamingTraitsRequireLengthOutput {};
       33571  +
                            response
       33572  +
                        };
       33573  +
                        sender.send(()).await.expect("receiver dropped early");
       33574  +
                        result
       33575  +
                    }
       33576  +
                },
       33577  +
            )
       33578  +
            .build_unchecked();
       33579  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       33580  +
            .await
       33581  +
            .expect("unable to make an HTTP request");
       33582  +
        assert!(
       33583  +
            receiver.recv().await.is_some(),
       33584  +
            "we expected operation handler to be invoked but it was not entered"
       33585  +
        );
       33586  +
    }
       33587  +
}
       33588  +
       33589  +
const CONTENT_TYPE_STREAMINGTRAITS: ::mime::Mime = ::mime::APPLICATION_OCTET_STREAM;
36886  33590   
::pin_project_lite::pin_project! {
36887  33591   
    /// 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>>
       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>>
36891  33595   
    }
36892  33596   
}
36893  33597   
36894         -
impl std::future::Future for PostUnionWithJsonNameInputFuture {
       33598  +
impl std::future::Future for StreamingTraitsInputFuture {
36895  33599   
    type Output = Result<
36896         -
        crate::input::PostUnionWithJsonNameInput,
       33600  +
        crate::input::StreamingTraitsInput,
36897  33601   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
36898  33602   
    >;
36899  33603   
36900  33604   
    fn poll(
36901  33605   
        self: std::pin::Pin<&mut Self>,
36902  33606   
        cx: &mut std::task::Context<'_>,
36903  33607   
    ) -> std::task::Poll<Self::Output> {
36904  33608   
        let this = self.project();
36905  33609   
        this.inner.as_mut().poll(cx)
36906  33610   
    }
36907  33611   
}
36908  33612   
36909  33613   
impl<B>
36910  33614   
    ::aws_smithy_http_server::request::FromRequest<
36911  33615   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
36912  33616   
        B,
36913         -
    > for crate::input::PostUnionWithJsonNameInput
       33617  +
    > for crate::input::StreamingTraitsInput
36914  33618   
where
36915  33619   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
36916  33620   
    B: 'static,
36917  33621   
       33622  +
    B: Into<::aws_smithy_types::byte_stream::ByteStream>,
36918  33623   
    B::Data: Send,
36919  33624   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
36920  33625   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
36921  33626   
{
36922  33627   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
36923         -
    type Future = PostUnionWithJsonNameInputFuture;
       33628  +
    type Future = StreamingTraitsInputFuture;
36924  33629   
36925  33630   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
36926  33631   
        let fut = async move {
36927  33632   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
36928  33633   
                request.headers(),
36929         -
                &CONTENT_TYPE_POSTUNIONWITHJSONNAME,
       33634  +
                &CONTENT_TYPE_STREAMINGTRAITS,
36930  33635   
            ) {
36931  33636   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
36932  33637   
            }
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)
       33638  +
            crate::protocol_serde::shape_streaming_traits::de_streaming_traits_http_request(request)
       33639  +
                .await
       33640  +
                .map_err(Into::into)
36936  33641   
        };
36937  33642   
        use ::futures_util::future::TryFutureExt;
36938  33643   
        let fut = fut.map_err(
36939  33644   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
36940  33645   
                ::tracing::debug!(error = %e, "failed to deserialize request");
36941  33646   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
36942  33647   
                    e,
36943  33648   
                )
36944  33649   
            },
36945  33650   
        );
36946         -
        PostUnionWithJsonNameInputFuture {
       33651  +
        StreamingTraitsInputFuture {
36947  33652   
            inner: Box::pin(fut),
36948  33653   
        }
36949  33654   
    }
36950  33655   
}
36951  33656   
impl
36952  33657   
    ::aws_smithy_http_server::response::IntoResponse<
36953  33658   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
36954         -
    > for crate::output::PostUnionWithJsonNameOutput
       33659  +
    > for crate::output::StreamingTraitsOutput
36955  33660   
{
36956  33661   
    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         -
                    }
       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  +
        }
36964  33671   
    }
36965  33672   
}
36966  33673   
36967         -
const CONTENT_TYPE_POSTPLAYERACTION: ::mime::Mime = ::mime::APPLICATION_JSON;
       33674  +
#[allow(unreachable_code, unused_variables)]
       33675  +
#[cfg(test)]
       33676  +
mod streaming_traits_test {
       33677  +
       33678  +
    /// Serializes a blob in the HTTP payload
       33679  +
    /// Test ID: RestJsonStreamingTraitsWithBlob
       33680  +
    #[::tokio::test]
       33681  +
    #[::tracing_test::traced_test]
       33682  +
    async fn rest_json_streaming_traits_with_blob_request() {
       33683  +
        #[allow(unused_mut)]
       33684  +
        let mut http_request = http::Request::builder()
       33685  +
            .uri("/StreamingTraits")
       33686  +
            .method("POST")
       33687  +
            .header("Content-Type", "application/octet-stream")
       33688  +
            .header("X-Foo", "Foo")
       33689  +
            .body(::aws_smithy_http_server::body::Body::from(
       33690  +
                ::bytes::Bytes::from_static("blobby blob blob".as_bytes()),
       33691  +
            ))
       33692  +
            .unwrap();
       33693  +
        #[allow(unused_mut)]
       33694  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       33695  +
        let config = crate::service::RestJsonConfig::builder().build();
       33696  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       33697  +
            .streaming_traits(move |input: crate::input::StreamingTraitsInput| {
       33698  +
                let sender = sender.clone();
       33699  +
                async move {
       33700  +
                    let result = {
       33701  +
                        let expected = crate::input::StreamingTraitsInput {
       33702  +
                            foo: ::std::option::Option::Some("Foo".to_owned()),
       33703  +
                            blob: ::aws_smithy_types::byte_stream::ByteStream::from_static(
       33704  +
                                b"blobby blob blob",
       33705  +
                            ),
       33706  +
                        };
       33707  +
                        ::pretty_assertions::assert_eq!(
       33708  +
                            input.foo,
       33709  +
                            expected.foo,
       33710  +
                            "Unexpected value for `foo`"
       33711  +
                        );
       33712  +
                        ::pretty_assertions::assert_eq!(
       33713  +
                            input.blob.collect().await.unwrap().into_bytes(),
       33714  +
                            expected.blob.collect().await.unwrap().into_bytes()
       33715  +
                        );
       33716  +
                        let response = crate::output::StreamingTraitsOutput {
       33717  +
                            blob: ::aws_smithy_types::byte_stream::ByteStream::from_static(b""),
       33718  +
                            foo: ::std::option::Option::None,
       33719  +
                        };
       33720  +
                        response
       33721  +
                    };
       33722  +
                    sender.send(()).await.expect("receiver dropped early");
       33723  +
                    result
       33724  +
                }
       33725  +
            })
       33726  +
            .build_unchecked();
       33727  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       33728  +
            .await
       33729  +
            .expect("unable to make an HTTP request");
       33730  +
        assert!(
       33731  +
            receiver.recv().await.is_some(),
       33732  +
            "we expected operation handler to be invoked but it was not entered"
       33733  +
        );
       33734  +
    }
       33735  +
    /// Serializes an empty blob in the HTTP payload
       33736  +
    /// Test ID: RestJsonStreamingTraitsWithNoBlobBody
       33737  +
    #[::tokio::test]
       33738  +
    #[::tracing_test::traced_test]
       33739  +
    async fn rest_json_streaming_traits_with_no_blob_body_request() {
       33740  +
        #[allow(unused_mut)]
       33741  +
        let mut http_request = http::Request::builder()
       33742  +
            .uri("/StreamingTraits")
       33743  +
            .method("POST")
       33744  +
            .header("X-Foo", "Foo")
       33745  +
            .body(::aws_smithy_http_server::body::Body::from(
       33746  +
                ::bytes::Bytes::from_static("".as_bytes()),
       33747  +
            ))
       33748  +
            .unwrap();
       33749  +
        #[allow(unused_mut)]
       33750  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       33751  +
        let config = crate::service::RestJsonConfig::builder().build();
       33752  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       33753  +
            .streaming_traits(move |input: crate::input::StreamingTraitsInput| {
       33754  +
                let sender = sender.clone();
       33755  +
                async move {
       33756  +
                    let result = {
       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()),
       33760  +
                        };
       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,
       33773  +
                        };
       33774  +
                        response
       33775  +
                    };
       33776  +
                    sender.send(()).await.expect("receiver dropped early");
       33777  +
                    result
       33778  +
                }
       33779  +
            })
       33780  +
            .build_unchecked();
       33781  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       33782  +
            .await
       33783  +
            .expect("unable to make an HTTP request");
       33784  +
        assert!(
       33785  +
            receiver.recv().await.is_some(),
       33786  +
            "we expected operation handler to be invoked but it was not entered"
       33787  +
        );
       33788  +
    }
       33789  +
    /// Serializes a blob in the HTTP payload
       33790  +
    /// Test ID: RestJsonStreamingTraitsWithBlob
       33791  +
    #[::tokio::test]
       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"),
       33797  +
        };
       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())
       33813  +
            .await
       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  +
        ));
       33820  +
    }
       33821  +
    /// Serializes an empty blob in the HTTP payload
       33822  +
    /// Test ID: RestJsonStreamingTraitsWithNoBlobBody
       33823  +
    #[::tokio::test]
       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()),
       33829  +
        };
       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())
       33842  +
            .await
       33843  +
            .expect("unable to extract body to bytes");
       33844  +
        // No body.
       33845  +
        ::pretty_assertions::assert_eq!(std::str::from_utf8(&body).unwrap(), "");
       33846  +
    }
       33847  +
}
       33848  +
       33849  +
const CONTENT_TYPE_HTTPRESPONSECODE: ::mime::Mime = ::mime::APPLICATION_JSON;
36968  33850   
::pin_project_lite::pin_project! {
36969  33851   
    /// 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>>
       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>>
36973  33855   
    }
36974  33856   
}
36975  33857   
36976         -
impl std::future::Future for PostPlayerActionInputFuture {
       33858  +
impl std::future::Future for HttpResponseCodeInputFuture {
36977  33859   
    type Output = Result<
36978         -
        crate::input::PostPlayerActionInput,
       33860  +
        crate::input::HttpResponseCodeInput,
36979  33861   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
36980  33862   
    >;
36981  33863   
36982  33864   
    fn poll(
36983  33865   
        self: std::pin::Pin<&mut Self>,
36984  33866   
        cx: &mut std::task::Context<'_>,
36985  33867   
    ) -> std::task::Poll<Self::Output> {
36986  33868   
        let this = self.project();
36987  33869   
        this.inner.as_mut().poll(cx)
36988  33870   
    }
36989  33871   
}
36990  33872   
36991  33873   
impl<B>
36992  33874   
    ::aws_smithy_http_server::request::FromRequest<
36993  33875   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
36994  33876   
        B,
36995         -
    > for crate::input::PostPlayerActionInput
       33877  +
    > for crate::input::HttpResponseCodeInput
36996  33878   
where
36997  33879   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
36998  33880   
    B: 'static,
36999  33881   
37000  33882   
    B::Data: Send,
37001  33883   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
37002  33884   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
37003  33885   
{
37004  33886   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
37005         -
    type Future = PostPlayerActionInputFuture;
       33887  +
    type Future = HttpResponseCodeInputFuture;
37006  33888   
37007  33889   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
37008  33890   
        let fut = async move {
37009  33891   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
37010  33892   
                request.headers(),
37011         -
                &CONTENT_TYPE_POSTPLAYERACTION,
       33893  +
                &CONTENT_TYPE_HTTPRESPONSECODE,
37012  33894   
            ) {
37013  33895   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
37014  33896   
            }
37015         -
            crate::protocol_serde::shape_post_player_action::de_post_player_action_http_request(
       33897  +
            crate::protocol_serde::shape_http_response_code::de_http_response_code_http_request(
37016  33898   
                request,
37017  33899   
            )
37018  33900   
            .await
37019  33901   
            .map_err(Into::into)
37020  33902   
        };
37021  33903   
        use ::futures_util::future::TryFutureExt;
37022  33904   
        let fut = fut.map_err(
37023  33905   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
37024  33906   
                ::tracing::debug!(error = %e, "failed to deserialize request");
37025  33907   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
37026  33908   
                    e,
37027  33909   
                )
37028  33910   
            },
37029  33911   
        );
37030         -
        PostPlayerActionInputFuture {
       33912  +
        HttpResponseCodeInputFuture {
37031  33913   
            inner: Box::pin(fut),
37032  33914   
        }
37033  33915   
    }
37034  33916   
}
37035  33917   
impl
37036  33918   
    ::aws_smithy_http_server::response::IntoResponse<
37037  33919   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
37038         -
    > for crate::output::PostPlayerActionOutput
       33920  +
    > for crate::output::HttpResponseCodeOutput
37039  33921   
{
37040  33922   
    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(
       33923  +
        match crate::protocol_serde::shape_http_response_code::ser_http_response_code_http_response(
37042  33924   
            self,
37043  33925   
        ) {
37044  33926   
            Ok(response) => response,
37045  33927   
            Err(e) => {
37046  33928   
                ::tracing::error!(error = %e, "failed to serialize response");
37047  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))
37048  33930   
            }
37049  33931   
        }
37050  33932   
    }
37051  33933   
}
37052  33934   
37053         -
const CONTENT_TYPE_JSONUNIONS: ::mime::Mime = ::mime::APPLICATION_JSON;
       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),
       33950  +
        };
       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,
       33981  +
        };
       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  +
        ));
       34001  +
    }
       34002  +
}
       34003  +
       34004  +
const CONTENT_TYPE_HTTPPAYLOADWITHUNION: ::mime::Mime = ::mime::APPLICATION_JSON;
37054  34005   
::pin_project_lite::pin_project! {
37055  34006   
    /// 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>>
       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>>
37059  34010   
    }
37060  34011   
}
37061  34012   
37062         -
impl std::future::Future for JsonUnionsInputFuture {
       34013  +
impl std::future::Future for HttpPayloadWithUnionInputFuture {
37063  34014   
    type Output = Result<
37064         -
        crate::input::JsonUnionsInput,
       34015  +
        crate::input::HttpPayloadWithUnionInput,
37065  34016   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
37066  34017   
    >;
37067  34018   
37068  34019   
    fn poll(
37069  34020   
        self: std::pin::Pin<&mut Self>,
37070  34021   
        cx: &mut std::task::Context<'_>,
37071  34022   
    ) -> std::task::Poll<Self::Output> {
37072  34023   
        let this = self.project();
37073  34024   
        this.inner.as_mut().poll(cx)
37074  34025   
    }
37075  34026   
}
37076  34027   
37077  34028   
impl<B>
37078  34029   
    ::aws_smithy_http_server::request::FromRequest<
37079  34030   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
37080  34031   
        B,
37081         -
    > for crate::input::JsonUnionsInput
       34032  +
    > for crate::input::HttpPayloadWithUnionInput
37082  34033   
where
37083  34034   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
37084  34035   
    B: 'static,
37085  34036   
37086  34037   
    B::Data: Send,
37087  34038   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
37088  34039   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
37089  34040   
{
37090  34041   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
37091         -
    type Future = JsonUnionsInputFuture;
       34042  +
    type Future = HttpPayloadWithUnionInputFuture;
37092  34043   
37093  34044   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
37094  34045   
        let fut = async move {
37095  34046   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
37096  34047   
                request.headers(),
37097         -
                &CONTENT_TYPE_JSONUNIONS,
       34048  +
                &CONTENT_TYPE_HTTPPAYLOADWITHUNION,
37098  34049   
            ) {
37099  34050   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
37100  34051   
            }
37101         -
            crate::protocol_serde::shape_json_unions::de_json_unions_http_request(request)
37102         -
                .await
37103         -
                .map_err(Into::into)
       34052  +
            crate::protocol_serde::shape_http_payload_with_union::de_http_payload_with_union_http_request(request)
       34053  +
                            .await
       34054  +
                            .map_err(Into::into)
37104  34055   
        };
37105  34056   
        use ::futures_util::future::TryFutureExt;
37106  34057   
        let fut = fut.map_err(
37107  34058   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
37108  34059   
                ::tracing::debug!(error = %e, "failed to deserialize request");
37109  34060   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
37110  34061   
                    e,
37111  34062   
                )
37112  34063   
            },
37113  34064   
        );
37114         -
        JsonUnionsInputFuture {
       34065  +
        HttpPayloadWithUnionInputFuture {
37115  34066   
            inner: Box::pin(fut),
37116  34067   
        }
37117  34068   
    }
37118  34069   
}
37119  34070   
impl
37120  34071   
    ::aws_smithy_http_server::response::IntoResponse<
37121  34072   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
37122         -
    > for crate::output::JsonUnionsOutput
       34073  +
    > for crate::output::HttpPayloadWithUnionOutput
37123  34074   
{
37124  34075   
    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         -
        }
       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  +
                    }
37132  34083   
    }
37133  34084   
}
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()),
37144         -
                );
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         -
        }
       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
       34092  +
    #[::tokio::test]
       34093  +
    #[::tracing_test::traced_test]
       34094  +
    async fn rest_json_http_payload_with_union_request() {
       34095  +
        #[allow(unused_mut)]
       34096  +
        let mut http_request = http::Request::builder()
       34097  +
            .uri("/HttpPayloadWithUnion")
       34098  +
            .method("PUT")
       34099  +
            .header("Content-Type", "application/json")
       34100  +
            .body(::aws_smithy_http_server::body::Body::from(
       34101  +
                ::bytes::Bytes::from_static("{\n    \"greeting\": \"hello\"\n}".as_bytes()),
       34102  +
            ))
       34103  +
            .unwrap();
       34104  +
        #[allow(unused_mut)]
       34105  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       34106  +
        let config = crate::service::RestJsonConfig::builder().build();
       34107  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       34108  +
            .http_payload_with_union(move |input: crate::input::HttpPayloadWithUnionInput| {
       34109  +
                let sender = sender.clone();
       34110  +
                async move {
       34111  +
                    let result = {
       34112  +
                        let expected = crate::input::HttpPayloadWithUnionInput {
       34113  +
                            nested: ::std::option::Option::Some(
       34114  +
                                crate::model::UnionPayload::Greeting("hello".to_owned()),
       34115  +
                            ),
       34116  +
                        };
       34117  +
                        ::pretty_assertions::assert_eq!(input, expected);
       34118  +
                        let response = crate::output::HttpPayloadWithUnionOutput {
       34119  +
                            nested: ::std::option::Option::None,
       34120  +
                        };
       34121  +
                        response
       34122  +
                    };
       34123  +
                    sender.send(()).await.expect("receiver dropped early");
       34124  +
                    result
       34125  +
                }
       34126  +
            })
       34127  +
            .build_unchecked();
       34128  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       34129  +
            .await
       34130  +
            .expect("unable to make an HTTP request");
       34131  +
        assert!(
       34132  +
            receiver.recv().await.is_some(),
       34133  +
            "we expected operation handler to be invoked but it was not entered"
       34134  +
        );
       34135  +
    }
       34136  +
    /// No payload is sent if the union has no value.
       34137  +
    /// Test ID: RestJsonHttpPayloadWithUnsetUnion
       34138  +
    #[::tokio::test]
       34139  +
    #[::tracing_test::traced_test]
       34140  +
    async fn rest_json_http_payload_with_unset_union_request() {
       34141  +
        #[allow(unused_mut)]
       34142  +
        let mut http_request = http::Request::builder()
       34143  +
            .uri("/HttpPayloadWithUnion")
       34144  +
            .method("PUT")
       34145  +
            .body(::aws_smithy_http_server::body::Body::from(
       34146  +
                ::bytes::Bytes::from_static("".as_bytes()),
       34147  +
            ))
       34148  +
            .unwrap();
       34149  +
        #[allow(unused_mut)]
       34150  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       34151  +
        let config = crate::service::RestJsonConfig::builder().build();
       34152  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       34153  +
            .http_payload_with_union(move |input: crate::input::HttpPayloadWithUnionInput| {
       34154  +
                let sender = sender.clone();
       34155  +
                async move {
       34156  +
                    let result = {
       34157  +
                        let expected = crate::input::HttpPayloadWithUnionInput {
       34158  +
                            nested: ::std::option::Option::None,
       34159  +
                        };
       34160  +
                        ::pretty_assertions::assert_eq!(input, expected);
       34161  +
                        let response = crate::output::HttpPayloadWithUnionOutput {
       34162  +
                            nested: ::std::option::Option::None,
       34163  +
                        };
       34164  +
                        response
       34165  +
                    };
       34166  +
                    sender.send(()).await.expect("receiver dropped early");
       34167  +
                    result
       34168  +
                }
       34169  +
            })
       34170  +
            .build_unchecked();
       34171  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       34172  +
            .await
       34173  +
            .expect("unable to make an HTTP request");
       34174  +
        assert!(
       34175  +
            receiver.recv().await.is_some(),
       34176  +
            "we expected operation handler to be invoked but it was not entered"
       34177  +
        );
       34178  +
    }
       34179  +
    /// Serializes a union in the payload.
       34180  +
    /// Test ID: RestJsonHttpPayloadWithUnion
       34181  +
    #[::tokio::test]
       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(), "");
37152  34233   
    }
37153  34234   
}
37154  34235   
37155         -
const CONTENT_TYPE_DOCUMENTTYPEASMAPVALUE: ::mime::Mime = ::mime::APPLICATION_JSON;
       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  +
    });
37156  34242   
::pin_project_lite::pin_project! {
37157  34243   
    /// 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>>
       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>>
37161  34247   
    }
37162  34248   
}
37163  34249   
37164         -
impl std::future::Future for DocumentTypeAsMapValueInputFuture {
       34250  +
impl std::future::Future for HttpStringPayloadInputFuture {
37165  34251   
    type Output = Result<
37166         -
        crate::input::DocumentTypeAsMapValueInput,
       34252  +
        crate::input::HttpStringPayloadInput,
37167  34253   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
37168  34254   
    >;
37169  34255   
37170  34256   
    fn poll(
37171  34257   
        self: std::pin::Pin<&mut Self>,
37172  34258   
        cx: &mut std::task::Context<'_>,
37173  34259   
    ) -> std::task::Poll<Self::Output> {
37174  34260   
        let this = self.project();
37175  34261   
        this.inner.as_mut().poll(cx)
37176  34262   
    }
37177  34263   
}
37178  34264   
37179  34265   
impl<B>
37180  34266   
    ::aws_smithy_http_server::request::FromRequest<
37181  34267   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
37182  34268   
        B,
37183         -
    > for crate::input::DocumentTypeAsMapValueInput
       34269  +
    > for crate::input::HttpStringPayloadInput
37184  34270   
where
37185  34271   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
37186  34272   
    B: 'static,
37187  34273   
37188  34274   
    B::Data: Send,
37189  34275   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
37190  34276   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
37191  34277   
{
37192  34278   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
37193         -
    type Future = DocumentTypeAsMapValueInputFuture;
       34279  +
    type Future = HttpStringPayloadInputFuture;
37194  34280   
37195  34281   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
37196  34282   
        let fut = async move {
37197  34283   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
37198  34284   
                request.headers(),
37199         -
                &CONTENT_TYPE_DOCUMENTTYPEASMAPVALUE,
       34285  +
                &CONTENT_TYPE_HTTPSTRINGPAYLOAD,
37200  34286   
            ) {
37201  34287   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
37202  34288   
            }
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)
       34289  +
            crate::protocol_serde::shape_http_string_payload::de_http_string_payload_http_request(
       34290  +
                request,
       34291  +
            )
       34292  +
            .await
       34293  +
            .map_err(Into::into)
37206  34294   
        };
37207  34295   
        use ::futures_util::future::TryFutureExt;
37208  34296   
        let fut = fut.map_err(
37209  34297   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
37210  34298   
                ::tracing::debug!(error = %e, "failed to deserialize request");
37211  34299   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
37212  34300   
                    e,
37213  34301   
                )
37214  34302   
            },
37215  34303   
        );
37216         -
        DocumentTypeAsMapValueInputFuture {
       34304  +
        HttpStringPayloadInputFuture {
37217  34305   
            inner: Box::pin(fut),
37218  34306   
        }
37219  34307   
    }
37220  34308   
}
37221  34309   
impl
37222  34310   
    ::aws_smithy_http_server::response::IntoResponse<
37223  34311   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
37224         -
    > for crate::output::DocumentTypeAsMapValueOutput
       34312  +
    > for crate::output::HttpStringPayloadOutput
37225  34313   
{
37226  34314   
    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) {
       34315  +
        match crate::protocol_serde::shape_http_string_payload::ser_http_string_payload_http_response(self) {
37228  34316   
                        Ok(response) => response,
37229  34317   
                        Err(e) => {
37230  34318   
                            ::tracing::error!(error = %e, "failed to serialize response");
37231  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))
37232  34320   
                        }
37233  34321   
                    }
37234  34322   
    }
37235  34323   
}
37236  34324   
37237         -
const CONTENT_TYPE_DOCUMENTTYPEASPAYLOAD: ::mime::Mime = ::mime::APPLICATION_JSON;
       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() {
       34334  +
        #[allow(unused_mut)]
       34335  +
        let mut http_request = http::Request::builder()
       34336  +
            .uri("/StringPayload")
       34337  +
            .method("POST")
       34338  +
            .body(::aws_smithy_http_server::body::Body::from(
       34339  +
                ::bytes::Bytes::from_static("rawstring".as_bytes()),
       34340  +
            ))
       34341  +
            .unwrap();
       34342  +
        #[allow(unused_mut)]
       34343  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       34344  +
        let config = crate::service::RestJsonConfig::builder().build();
       34345  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       34346  +
            .http_string_payload(move |input: crate::input::HttpStringPayloadInput| {
       34347  +
                let sender = sender.clone();
       34348  +
                async move {
       34349  +
                    let result = {
       34350  +
                        let expected = crate::input::HttpStringPayloadInput {
       34351  +
                            payload: ::std::option::Option::Some("rawstring".to_owned()),
       34352  +
                        };
       34353  +
                        ::pretty_assertions::assert_eq!(input, expected);
       34354  +
                        let response = crate::output::HttpStringPayloadOutput {
       34355  +
                            payload: ::std::option::Option::None,
       34356  +
                        };
       34357  +
                        response
       34358  +
                    };
       34359  +
                    sender.send(()).await.expect("receiver dropped early");
       34360  +
                    result
       34361  +
                }
       34362  +
            })
       34363  +
            .build_unchecked();
       34364  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       34365  +
            .await
       34366  +
            .expect("unable to make an HTTP request");
       34367  +
        assert!(
       34368  +
            receiver.recv().await.is_some(),
       34369  +
            "we expected operation handler to be invoked but it was not entered"
       34370  +
        );
       34371  +
    }
       34372  +
    /// Test ID: RestJsonStringPayloadResponse
       34373  +
    #[::tokio::test]
       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()),
       34378  +
        };
       34379  +
        use ::aws_smithy_http_server::response::IntoResponse;
       34380  +
        let http_response = output.into_response();
       34381  +
        ::pretty_assertions::assert_eq!(
       34382  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
       34383  +
            http_response.status()
       34384  +
        );
       34385  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
       34386  +
            .await
       34387  +
            .expect("unable to extract body to bytes");
       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  +
        ));
       34393  +
    }
       34394  +
}
       34395  +
       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  +
    });
37238  34402   
::pin_project_lite::pin_project! {
37239  34403   
    /// 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>>
       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>>
37243  34407   
    }
37244  34408   
}
37245  34409   
37246         -
impl std::future::Future for DocumentTypeAsPayloadInputFuture {
       34410  +
impl std::future::Future for HttpEnumPayloadInputFuture {
37247  34411   
    type Output = Result<
37248         -
        crate::input::DocumentTypeAsPayloadInput,
       34412  +
        crate::input::HttpEnumPayloadInput,
37249  34413   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
37250  34414   
    >;
37251  34415   
37252  34416   
    fn poll(
37253  34417   
        self: std::pin::Pin<&mut Self>,
37254  34418   
        cx: &mut std::task::Context<'_>,
37255  34419   
    ) -> std::task::Poll<Self::Output> {
37256  34420   
        let this = self.project();
37257  34421   
        this.inner.as_mut().poll(cx)
37258  34422   
    }
37259  34423   
}
37260  34424   
37261  34425   
impl<B>
37262  34426   
    ::aws_smithy_http_server::request::FromRequest<
37263  34427   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
37264  34428   
        B,
37265         -
    > for crate::input::DocumentTypeAsPayloadInput
       34429  +
    > for crate::input::HttpEnumPayloadInput
37266  34430   
where
37267  34431   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
37268  34432   
    B: 'static,
37269  34433   
37270  34434   
    B::Data: Send,
37271  34435   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
37272  34436   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
37273  34437   
{
37274  34438   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
37275         -
    type Future = DocumentTypeAsPayloadInputFuture;
       34439  +
    type Future = HttpEnumPayloadInputFuture;
37276  34440   
37277  34441   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
37278  34442   
        let fut = async move {
37279  34443   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
37280  34444   
                request.headers(),
37281         -
                &CONTENT_TYPE_DOCUMENTTYPEASPAYLOAD,
       34445  +
                &CONTENT_TYPE_HTTPENUMPAYLOAD,
37282  34446   
            ) {
37283  34447   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
37284  34448   
            }
37285         -
            crate::protocol_serde::shape_document_type_as_payload::de_document_type_as_payload_http_request(request)
37286         -
                            .await
37287         -
                            .map_err(Into::into)
       34449  +
            crate::protocol_serde::shape_http_enum_payload::de_http_enum_payload_http_request(
       34450  +
                request,
       34451  +
            )
       34452  +
            .await
       34453  +
            .map_err(Into::into)
37288  34454   
        };
37289  34455   
        use ::futures_util::future::TryFutureExt;
37290  34456   
        let fut = fut.map_err(
37291  34457   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
37292  34458   
                ::tracing::debug!(error = %e, "failed to deserialize request");
37293  34459   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
37294  34460   
                    e,
37295  34461   
                )
37296  34462   
            },
37297  34463   
        );
37298         -
        DocumentTypeAsPayloadInputFuture {
       34464  +
        HttpEnumPayloadInputFuture {
37299  34465   
            inner: Box::pin(fut),
37300  34466   
        }
37301  34467   
    }
37302  34468   
}
37303  34469   
impl
37304  34470   
    ::aws_smithy_http_server::response::IntoResponse<
37305  34471   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
37306         -
    > for crate::output::DocumentTypeAsPayloadOutput
       34472  +
    > for crate::output::HttpEnumPayloadOutput
37307  34473   
{
37308  34474   
    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         -
                    }
       34475  +
        match crate::protocol_serde::shape_http_enum_payload::ser_http_enum_payload_http_response(
       34476  +
            self,
       34477  +
        ) {
       34478  +
            Ok(response) => response,
       34479  +
            Err(e) => {
       34480  +
                ::tracing::error!(error = %e, "failed to serialize response");
       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))
       34482  +
            }
       34483  +
        }
       34484  +
    }
       34485  +
}
       34486  +
impl
       34487  +
    ::aws_smithy_http_server::response::IntoResponse<
       34488  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       34489  +
    > for crate::error::HttpEnumPayloadError
       34490  +
{
       34491  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
       34492  +
        match crate::protocol_serde::shape_http_enum_payload::ser_http_enum_payload_http_error(
       34493  +
            &self,
       34494  +
        ) {
       34495  +
            Ok(mut response) => {
       34496  +
                response.extensions_mut().insert(
       34497  +
                    ::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()),
       34498  +
                );
       34499  +
                response
       34500  +
            }
       34501  +
            Err(e) => {
       34502  +
                ::tracing::error!(error = %e, "failed to serialize response");
       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))
       34504  +
            }
       34505  +
        }
       34506  +
    }
       34507  +
}
       34508  +
       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  +
        ));
37316  34585   
    }
37317  34586   
}
37318  34587   
37319         -
const CONTENT_TYPE_DOCUMENTTYPE: ::mime::Mime = ::mime::APPLICATION_JSON;
       34588  +
const CONTENT_TYPE_HTTPPAYLOADWITHSTRUCTURE: ::mime::Mime = ::mime::APPLICATION_JSON;
37320  34589   
::pin_project_lite::pin_project! {
37321  34590   
    /// 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>>
       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>>
37325  34594   
    }
37326  34595   
}
37327  34596   
37328         -
impl std::future::Future for DocumentTypeInputFuture {
       34597  +
impl std::future::Future for HttpPayloadWithStructureInputFuture {
37329  34598   
    type Output = Result<
37330         -
        crate::input::DocumentTypeInput,
       34599  +
        crate::input::HttpPayloadWithStructureInput,
37331  34600   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
37332  34601   
    >;
37333  34602   
37334  34603   
    fn poll(
37335  34604   
        self: std::pin::Pin<&mut Self>,
37336  34605   
        cx: &mut std::task::Context<'_>,
37337  34606   
    ) -> std::task::Poll<Self::Output> {
37338  34607   
        let this = self.project();
37339  34608   
        this.inner.as_mut().poll(cx)
37340  34609   
    }
37341  34610   
}
37342  34611   
37343  34612   
impl<B>
37344  34613   
    ::aws_smithy_http_server::request::FromRequest<
37345  34614   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
37346  34615   
        B,
37347         -
    > for crate::input::DocumentTypeInput
       34616  +
    > for crate::input::HttpPayloadWithStructureInput
37348  34617   
where
37349  34618   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
37350  34619   
    B: 'static,
37351  34620   
37352  34621   
    B::Data: Send,
37353  34622   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
37354  34623   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
37355  34624   
{
37356  34625   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
37357         -
    type Future = DocumentTypeInputFuture;
       34626  +
    type Future = HttpPayloadWithStructureInputFuture;
37358  34627   
37359  34628   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
37360  34629   
        let fut = async move {
37361  34630   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
37362  34631   
                request.headers(),
37363         -
                &CONTENT_TYPE_DOCUMENTTYPE,
       34632  +
                &CONTENT_TYPE_HTTPPAYLOADWITHSTRUCTURE,
37364  34633   
            ) {
37365  34634   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
37366  34635   
            }
37367         -
            crate::protocol_serde::shape_document_type::de_document_type_http_request(request)
37368         -
                .await
37369         -
                .map_err(Into::into)
       34636  +
            crate::protocol_serde::shape_http_payload_with_structure::de_http_payload_with_structure_http_request(request)
       34637  +
                            .await
       34638  +
                            .map_err(Into::into)
37370  34639   
        };
37371  34640   
        use ::futures_util::future::TryFutureExt;
37372  34641   
        let fut = fut.map_err(
37373  34642   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
37374  34643   
                ::tracing::debug!(error = %e, "failed to deserialize request");
37375  34644   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
37376  34645   
                    e,
37377  34646   
                )
37378  34647   
            },
37379  34648   
        );
37380         -
        DocumentTypeInputFuture {
       34649  +
        HttpPayloadWithStructureInputFuture {
37381  34650   
            inner: Box::pin(fut),
37382  34651   
        }
37383  34652   
    }
37384  34653   
}
37385  34654   
impl
37386  34655   
    ::aws_smithy_http_server::response::IntoResponse<
37387  34656   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
37388         -
    > for crate::output::DocumentTypeOutput
       34657  +
    > for crate::output::HttpPayloadWithStructureOutput
37389  34658   
{
37390  34659   
    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         -
        }
       34660  +
        match crate::protocol_serde::shape_http_payload_with_structure::ser_http_payload_with_structure_http_response(self) {
       34661  +
                        Ok(response) => response,
       34662  +
                        Err(e) => {
       34663  +
                            ::tracing::error!(error = %e, "failed to serialize response");
       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))
       34665  +
                        }
       34666  +
                    }
37398  34667   
    }
37399  34668   
}
37400  34669   
37401         -
const CONTENT_TYPE_JSONBLOBS: ::mime::Mime = ::mime::APPLICATION_JSON;
       34670  +
#[allow(unreachable_code, unused_variables)]
       34671  +
#[cfg(test)]
       34672  +
mod http_payload_with_structure_test {
       34673  +
       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  +
    });
37402  34767   
::pin_project_lite::pin_project! {
37403  34768   
    /// 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>>
       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>>
37407  34772   
    }
37408  34773   
}
37409  34774   
37410         -
impl std::future::Future for JsonBlobsInputFuture {
       34775  +
impl std::future::Future for HttpPayloadTraitsWithMediaTypeInputFuture {
37411  34776   
    type Output = Result<
37412         -
        crate::input::JsonBlobsInput,
       34777  +
        crate::input::HttpPayloadTraitsWithMediaTypeInput,
37413  34778   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
37414  34779   
    >;
37415  34780   
37416  34781   
    fn poll(
37417  34782   
        self: std::pin::Pin<&mut Self>,
37418  34783   
        cx: &mut std::task::Context<'_>,
37419  34784   
    ) -> std::task::Poll<Self::Output> {
37420  34785   
        let this = self.project();
37421  34786   
        this.inner.as_mut().poll(cx)
37422  34787   
    }
37423  34788   
}
37424  34789   
37425  34790   
impl<B>
37426  34791   
    ::aws_smithy_http_server::request::FromRequest<
37427  34792   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
37428  34793   
        B,
37429         -
    > for crate::input::JsonBlobsInput
       34794  +
    > for crate::input::HttpPayloadTraitsWithMediaTypeInput
37430  34795   
where
37431  34796   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
37432  34797   
    B: 'static,
37433  34798   
37434  34799   
    B::Data: Send,
37435  34800   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
37436  34801   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
37437  34802   
{
37438  34803   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
37439         -
    type Future = JsonBlobsInputFuture;
       34804  +
    type Future = HttpPayloadTraitsWithMediaTypeInputFuture;
37440  34805   
37441  34806   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
37442  34807   
        let fut = async move {
37443  34808   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
37444  34809   
                request.headers(),
37445         -
                &CONTENT_TYPE_JSONBLOBS,
       34810  +
                &CONTENT_TYPE_HTTPPAYLOADTRAITSWITHMEDIATYPE,
37446  34811   
            ) {
37447  34812   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
37448  34813   
            }
37449         -
            crate::protocol_serde::shape_json_blobs::de_json_blobs_http_request(request)
37450         -
                .await
37451         -
                .map_err(Into::into)
       34814  +
            crate::protocol_serde::shape_http_payload_traits_with_media_type::de_http_payload_traits_with_media_type_http_request(request)
       34815  +
                            .await
       34816  +
                            .map_err(Into::into)
37452  34817   
        };
37453  34818   
        use ::futures_util::future::TryFutureExt;
37454  34819   
        let fut = fut.map_err(
37455  34820   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
37456  34821   
                ::tracing::debug!(error = %e, "failed to deserialize request");
37457  34822   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
37458  34823   
                    e,
37459  34824   
                )
37460  34825   
            },
37461  34826   
        );
37462         -
        JsonBlobsInputFuture {
       34827  +
        HttpPayloadTraitsWithMediaTypeInputFuture {
37463  34828   
            inner: Box::pin(fut),
37464  34829   
        }
37465  34830   
    }
37466  34831   
}
37467  34832   
impl
37468  34833   
    ::aws_smithy_http_server::response::IntoResponse<
37469  34834   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
37470         -
    > for crate::output::JsonBlobsOutput
       34835  +
    > for crate::output::HttpPayloadTraitsWithMediaTypeOutput
37471  34836   
{
37472  34837   
    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         -
        }
       34838  +
        match crate::protocol_serde::shape_http_payload_traits_with_media_type::ser_http_payload_traits_with_media_type_http_response(self) {
       34839  +
                        Ok(response) => response,
       34840  +
                        Err(e) => {
       34841  +
                            ::tracing::error!(error = %e, "failed to serialize response");
       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))
       34843  +
                        }
       34844  +
                    }
       34845  +
    }
       34846  +
}
       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  +
        ));
37480  34931   
    }
37481  34932   
}
37482  34933   
37483         -
const CONTENT_TYPE_SPARSEJSONMAPS: ::mime::Mime = ::mime::APPLICATION_JSON;
37484  34934   
::pin_project_lite::pin_project! {
37485  34935   
    /// 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>>
       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>>
37489  34939   
    }
37490  34940   
}
37491  34941   
37492         -
impl std::future::Future for SparseJsonMapsInputFuture {
       34942  +
impl std::future::Future for HttpPayloadTraitsInputFuture {
37493  34943   
    type Output = Result<
37494         -
        crate::input::SparseJsonMapsInput,
       34944  +
        crate::input::HttpPayloadTraitsInput,
37495  34945   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
37496  34946   
    >;
37497  34947   
37498  34948   
    fn poll(
37499  34949   
        self: std::pin::Pin<&mut Self>,
37500  34950   
        cx: &mut std::task::Context<'_>,
37501  34951   
    ) -> std::task::Poll<Self::Output> {
37502  34952   
        let this = self.project();
37503  34953   
        this.inner.as_mut().poll(cx)
37504  34954   
    }
37505  34955   
}
37506  34956   
37507  34957   
impl<B>
37508  34958   
    ::aws_smithy_http_server::request::FromRequest<
37509  34959   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
37510  34960   
        B,
37511         -
    > for crate::input::SparseJsonMapsInput
       34961  +
    > for crate::input::HttpPayloadTraitsInput
37512  34962   
where
37513  34963   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
37514  34964   
    B: 'static,
37515  34965   
37516  34966   
    B::Data: Send,
37517  34967   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
37518  34968   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
37519  34969   
{
37520  34970   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
37521         -
    type Future = SparseJsonMapsInputFuture;
       34971  +
    type Future = HttpPayloadTraitsInputFuture;
37522  34972   
37523  34973   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
37524  34974   
        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)
       34975  +
            crate::protocol_serde::shape_http_payload_traits::de_http_payload_traits_http_request(
       34976  +
                request,
       34977  +
            )
       34978  +
            .await
       34979  +
            .map_err(Into::into)
37534  34980   
        };
37535  34981   
        use ::futures_util::future::TryFutureExt;
37536  34982   
        let fut = fut.map_err(
37537  34983   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
37538  34984   
                ::tracing::debug!(error = %e, "failed to deserialize request");
37539  34985   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
37540  34986   
                    e,
37541  34987   
                )
37542  34988   
            },
37543  34989   
        );
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         -
        }
       34990  +
        HttpPayloadTraitsInputFuture {
       34991  +
            inner: Box::pin(fut),
       34992  +
        }
       34993  +
    }
       34994  +
}
       34995  +
impl
       34996  +
    ::aws_smithy_http_server::response::IntoResponse<
       34997  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       34998  +
    > for crate::output::HttpPayloadTraitsOutput
       34999  +
{
       35000  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
       35001  +
        match crate::protocol_serde::shape_http_payload_traits::ser_http_payload_traits_http_response(self) {
       35002  +
                        Ok(response) => response,
       35003  +
                        Err(e) => {
       35004  +
                            ::tracing::error!(error = %e, "failed to serialize response");
       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))
       35006  +
                        }
       35007  +
                    }
       35008  +
    }
       35009  +
}
       35010  +
       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  +
        ));
37564  35238   
    }
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()),
37577         -
                );
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         -
        }
       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(), "");
37585  35264   
    }
37586  35265   
}
37587  35266   
37588         -
const CONTENT_TYPE_JSONMAPS: ::mime::Mime = ::mime::APPLICATION_JSON;
       35267  +
const CONTENT_TYPE_HTTPPREFIXHEADERSINRESPONSE: ::mime::Mime = ::mime::APPLICATION_JSON;
37589  35268   
::pin_project_lite::pin_project! {
37590  35269   
    /// 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>>
       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>>
37594  35273   
    }
37595  35274   
}
37596  35275   
37597         -
impl std::future::Future for JsonMapsInputFuture {
       35276  +
impl std::future::Future for HttpPrefixHeadersInResponseInputFuture {
37598  35277   
    type Output = Result<
37599         -
        crate::input::JsonMapsInput,
       35278  +
        crate::input::HttpPrefixHeadersInResponseInput,
37600  35279   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
37601  35280   
    >;
37602  35281   
37603  35282   
    fn poll(
37604  35283   
        self: std::pin::Pin<&mut Self>,
37605  35284   
        cx: &mut std::task::Context<'_>,
37606  35285   
    ) -> std::task::Poll<Self::Output> {
37607  35286   
        let this = self.project();
37608  35287   
        this.inner.as_mut().poll(cx)
37609  35288   
    }
37610  35289   
}
37611  35290   
37612  35291   
impl<B>
37613  35292   
    ::aws_smithy_http_server::request::FromRequest<
37614  35293   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
37615  35294   
        B,
37616         -
    > for crate::input::JsonMapsInput
       35295  +
    > for crate::input::HttpPrefixHeadersInResponseInput
37617  35296   
where
37618  35297   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
37619  35298   
    B: 'static,
37620  35299   
37621  35300   
    B::Data: Send,
37622  35301   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
37623  35302   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
37624  35303   
{
37625  35304   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
37626         -
    type Future = JsonMapsInputFuture;
       35305  +
    type Future = HttpPrefixHeadersInResponseInputFuture;
37627  35306   
37628  35307   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
37629  35308   
        let fut = async move {
37630  35309   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
37631  35310   
                request.headers(),
37632         -
                &CONTENT_TYPE_JSONMAPS,
       35311  +
                &CONTENT_TYPE_HTTPPREFIXHEADERSINRESPONSE,
37633  35312   
            ) {
37634  35313   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
37635  35314   
            }
37636         -
            crate::protocol_serde::shape_json_maps::de_json_maps_http_request(request)
37637         -
                .await
37638         -
                .map_err(Into::into)
       35315  +
            crate::protocol_serde::shape_http_prefix_headers_in_response::de_http_prefix_headers_in_response_http_request(request)
       35316  +
                            .await
       35317  +
                            .map_err(Into::into)
37639  35318   
        };
37640  35319   
        use ::futures_util::future::TryFutureExt;
37641  35320   
        let fut = fut.map_err(
37642  35321   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
37643  35322   
                ::tracing::debug!(error = %e, "failed to deserialize request");
37644  35323   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
37645  35324   
                    e,
37646  35325   
                )
37647  35326   
            },
37648  35327   
        );
37649         -
        JsonMapsInputFuture {
       35328  +
        HttpPrefixHeadersInResponseInputFuture {
37650  35329   
            inner: Box::pin(fut),
37651  35330   
        }
37652  35331   
    }
37653  35332   
}
37654  35333   
impl
37655  35334   
    ::aws_smithy_http_server::response::IntoResponse<
37656  35335   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
37657         -
    > for crate::output::JsonMapsOutput
       35336  +
    > for crate::output::HttpPrefixHeadersInResponseOutput
37658  35337   
{
37659  35338   
    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         -
        }
       35339  +
        match crate::protocol_serde::shape_http_prefix_headers_in_response::ser_http_prefix_headers_in_response_http_response(self) {
       35340  +
                        Ok(response) => response,
       35341  +
                        Err(e) => {
       35342  +
                            ::tracing::error!(error = %e, "failed to serialize response");
       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))
       35344  +
                        }
       35345  +
                    }
37667  35346   
    }
37668  35347   
}
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()),
37679         -
                );
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         -
        }
       35348  +
       35349  +
#[allow(unreachable_code, unused_variables)]
       35350  +
#[cfg(test)]
       35351  +
mod http_prefix_headers_in_response_test {
       35352  +
       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  +
        ));
37687  35377   
    }
37688  35378   
}
37689  35379   
37690         -
const CONTENT_TYPE_SPARSEJSONLISTS: ::mime::Mime = ::mime::APPLICATION_JSON;
       35380  +
const CONTENT_TYPE_HTTPPREFIXHEADERS: ::mime::Mime = ::mime::APPLICATION_JSON;
37691  35381   
::pin_project_lite::pin_project! {
37692  35382   
    /// 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>>
       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>>
37696  35386   
    }
37697  35387   
}
37698  35388   
37699         -
impl std::future::Future for SparseJsonListsInputFuture {
       35389  +
impl std::future::Future for HttpPrefixHeadersInputFuture {
37700  35390   
    type Output = Result<
37701         -
        crate::input::SparseJsonListsInput,
       35391  +
        crate::input::HttpPrefixHeadersInput,
37702  35392   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
37703  35393   
    >;
37704  35394   
37705  35395   
    fn poll(
37706  35396   
        self: std::pin::Pin<&mut Self>,
37707  35397   
        cx: &mut std::task::Context<'_>,
37708  35398   
    ) -> std::task::Poll<Self::Output> {
37709  35399   
        let this = self.project();
37710  35400   
        this.inner.as_mut().poll(cx)
37711  35401   
    }
37712  35402   
}
37713  35403   
37714  35404   
impl<B>
37715  35405   
    ::aws_smithy_http_server::request::FromRequest<
37716  35406   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
37717  35407   
        B,
37718         -
    > for crate::input::SparseJsonListsInput
       35408  +
    > for crate::input::HttpPrefixHeadersInput
37719  35409   
where
37720  35410   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
37721  35411   
    B: 'static,
37722  35412   
37723  35413   
    B::Data: Send,
37724  35414   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
37725  35415   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
37726  35416   
{
37727  35417   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
37728         -
    type Future = SparseJsonListsInputFuture;
       35418  +
    type Future = HttpPrefixHeadersInputFuture;
37729  35419   
37730  35420   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
37731  35421   
        let fut = async move {
37732  35422   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
37733  35423   
                request.headers(),
37734         -
                &CONTENT_TYPE_SPARSEJSONLISTS,
       35424  +
                &CONTENT_TYPE_HTTPPREFIXHEADERS,
37735  35425   
            ) {
37736  35426   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
37737  35427   
            }
37738         -
            crate::protocol_serde::shape_sparse_json_lists::de_sparse_json_lists_http_request(
       35428  +
            crate::protocol_serde::shape_http_prefix_headers::de_http_prefix_headers_http_request(
37739  35429   
                request,
37740  35430   
            )
37741  35431   
            .await
37742  35432   
            .map_err(Into::into)
37743  35433   
        };
37744  35434   
        use ::futures_util::future::TryFutureExt;
37745  35435   
        let fut = fut.map_err(
37746  35436   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
37747  35437   
                ::tracing::debug!(error = %e, "failed to deserialize request");
37748  35438   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
37749  35439   
                    e,
37750  35440   
                )
37751  35441   
            },
37752  35442   
        );
37753         -
        SparseJsonListsInputFuture {
       35443  +
        HttpPrefixHeadersInputFuture {
37754  35444   
            inner: Box::pin(fut),
37755  35445   
        }
37756  35446   
    }
37757  35447   
}
37758  35448   
impl
37759  35449   
    ::aws_smithy_http_server::response::IntoResponse<
37760  35450   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
37761         -
    > for crate::output::SparseJsonListsOutput
       35451  +
    > for crate::output::HttpPrefixHeadersOutput
37762  35452   
{
37763  35453   
    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)
       35454  +
        match crate::protocol_serde::shape_http_prefix_headers::ser_http_prefix_headers_http_response(self) {
       35455  +
                        Ok(response) => response,
       35456  +
                        Err(e) => {
       35457  +
                            ::tracing::error!(error = %e, "failed to serialize response");
       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))
       35459  +
                        }
       35460  +
                    }
37797  35461   
    }
37798  35462   
}
37799  35463   
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;
       35464  +
#[allow(unreachable_code, unused_variables)]
       35465  +
#[cfg(test)]
       35466  +
mod http_prefix_headers_test {
37815  35467   
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         -
            },
       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"
37836  35525   
        );
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  35526   
    }
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()),
       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(),
37867  35539   
                );
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);
37925         -
            }
37926         -
            crate::protocol_serde::shape_recursive_shapes::de_recursive_shapes_http_request(request)
37927         -
                .await
37928         -
                .map_err(Into::into)
       35540  +
                ret.insert(
       35541  +
                    "Def".to_owned().to_ascii_lowercase(),
       35542  +
                    "Def value".to_owned(),
       35543  +
                );
       35544  +
                ret
       35545  +
            }),
37929  35546   
        };
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         -
            },
       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()
37938  35552   
        );
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         -
        }
       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  +
        ));
37959  35562   
    }
37960  35563   
}
37961  35564   
37962         -
const CONTENT_TYPE_JSONINTENUMS: ::mime::Mime = ::mime::APPLICATION_JSON;
       35565  +
const CONTENT_TYPE_QUERYPARAMSASSTRINGLISTMAP: ::mime::Mime = ::mime::APPLICATION_JSON;
37963  35566   
::pin_project_lite::pin_project! {
37964  35567   
    /// 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>>
       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>>
37968  35571   
    }
37969  35572   
}
37970  35573   
37971         -
impl std::future::Future for JsonIntEnumsInputFuture {
       35574  +
impl std::future::Future for QueryParamsAsStringListMapInputFuture {
37972  35575   
    type Output = Result<
37973         -
        crate::input::JsonIntEnumsInput,
       35576  +
        crate::input::QueryParamsAsStringListMapInput,
37974  35577   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
37975  35578   
    >;
37976  35579   
37977  35580   
    fn poll(
37978  35581   
        self: std::pin::Pin<&mut Self>,
37979  35582   
        cx: &mut std::task::Context<'_>,
37980  35583   
    ) -> std::task::Poll<Self::Output> {
37981  35584   
        let this = self.project();
37982  35585   
        this.inner.as_mut().poll(cx)
37983  35586   
    }
37984  35587   
}
37985  35588   
37986  35589   
impl<B>
37987  35590   
    ::aws_smithy_http_server::request::FromRequest<
37988  35591   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
37989  35592   
        B,
37990         -
    > for crate::input::JsonIntEnumsInput
       35593  +
    > for crate::input::QueryParamsAsStringListMapInput
37991  35594   
where
37992  35595   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
37993  35596   
    B: 'static,
37994  35597   
37995  35598   
    B::Data: Send,
37996  35599   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
37997  35600   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
37998  35601   
{
37999  35602   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
38000         -
    type Future = JsonIntEnumsInputFuture;
       35603  +
    type Future = QueryParamsAsStringListMapInputFuture;
38001  35604   
38002  35605   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
38003  35606   
        let fut = async move {
38004  35607   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
38005  35608   
                request.headers(),
38006         -
                &CONTENT_TYPE_JSONINTENUMS,
       35609  +
                &CONTENT_TYPE_QUERYPARAMSASSTRINGLISTMAP,
38007  35610   
            ) {
38008  35611   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
38009  35612   
            }
38010         -
            crate::protocol_serde::shape_json_int_enums::de_json_int_enums_http_request(request)
38011         -
                .await
38012         -
                .map_err(Into::into)
       35613  +
            crate::protocol_serde::shape_query_params_as_string_list_map::de_query_params_as_string_list_map_http_request(request)
       35614  +
                            .await
       35615  +
                            .map_err(Into::into)
38013  35616   
        };
38014  35617   
        use ::futures_util::future::TryFutureExt;
38015  35618   
        let fut = fut.map_err(
38016  35619   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
38017  35620   
                ::tracing::debug!(error = %e, "failed to deserialize request");
38018  35621   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
38019  35622   
                    e,
38020  35623   
                )
38021  35624   
            },
38022  35625   
        );
38023         -
        JsonIntEnumsInputFuture {
       35626  +
        QueryParamsAsStringListMapInputFuture {
38024  35627   
            inner: Box::pin(fut),
38025  35628   
        }
38026  35629   
    }
38027  35630   
}
38028  35631   
impl
38029  35632   
    ::aws_smithy_http_server::response::IntoResponse<
38030  35633   
        ::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
       35634  +
    > for crate::output::QueryParamsAsStringListMapOutput
38047  35635   
{
38048  35636   
    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()),
38053         -
                );
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         -
        }
       35637  +
        match crate::protocol_serde::shape_query_params_as_string_list_map::ser_query_params_as_string_list_map_http_response(self) {
       35638  +
                        Ok(response) => response,
       35639  +
                        Err(e) => {
       35640  +
                            ::tracing::error!(error = %e, "failed to serialize response");
       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))
       35642  +
                        }
       35643  +
                    }
38061  35644   
    }
38062  35645   
}
38063  35646   
38064         -
const CONTENT_TYPE_JSONENUMS: ::mime::Mime = ::mime::APPLICATION_JSON;
       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;
38065  35709   
::pin_project_lite::pin_project! {
38066  35710   
    /// 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>>
       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>>
38070  35714   
    }
38071  35715   
}
38072  35716   
38073         -
impl std::future::Future for JsonEnumsInputFuture {
       35717  +
impl std::future::Future for QueryPrecedenceInputFuture {
38074  35718   
    type Output = Result<
38075         -
        crate::input::JsonEnumsInput,
       35719  +
        crate::input::QueryPrecedenceInput,
38076  35720   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
38077  35721   
    >;
38078  35722   
38079  35723   
    fn poll(
38080  35724   
        self: std::pin::Pin<&mut Self>,
38081  35725   
        cx: &mut std::task::Context<'_>,
38082  35726   
    ) -> std::task::Poll<Self::Output> {
38083  35727   
        let this = self.project();
38084  35728   
        this.inner.as_mut().poll(cx)
38085  35729   
    }
38086  35730   
}
38087  35731   
38088  35732   
impl<B>
38089  35733   
    ::aws_smithy_http_server::request::FromRequest<
38090  35734   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
38091  35735   
        B,
38092         -
    > for crate::input::JsonEnumsInput
       35736  +
    > for crate::input::QueryPrecedenceInput
38093  35737   
where
38094  35738   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
38095  35739   
    B: 'static,
38096  35740   
38097  35741   
    B::Data: Send,
38098  35742   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
38099  35743   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
38100  35744   
{
38101  35745   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
38102         -
    type Future = JsonEnumsInputFuture;
       35746  +
    type Future = QueryPrecedenceInputFuture;
38103  35747   
38104  35748   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
38105  35749   
        let fut = async move {
38106  35750   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
38107  35751   
                request.headers(),
38108         -
                &CONTENT_TYPE_JSONENUMS,
       35752  +
                &CONTENT_TYPE_QUERYPRECEDENCE,
38109  35753   
            ) {
38110  35754   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
38111  35755   
            }
38112         -
            crate::protocol_serde::shape_json_enums::de_json_enums_http_request(request)
       35756  +
            crate::protocol_serde::shape_query_precedence::de_query_precedence_http_request(request)
38113  35757   
                .await
38114  35758   
                .map_err(Into::into)
38115  35759   
        };
38116  35760   
        use ::futures_util::future::TryFutureExt;
38117  35761   
        let fut = fut.map_err(
38118  35762   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
38119  35763   
                ::tracing::debug!(error = %e, "failed to deserialize request");
38120  35764   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
38121  35765   
                    e,
38122  35766   
                )
38123  35767   
            },
38124  35768   
        );
38125         -
        JsonEnumsInputFuture {
       35769  +
        QueryPrecedenceInputFuture {
38126  35770   
            inner: Box::pin(fut),
38127  35771   
        }
38128  35772   
    }
38129  35773   
}
38130  35774   
impl
38131  35775   
    ::aws_smithy_http_server::response::IntoResponse<
38132  35776   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
38133         -
    > for crate::output::JsonEnumsOutput
       35777  +
    > for crate::output::QueryPrecedenceOutput
38134  35778   
{
38135  35779   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
38136         -
        match crate::protocol_serde::shape_json_enums::ser_json_enums_http_response(self) {
       35780  +
        match crate::protocol_serde::shape_query_precedence::ser_query_precedence_http_response(
       35781  +
            self,
       35782  +
        ) {
38137  35783   
            Ok(response) => response,
38138  35784   
            Err(e) => {
38139  35785   
                ::tracing::error!(error = %e, "failed to serialize response");
38140  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))
38141  35787   
            }
38142  35788   
        }
38143  35789   
    }
38144  35790   
}
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()),
38155         -
                );
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         -
        }
       35791  +
       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  +
        );
38163  35843   
    }
38164  35844   
}
38165  35845   
38166         -
const CONTENT_TYPE_JSONTIMESTAMPS: ::mime::Mime = ::mime::APPLICATION_JSON;
       35846  +
const CONTENT_TYPE_QUERYIDEMPOTENCYTOKENAUTOFILL: ::mime::Mime = ::mime::APPLICATION_JSON;
38167  35847   
::pin_project_lite::pin_project! {
38168  35848   
    /// 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>>
       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>>
38172  35852   
    }
38173  35853   
}
38174  35854   
38175         -
impl std::future::Future for JsonTimestampsInputFuture {
       35855  +
impl std::future::Future for QueryIdempotencyTokenAutoFillInputFuture {
38176  35856   
    type Output = Result<
38177         -
        crate::input::JsonTimestampsInput,
       35857  +
        crate::input::QueryIdempotencyTokenAutoFillInput,
38178  35858   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
38179  35859   
    >;
38180  35860   
38181  35861   
    fn poll(
38182  35862   
        self: std::pin::Pin<&mut Self>,
38183  35863   
        cx: &mut std::task::Context<'_>,
38184  35864   
    ) -> std::task::Poll<Self::Output> {
38185  35865   
        let this = self.project();
38186  35866   
        this.inner.as_mut().poll(cx)
38187  35867   
    }
38188  35868   
}
38189  35869   
38190  35870   
impl<B>
38191  35871   
    ::aws_smithy_http_server::request::FromRequest<
38192  35872   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
38193  35873   
        B,
38194         -
    > for crate::input::JsonTimestampsInput
       35874  +
    > for crate::input::QueryIdempotencyTokenAutoFillInput
38195  35875   
where
38196  35876   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
38197  35877   
    B: 'static,
38198  35878   
38199  35879   
    B::Data: Send,
38200  35880   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
38201  35881   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
38202  35882   
{
38203  35883   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
38204         -
    type Future = JsonTimestampsInputFuture;
       35884  +
    type Future = QueryIdempotencyTokenAutoFillInputFuture;
38205  35885   
38206  35886   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
38207  35887   
        let fut = async move {
38208  35888   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
38209  35889   
                request.headers(),
38210         -
                &CONTENT_TYPE_JSONTIMESTAMPS,
       35890  +
                &CONTENT_TYPE_QUERYIDEMPOTENCYTOKENAUTOFILL,
38211  35891   
            ) {
38212  35892   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
38213  35893   
            }
38214         -
            crate::protocol_serde::shape_json_timestamps::de_json_timestamps_http_request(request)
38215         -
                .await
38216         -
                .map_err(Into::into)
       35894  +
            crate::protocol_serde::shape_query_idempotency_token_auto_fill::de_query_idempotency_token_auto_fill_http_request(request)
       35895  +
                            .await
       35896  +
                            .map_err(Into::into)
38217  35897   
        };
38218  35898   
        use ::futures_util::future::TryFutureExt;
38219  35899   
        let fut = fut.map_err(
38220  35900   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
38221  35901   
                ::tracing::debug!(error = %e, "failed to deserialize request");
38222  35902   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
38223  35903   
                    e,
38224  35904   
                )
38225  35905   
            },
38226  35906   
        );
38227         -
        JsonTimestampsInputFuture {
       35907  +
        QueryIdempotencyTokenAutoFillInputFuture {
38228  35908   
            inner: Box::pin(fut),
38229  35909   
        }
38230  35910   
    }
38231  35911   
}
38232  35912   
impl
38233  35913   
    ::aws_smithy_http_server::response::IntoResponse<
38234  35914   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
38235         -
    > for crate::output::JsonTimestampsOutput
       35915  +
    > for crate::output::QueryIdempotencyTokenAutoFillOutput
38236  35916   
{
38237  35917   
    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         -
        }
       35918  +
        match crate::protocol_serde::shape_query_idempotency_token_auto_fill::ser_query_idempotency_token_auto_fill_http_response(self) {
       35919  +
                        Ok(response) => response,
       35920  +
                        Err(e) => {
       35921  +
                            ::tracing::error!(error = %e, "failed to serialize response");
       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))
       35923  +
                        }
       35924  +
                    }
38246  35925   
    }
38247  35926   
}
38248  35927   
38249         -
const CONTENT_TYPE_SIMPLESCALARPROPERTIES: ::mime::Mime = ::mime::APPLICATION_JSON;
       35928  +
const CONTENT_TYPE_OMITSSERIALIZINGEMPTYLISTS: ::mime::Mime = ::mime::APPLICATION_JSON;
38250  35929   
::pin_project_lite::pin_project! {
38251  35930   
    /// 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>>
       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>>
38255  35934   
    }
38256  35935   
}
38257  35936   
38258         -
impl std::future::Future for SimpleScalarPropertiesInputFuture {
       35937  +
impl std::future::Future for OmitsSerializingEmptyListsInputFuture {
38259  35938   
    type Output = Result<
38260         -
        crate::input::SimpleScalarPropertiesInput,
       35939  +
        crate::input::OmitsSerializingEmptyListsInput,
38261  35940   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
38262  35941   
    >;
38263  35942   
38264  35943   
    fn poll(
38265  35944   
        self: std::pin::Pin<&mut Self>,
38266  35945   
        cx: &mut std::task::Context<'_>,
38267  35946   
    ) -> std::task::Poll<Self::Output> {
38268  35947   
        let this = self.project();
38269  35948   
        this.inner.as_mut().poll(cx)
38270  35949   
    }
38271  35950   
}
38272  35951   
38273  35952   
impl<B>
38274  35953   
    ::aws_smithy_http_server::request::FromRequest<
38275  35954   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
38276  35955   
        B,
38277         -
    > for crate::input::SimpleScalarPropertiesInput
       35956  +
    > for crate::input::OmitsSerializingEmptyListsInput
38278  35957   
where
38279  35958   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
38280  35959   
    B: 'static,
38281  35960   
38282  35961   
    B::Data: Send,
38283  35962   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
38284  35963   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
38285  35964   
{
38286  35965   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
38287         -
    type Future = SimpleScalarPropertiesInputFuture;
       35966  +
    type Future = OmitsSerializingEmptyListsInputFuture;
38288  35967   
38289  35968   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
38290  35969   
        let fut = async move {
38291  35970   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
38292  35971   
                request.headers(),
38293         -
                &CONTENT_TYPE_SIMPLESCALARPROPERTIES,
       35972  +
                &CONTENT_TYPE_OMITSSERIALIZINGEMPTYLISTS,
38294  35973   
            ) {
38295  35974   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
38296  35975   
            }
38297         -
            crate::protocol_serde::shape_simple_scalar_properties::de_simple_scalar_properties_http_request(request)
       35976  +
            crate::protocol_serde::shape_omits_serializing_empty_lists::de_omits_serializing_empty_lists_http_request(request)
38298  35977   
                            .await
38299  35978   
                            .map_err(Into::into)
38300  35979   
        };
38301  35980   
        use ::futures_util::future::TryFutureExt;
38302  35981   
        let fut = fut.map_err(
38303  35982   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
38304  35983   
                ::tracing::debug!(error = %e, "failed to deserialize request");
38305  35984   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
38306  35985   
                    e,
38307  35986   
                )
38308  35987   
            },
38309  35988   
        );
38310         -
        SimpleScalarPropertiesInputFuture {
       35989  +
        OmitsSerializingEmptyListsInputFuture {
38311  35990   
            inner: Box::pin(fut),
38312  35991   
        }
38313  35992   
    }
38314  35993   
}
38315  35994   
impl
38316  35995   
    ::aws_smithy_http_server::response::IntoResponse<
38317  35996   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
38318         -
    > for crate::output::SimpleScalarPropertiesOutput
       35997  +
    > for crate::output::OmitsSerializingEmptyListsOutput
38319  35998   
{
38320  35999   
    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) {
       36000  +
        match crate::protocol_serde::shape_omits_serializing_empty_lists::ser_omits_serializing_empty_lists_http_response(self) {
38322  36001   
                        Ok(response) => response,
38323  36002   
                        Err(e) => {
38324  36003   
                            ::tracing::error!(error = %e, "failed to serialize response");
38325  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))
38326  36005   
                        }
38327  36006   
                    }
38328  36007   
    }
38329  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  +
}
       36027  +
       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  +
}
38330  36083   
38331         -
const CONTENT_TYPE_GREETINGWITHERRORS: ::mime::Mime = ::mime::APPLICATION_JSON;
       36084  +
const CONTENT_TYPE_OMITSNULLSERIALIZESEMPTYSTRING: ::mime::Mime = ::mime::APPLICATION_JSON;
38332  36085   
::pin_project_lite::pin_project! {
38333  36086   
    /// 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>>
       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>>
38337  36090   
    }
38338  36091   
}
38339  36092   
38340         -
impl std::future::Future for GreetingWithErrorsInputFuture {
       36093  +
impl std::future::Future for OmitsNullSerializesEmptyStringInputFuture {
38341  36094   
    type Output = Result<
38342         -
        crate::input::GreetingWithErrorsInput,
       36095  +
        crate::input::OmitsNullSerializesEmptyStringInput,
38343  36096   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
38344  36097   
    >;
38345  36098   
38346  36099   
    fn poll(
38347  36100   
        self: std::pin::Pin<&mut Self>,
38348  36101   
        cx: &mut std::task::Context<'_>,
38349  36102   
    ) -> std::task::Poll<Self::Output> {
38350  36103   
        let this = self.project();
38351  36104   
        this.inner.as_mut().poll(cx)
38352  36105   
    }
38353  36106   
}
38354  36107   
38355  36108   
impl<B>
38356  36109   
    ::aws_smithy_http_server::request::FromRequest<
38357  36110   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
38358  36111   
        B,
38359         -
    > for crate::input::GreetingWithErrorsInput
       36112  +
    > for crate::input::OmitsNullSerializesEmptyStringInput
38360  36113   
where
38361  36114   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
38362  36115   
    B: 'static,
38363  36116   
38364  36117   
    B::Data: Send,
38365  36118   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
38366  36119   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
38367  36120   
{
38368  36121   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
38369         -
    type Future = GreetingWithErrorsInputFuture;
       36122  +
    type Future = OmitsNullSerializesEmptyStringInputFuture;
38370  36123   
38371  36124   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
38372  36125   
        let fut = async move {
38373  36126   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
38374  36127   
                request.headers(),
38375         -
                &CONTENT_TYPE_GREETINGWITHERRORS,
       36128  +
                &CONTENT_TYPE_OMITSNULLSERIALIZESEMPTYSTRING,
38376  36129   
            ) {
38377  36130   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
38378  36131   
            }
38379         -
            crate::protocol_serde::shape_greeting_with_errors::de_greeting_with_errors_http_request(
38380         -
                request,
38381         -
            )
38382         -
            .await
38383         -
            .map_err(Into::into)
       36132  +
            crate::protocol_serde::shape_omits_null_serializes_empty_string::de_omits_null_serializes_empty_string_http_request(request)
       36133  +
                            .await
       36134  +
                            .map_err(Into::into)
38384  36135   
        };
38385  36136   
        use ::futures_util::future::TryFutureExt;
38386  36137   
        let fut = fut.map_err(
38387  36138   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
38388  36139   
                ::tracing::debug!(error = %e, "failed to deserialize request");
38389  36140   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
38390  36141   
                    e,
38391  36142   
                )
38392  36143   
            },
38393  36144   
        );
38394         -
        GreetingWithErrorsInputFuture {
       36145  +
        OmitsNullSerializesEmptyStringInputFuture {
38395  36146   
            inner: Box::pin(fut),
38396  36147   
        }
38397  36148   
    }
38398  36149   
}
38399  36150   
impl
38400  36151   
    ::aws_smithy_http_server::response::IntoResponse<
38401  36152   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
38402         -
    > for crate::output::GreetingWithErrorsOutput
       36153  +
    > for crate::output::OmitsNullSerializesEmptyStringOutput
38403  36154   
{
38404  36155   
    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) {
       36156  +
        match crate::protocol_serde::shape_omits_null_serializes_empty_string::ser_omits_null_serializes_empty_string_http_response(self) {
38406  36157   
                        Ok(response) => response,
38407  36158   
                        Err(e) => {
38408  36159   
                            ::tracing::error!(error = %e, "failed to serialize response");
38409  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))
38410  36161   
                        }
38411  36162   
                    }
38412  36163   
    }
38413  36164   
}
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()),
38426         -
                );
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         -
        }
       36165  +
       36166  +
#[allow(unreachable_code, unused_variables)]
       36167  +
#[cfg(test)]
       36168  +
mod omits_null_serializes_empty_string_test {
       36169  +
       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,
       36196  +
                            };
       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  +
                    }
       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"
       36213  +
        );
       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
       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  +
        );
38434  36259   
    }
38435  36260   
}
38436  36261   
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         -
    });
       36262  +
const CONTENT_TYPE_IGNOREQUERYPARAMSINRESPONSE: ::mime::Mime = ::mime::APPLICATION_JSON;
38443  36263   
::pin_project_lite::pin_project! {
38444  36264   
    /// 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>>
       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>>
38448  36268   
    }
38449  36269   
}
38450  36270   
38451         -
impl std::future::Future for StreamingTraitsWithMediaTypeInputFuture {
       36271  +
impl std::future::Future for IgnoreQueryParamsInResponseInputFuture {
38452  36272   
    type Output = Result<
38453         -
        crate::input::StreamingTraitsWithMediaTypeInput,
       36273  +
        crate::input::IgnoreQueryParamsInResponseInput,
38454  36274   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
38455  36275   
    >;
38456  36276   
38457  36277   
    fn poll(
38458  36278   
        self: std::pin::Pin<&mut Self>,
38459  36279   
        cx: &mut std::task::Context<'_>,
38460  36280   
    ) -> std::task::Poll<Self::Output> {
38461  36281   
        let this = self.project();
38462  36282   
        this.inner.as_mut().poll(cx)
38463  36283   
    }
38464  36284   
}
38465  36285   
38466  36286   
impl<B>
38467  36287   
    ::aws_smithy_http_server::request::FromRequest<
38468  36288   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
38469  36289   
        B,
38470         -
    > for crate::input::StreamingTraitsWithMediaTypeInput
       36290  +
    > for crate::input::IgnoreQueryParamsInResponseInput
38471  36291   
where
38472  36292   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
38473  36293   
    B: 'static,
38474  36294   
38475         -
    B: Into<::aws_smithy_types::byte_stream::ByteStream>,
38476  36295   
    B::Data: Send,
38477  36296   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
38478  36297   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
38479  36298   
{
38480  36299   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
38481         -
    type Future = StreamingTraitsWithMediaTypeInputFuture;
       36300  +
    type Future = IgnoreQueryParamsInResponseInputFuture;
38482  36301   
38483  36302   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
38484  36303   
        let fut = async move {
38485  36304   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
38486  36305   
                request.headers(),
38487         -
                &CONTENT_TYPE_STREAMINGTRAITSWITHMEDIATYPE,
       36306  +
                &CONTENT_TYPE_IGNOREQUERYPARAMSINRESPONSE,
38488  36307   
            ) {
38489  36308   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
38490  36309   
            }
38491         -
            crate::protocol_serde::shape_streaming_traits_with_media_type::de_streaming_traits_with_media_type_http_request(request)
       36310  +
            crate::protocol_serde::shape_ignore_query_params_in_response::de_ignore_query_params_in_response_http_request(request)
38492  36311   
                            .await
38493  36312   
                            .map_err(Into::into)
38494  36313   
        };
38495  36314   
        use ::futures_util::future::TryFutureExt;
38496  36315   
        let fut = fut.map_err(
38497  36316   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
38498  36317   
                ::tracing::debug!(error = %e, "failed to deserialize request");
38499  36318   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
38500  36319   
                    e,
38501  36320   
                )
38502  36321   
            },
38503  36322   
        );
38504         -
        StreamingTraitsWithMediaTypeInputFuture {
       36323  +
        IgnoreQueryParamsInResponseInputFuture {
38505  36324   
            inner: Box::pin(fut),
38506  36325   
        }
38507  36326   
    }
38508  36327   
}
38509  36328   
impl
38510  36329   
    ::aws_smithy_http_server::response::IntoResponse<
38511  36330   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
38512         -
    > for crate::output::StreamingTraitsWithMediaTypeOutput
       36331  +
    > for crate::output::IgnoreQueryParamsInResponseOutput
38513  36332   
{
38514  36333   
    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) {
       36334  +
        match crate::protocol_serde::shape_ignore_query_params_in_response::ser_ignore_query_params_in_response_http_response(self) {
38516  36335   
                        Ok(response) => response,
38517  36336   
                        Err(e) => {
38518  36337   
                            ::tracing::error!(error = %e, "failed to serialize response");
38519  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))
38520  36339   
                        }
38521  36340   
                    }
38522  36341   
    }
38523  36342   
}
38524  36343   
38525         -
const CONTENT_TYPE_STREAMINGTRAITSREQUIRELENGTH: ::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;
38526  36382   
::pin_project_lite::pin_project! {
38527  36383   
    /// 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>>
       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>>
38531  36387   
    }
38532  36388   
}
38533  36389   
38534         -
impl std::future::Future for StreamingTraitsRequireLengthInputFuture {
       36390  +
impl std::future::Future for ConstantAndVariableQueryStringInputFuture {
38535  36391   
    type Output = Result<
38536         -
        crate::input::StreamingTraitsRequireLengthInput,
       36392  +
        crate::input::ConstantAndVariableQueryStringInput,
38537  36393   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
38538  36394   
    >;
38539  36395   
38540  36396   
    fn poll(
38541  36397   
        self: std::pin::Pin<&mut Self>,
38542  36398   
        cx: &mut std::task::Context<'_>,
38543  36399   
    ) -> std::task::Poll<Self::Output> {
38544  36400   
        let this = self.project();
38545  36401   
        this.inner.as_mut().poll(cx)
38546  36402   
    }
38547  36403   
}
38548  36404   
38549  36405   
impl<B>
38550  36406   
    ::aws_smithy_http_server::request::FromRequest<
38551  36407   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
38552  36408   
        B,
38553         -
    > for crate::input::StreamingTraitsRequireLengthInput
       36409  +
    > for crate::input::ConstantAndVariableQueryStringInput
38554  36410   
where
38555  36411   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
38556  36412   
    B: 'static,
38557  36413   
38558         -
    B: Into<::aws_smithy_types::byte_stream::ByteStream>,
38559  36414   
    B::Data: Send,
38560  36415   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
38561  36416   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
38562  36417   
{
38563  36418   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
38564         -
    type Future = StreamingTraitsRequireLengthInputFuture;
       36419  +
    type Future = ConstantAndVariableQueryStringInputFuture;
38565  36420   
38566  36421   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
38567  36422   
        let fut = async move {
38568  36423   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
38569  36424   
                request.headers(),
38570         -
                &CONTENT_TYPE_STREAMINGTRAITSREQUIRELENGTH,
       36425  +
                &CONTENT_TYPE_CONSTANTANDVARIABLEQUERYSTRING,
38571  36426   
            ) {
38572  36427   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
38573  36428   
            }
38574         -
            crate::protocol_serde::shape_streaming_traits_require_length::de_streaming_traits_require_length_http_request(request)
       36429  +
            crate::protocol_serde::shape_constant_and_variable_query_string::de_constant_and_variable_query_string_http_request(request)
38575  36430   
                            .await
38576  36431   
                            .map_err(Into::into)
38577  36432   
        };
38578  36433   
        use ::futures_util::future::TryFutureExt;
38579  36434   
        let fut = fut.map_err(
38580  36435   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
38581  36436   
                ::tracing::debug!(error = %e, "failed to deserialize request");
38582  36437   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
38583  36438   
                    e,
38584  36439   
                )
38585  36440   
            },
38586  36441   
        );
38587         -
        StreamingTraitsRequireLengthInputFuture {
       36442  +
        ConstantAndVariableQueryStringInputFuture {
38588  36443   
            inner: Box::pin(fut),
38589  36444   
        }
38590  36445   
    }
38591  36446   
}
38592  36447   
impl
38593  36448   
    ::aws_smithy_http_server::response::IntoResponse<
38594  36449   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
38595         -
    > for crate::output::StreamingTraitsRequireLengthOutput
       36450  +
    > for crate::output::ConstantAndVariableQueryStringOutput
38596  36451   
{
38597  36452   
    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) {
       36453  +
        match crate::protocol_serde::shape_constant_and_variable_query_string::ser_constant_and_variable_query_string_http_response(self) {
38599  36454   
                        Ok(response) => response,
38600  36455   
                        Err(e) => {
38601  36456   
                            ::tracing::error!(error = %e, "failed to serialize response");
38602  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))
38603  36458   
                        }
38604  36459   
                    }
38605  36460   
    }
38606  36461   
}
38607  36462   
38608         -
const CONTENT_TYPE_STREAMINGTRAITS: ::mime::Mime = ::mime::APPLICATION_OCTET_STREAM;
       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 {};
       36498  +
                            response
       36499  +
                        };
       36500  +
                        sender.send(()).await.expect("receiver dropped early");
       36501  +
                        result
       36502  +
                    }
       36503  +
                },
       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  +
        );
       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
       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  +
        );
       36560  +
    }
       36561  +
}
       36562  +
       36563  +
const CONTENT_TYPE_CONSTANTQUERYSTRING: ::mime::Mime = ::mime::APPLICATION_JSON;
38609  36564   
::pin_project_lite::pin_project! {
38610  36565   
    /// 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>>
       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>>
38614  36569   
    }
38615  36570   
}
38616  36571   
38617         -
impl std::future::Future for StreamingTraitsInputFuture {
       36572  +
impl std::future::Future for ConstantQueryStringInputFuture {
38618  36573   
    type Output = Result<
38619         -
        crate::input::StreamingTraitsInput,
       36574  +
        crate::input::ConstantQueryStringInput,
38620  36575   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
38621  36576   
    >;
38622  36577   
38623  36578   
    fn poll(
38624  36579   
        self: std::pin::Pin<&mut Self>,
38625  36580   
        cx: &mut std::task::Context<'_>,
38626  36581   
    ) -> std::task::Poll<Self::Output> {
38627  36582   
        let this = self.project();
38628  36583   
        this.inner.as_mut().poll(cx)
38629  36584   
    }
38630  36585   
}
38631  36586   
38632  36587   
impl<B>
38633  36588   
    ::aws_smithy_http_server::request::FromRequest<
38634  36589   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
38635  36590   
        B,
38636         -
    > for crate::input::StreamingTraitsInput
       36591  +
    > for crate::input::ConstantQueryStringInput
38637  36592   
where
38638  36593   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
38639  36594   
    B: 'static,
38640  36595   
38641         -
    B: Into<::aws_smithy_types::byte_stream::ByteStream>,
38642  36596   
    B::Data: Send,
38643  36597   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
38644  36598   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
38645  36599   
{
38646  36600   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
38647         -
    type Future = StreamingTraitsInputFuture;
       36601  +
    type Future = ConstantQueryStringInputFuture;
38648  36602   
38649  36603   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
38650  36604   
        let fut = async move {
38651  36605   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
38652  36606   
                request.headers(),
38653         -
                &CONTENT_TYPE_STREAMINGTRAITS,
       36607  +
                &CONTENT_TYPE_CONSTANTQUERYSTRING,
38654  36608   
            ) {
38655  36609   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
38656  36610   
            }
38657         -
            crate::protocol_serde::shape_streaming_traits::de_streaming_traits_http_request(request)
38658         -
                .await
38659         -
                .map_err(Into::into)
       36611  +
            crate::protocol_serde::shape_constant_query_string::de_constant_query_string_http_request(request)
       36612  +
                            .await
       36613  +
                            .map_err(Into::into)
38660  36614   
        };
38661  36615   
        use ::futures_util::future::TryFutureExt;
38662  36616   
        let fut = fut.map_err(
38663  36617   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
38664  36618   
                ::tracing::debug!(error = %e, "failed to deserialize request");
38665  36619   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
38666  36620   
                    e,
38667  36621   
                )
38668  36622   
            },
38669  36623   
        );
38670         -
        StreamingTraitsInputFuture {
       36624  +
        ConstantQueryStringInputFuture {
38671  36625   
            inner: Box::pin(fut),
38672  36626   
        }
38673  36627   
    }
38674  36628   
}
38675  36629   
impl
38676  36630   
    ::aws_smithy_http_server::response::IntoResponse<
38677  36631   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
38678         -
    > for crate::output::StreamingTraitsOutput
       36632  +
    > for crate::output::ConstantQueryStringOutput
38679  36633   
{
38680  36634   
    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,
       36635  +
        match crate::protocol_serde::shape_constant_query_string::ser_constant_query_string_http_response(self) {
       36636  +
                        Ok(response) => response,
       36637  +
                        Err(e) => {
       36638  +
                            ::tracing::error!(error = %e, "failed to serialize response");
       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))
       36640  +
                        }
       36641  +
                    }
       36642  +
    }
       36643  +
}
       36644  +
impl
       36645  +
    ::aws_smithy_http_server::response::IntoResponse<
       36646  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       36647  +
    > for crate::error::ConstantQueryStringError
       36648  +
{
       36649  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
       36650  +
        match crate::protocol_serde::shape_constant_query_string::ser_constant_query_string_http_error(&self) {
       36651  +
            Ok(mut response) => {
       36652  +
                response.extensions_mut().insert(::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()));
       36653  +
                response
       36654  +
            },
38685  36655   
            Err(e) => {
38686  36656   
                ::tracing::error!(error = %e, "failed to serialize response");
38687  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))
38688  36658   
            }
38689  36659   
        }
38690  36660   
    }
38691  36661   
}
38692  36662   
38693         -
const CONTENT_TYPE_HTTPRESPONSECODE: ::mime::Mime = ::mime::APPLICATION_JSON;
       36663  +
#[allow(unreachable_code, unused_variables)]
       36664  +
#[cfg(test)]
       36665  +
mod constant_query_string_test {
       36666  +
       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
       36698  +
                }
       36699  +
            })
       36700  +
            .build_unchecked();
       36701  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       36702  +
            .await
       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"
       36707  +
        );
       36708  +
    }
       36709  +
}
       36710  +
       36711  +
const CONTENT_TYPE_ALLQUERYSTRINGTYPES: ::mime::Mime = ::mime::APPLICATION_JSON;
38694  36712   
::pin_project_lite::pin_project! {
38695  36713   
    /// 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>>
       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>>
38699  36717   
    }
38700  36718   
}
38701  36719   
38702         -
impl std::future::Future for HttpResponseCodeInputFuture {
       36720  +
impl std::future::Future for AllQueryStringTypesInputFuture {
38703  36721   
    type Output = Result<
38704         -
        crate::input::HttpResponseCodeInput,
       36722  +
        crate::input::AllQueryStringTypesInput,
38705  36723   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
38706  36724   
    >;
38707  36725   
38708  36726   
    fn poll(
38709  36727   
        self: std::pin::Pin<&mut Self>,
38710  36728   
        cx: &mut std::task::Context<'_>,
38711  36729   
    ) -> std::task::Poll<Self::Output> {
38712  36730   
        let this = self.project();
38713  36731   
        this.inner.as_mut().poll(cx)
38714  36732   
    }
38715  36733   
}
38716  36734   
38717  36735   
impl<B>
38718  36736   
    ::aws_smithy_http_server::request::FromRequest<
38719  36737   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
38720  36738   
        B,
38721         -
    > for crate::input::HttpResponseCodeInput
       36739  +
    > for crate::input::AllQueryStringTypesInput
38722  36740   
where
38723  36741   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
38724  36742   
    B: 'static,
38725  36743   
38726  36744   
    B::Data: Send,
38727  36745   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
38728  36746   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
38729  36747   
{
38730  36748   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
38731         -
    type Future = HttpResponseCodeInputFuture;
       36749  +
    type Future = AllQueryStringTypesInputFuture;
38732  36750   
38733  36751   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
38734  36752   
        let fut = async move {
38735  36753   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
38736  36754   
                request.headers(),
38737         -
                &CONTENT_TYPE_HTTPRESPONSECODE,
       36755  +
                &CONTENT_TYPE_ALLQUERYSTRINGTYPES,
38738  36756   
            ) {
38739  36757   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
38740  36758   
            }
38741         -
            crate::protocol_serde::shape_http_response_code::de_http_response_code_http_request(
38742         -
                request,
38743         -
            )
       36759  +
            crate::protocol_serde::shape_all_query_string_types::de_all_query_string_types_http_request(request)
       36760  +
                            .await
       36761  +
                            .map_err(Into::into)
       36762  +
        };
       36763  +
        use ::futures_util::future::TryFutureExt;
       36764  +
        let fut = fut.map_err(
       36765  +
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
       36766  +
                ::tracing::debug!(error = %e, "failed to deserialize request");
       36767  +
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
       36768  +
                    e,
       36769  +
                )
       36770  +
            },
       36771  +
        );
       36772  +
        AllQueryStringTypesInputFuture {
       36773  +
            inner: Box::pin(fut),
       36774  +
        }
       36775  +
    }
       36776  +
}
       36777  +
impl
       36778  +
    ::aws_smithy_http_server::response::IntoResponse<
       36779  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       36780  +
    > for crate::output::AllQueryStringTypesOutput
       36781  +
{
       36782  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
       36783  +
        match crate::protocol_serde::shape_all_query_string_types::ser_all_query_string_types_http_response(self) {
       36784  +
                        Ok(response) => response,
       36785  +
                        Err(e) => {
       36786  +
                            ::tracing::error!(error = %e, "failed to serialize response");
       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))
       36788  +
                        }
       36789  +
                    }
       36790  +
    }
       36791  +
}
       36792  +
impl
       36793  +
    ::aws_smithy_http_server::response::IntoResponse<
       36794  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       36795  +
    > for crate::error::AllQueryStringTypesError
       36796  +
{
       36797  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
       36798  +
        match crate::protocol_serde::shape_all_query_string_types::ser_all_query_string_types_http_error(&self) {
       36799  +
            Ok(mut response) => {
       36800  +
                response.extensions_mut().insert(::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()));
       36801  +
                response
       36802  +
            },
       36803  +
            Err(e) => {
       36804  +
                ::tracing::error!(error = %e, "failed to serialize response");
       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))
       36806  +
            }
       36807  +
        }
       36808  +
    }
       36809  +
}
       36810  +
       36811  +
#[allow(unreachable_code, unused_variables)]
       36812  +
#[cfg(test)]
       36813  +
mod all_query_string_types_test {
       36814  +
       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()],
       36901  +
                                );
       36902  +
                                ret.insert(
       36903  +
                                    "StringSet".to_owned(),
       36904  +
                                    vec!["a".to_owned(), "b".to_owned(), "c".to_owned()],
       36905  +
                                );
       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()],
       36912  +
                                );
       36913  +
                                ret.insert(
       36914  +
                                    "IntegerSet".to_owned(),
       36915  +
                                    vec!["1".to_owned(), "2".to_owned(), "3".to_owned()],
       36916  +
                                );
       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()],
       36923  +
                                );
       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()],
       36928  +
                                );
       36929  +
                                ret.insert(
       36930  +
                                    "Timestamp".to_owned(),
       36931  +
                                    vec!["1970-01-01T00:00:01Z".to_owned()],
       36932  +
                                );
       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  +
                                    ],
       36940  +
                                );
       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  +
                            }),
       36953  +
                        };
       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
       37004  +
                        );
       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
       37010  +
                        );
       37011  +
                        ::pretty_assertions::assert_eq!(
       37012  +
                            input.query_double_list,
       37013  +
                            expected.query_double_list,
       37014  +
                            "Unexpected value for `query_double_list`"
       37015  +
                        );
       37016  +
                        ::pretty_assertions::assert_eq!(
       37017  +
                            input.query_boolean,
       37018  +
                            expected.query_boolean,
       37019  +
                            "Unexpected value for `query_boolean`"
       37020  +
                        );
       37021  +
                        ::pretty_assertions::assert_eq!(
       37022  +
                            input.query_boolean_list,
       37023  +
                            expected.query_boolean_list,
       37024  +
                            "Unexpected value for `query_boolean_list`"
       37025  +
                        );
       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
       37066  +
                }
       37067  +
            })
       37068  +
            .build_unchecked();
       37069  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
38744  37070   
            .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         -
            },
       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"
38755  37075   
        );
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         -
    }
38777         -
}
38778         -
38779         -
const CONTENT_TYPE_HTTPPAYLOADWITHUNION: ::mime::Mime = ::mime::APPLICATION_JSON;
38780         -
::pin_project_lite::pin_project! {
38781         -
    /// 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>>
38785         -
    }
38786         -
}
38787         -
38788         -
impl std::future::Future for HttpPayloadWithUnionInputFuture {
38789         -
    type Output = Result<
38790         -
        crate::input::HttpPayloadWithUnionInput,
38791         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
38792         -
    >;
38793         -
38794         -
    fn poll(
38795         -
        self: std::pin::Pin<&mut Self>,
38796         -
        cx: &mut std::task::Context<'_>,
38797         -
    ) -> std::task::Poll<Self::Output> {
38798         -
        let this = self.project();
38799         -
        this.inner.as_mut().poll(cx)
38800  37076   
    }
38801         -
}
38802         -
38803         -
impl<B>
38804         -
    ::aws_smithy_http_server::request::FromRequest<
38805         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
38806         -
        B,
38807         -
    > for crate::input::HttpPayloadWithUnionInput
38808         -
where
38809         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
38810         -
    B: 'static,
38811         -
38812         -
    B::Data: Send,
38813         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
38814         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
38815         -
{
38816         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
38817         -
    type Future = HttpPayloadWithUnionInputFuture;
38818         -
38819         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
38820         -
        let fut = async move {
38821         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
38822         -
                request.headers(),
38823         -
                &CONTENT_TYPE_HTTPPAYLOADWITHUNION,
38824         -
            ) {
38825         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
38826         -
            }
38827         -
            crate::protocol_serde::shape_http_payload_with_union::de_http_payload_with_union_http_request(request)
38828         -
                            .await
38829         -
                            .map_err(Into::into)
38830         -
        };
38831         -
        use ::futures_util::future::TryFutureExt;
38832         -
        let fut = fut.map_err(
38833         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
38834         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
38835         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
38836         -
                    e,
38837         -
                )
38838         -
            },
       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,
       37136  +
                        };
       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`"
       37166  +
                        );
       37167  +
                        ::pretty_assertions::assert_eq!(
       37168  +
                            input.query_integer_list,
       37169  +
                            expected.query_integer_list,
       37170  +
                            "Unexpected value for `query_integer_list`"
       37171  +
                        );
       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
       37249  +
                }
       37250  +
            })
       37251  +
            .build_unchecked();
       37252  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       37253  +
            .await
       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"
38839  37258   
        );
38840         -
        HttpPayloadWithUnionInputFuture {
38841         -
            inner: Box::pin(fut),
38842         -
        }
38843         -
    }
38844         -
}
38845         -
impl
38846         -
    ::aws_smithy_http_server::response::IntoResponse<
38847         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
38848         -
    > for crate::output::HttpPayloadWithUnionOutput
38849         -
{
38850         -
    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) {
38852         -
                        Ok(response) => response,
38853         -
                        Err(e) => {
38854         -
                            ::tracing::error!(error = %e, "failed to serialize response");
38855         -
                            ::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         -
                        }
38857         -
                    }
38858         -
    }
38859         -
}
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  37259   
    }
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         -
            )
       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()],
       37292  +
                                );
       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,
       37314  +
                        };
       37315  +
                        ::pretty_assertions::assert_eq!(
       37316  +
                            input.query_string,
       37317  +
                            expected.query_string,
       37318  +
                            "Unexpected value for `query_string`"
       37319  +
                        );
       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
       37427  +
                }
       37428  +
            })
       37429  +
            .build_unchecked();
       37430  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
38917  37431   
            .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         -
            },
       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"
38928  37436   
        );
38929         -
        HttpStringPayloadInputFuture {
38930         -
            inner: Box::pin(fut),
38931         -
        }
38932  37437   
    }
38933         -
}
38934         -
impl
38935         -
    ::aws_smithy_http_server::response::IntoResponse<
38936         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
38937         -
    > for crate::output::HttpStringPayloadOutput
38938         -
{
38939         -
    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,
38942         -
                        Err(e) => {
38943         -
                            ::tracing::error!(error = %e, "failed to serialize response");
38944         -
                            ::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))
       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")
       37467  +
                    )
       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")
       37472  +
                    )
       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  +
                                ]
       37485  +
                            );
       37486  +
                            ret.insert(
       37487  +
                                "Double".to_owned()
       37488  +
                                ,
       37489  +
                                vec![
       37490  +
                                    "NaN".to_owned()
       37491  +
                                    ,
       37492  +
                                ]
       37493  +
                            );
       37494  +
                            ret
38945  37495   
                        }
38946         -
                    }
38947         -
    }
38948         -
}
38949         -
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         -
    });
38956         -
::pin_project_lite::pin_project! {
38957         -
    /// 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>>
38961         -
    }
38962         -
}
38963         -
38964         -
impl std::future::Future for HttpEnumPayloadInputFuture {
38965         -
    type Output = Result<
38966         -
        crate::input::HttpEnumPayloadInput,
38967         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
38968         -
    >;
38969         -
38970         -
    fn poll(
38971         -
        self: std::pin::Pin<&mut Self>,
38972         -
        cx: &mut std::task::Context<'_>,
38973         -
    ) -> std::task::Poll<Self::Output> {
38974         -
        let this = self.project();
38975         -
        this.inner.as_mut().poll(cx)
38976         -
    }
38977         -
}
38978         -
38979         -
impl<B>
38980         -
    ::aws_smithy_http_server::request::FromRequest<
38981         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
38982         -
        B,
38983         -
    > for crate::input::HttpEnumPayloadInput
38984         -
where
38985         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
38986         -
    B: 'static,
38987         -
38988         -
    B::Data: Send,
38989         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
38990         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
38991         -
{
38992         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
38993         -
    type Future = HttpEnumPayloadInputFuture;
38994         -
38995         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
38996         -
        let fut = async move {
38997         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
38998         -
                request.headers(),
38999         -
                &CONTENT_TYPE_HTTPENUMPAYLOAD,
39000         -
            ) {
39001         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
39002         -
            }
39003         -
            crate::protocol_serde::shape_http_enum_payload::de_http_enum_payload_http_request(
39004         -
                request,
39005         -
            )
39006         -
            .await
39007         -
            .map_err(Into::into)
39008         -
        };
39009         -
        use ::futures_util::future::TryFutureExt;
39010         -
        let fut = fut.map_err(
39011         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
39012         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
39013         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
39014         -
                    e,
39015         -
                )
39016         -
            },
39017         -
        );
39018         -
        HttpEnumPayloadInputFuture {
39019         -
            inner: Box::pin(fut),
39020         -
        }
39021         -
    }
39022         -
}
39023         -
impl
39024         -
    ::aws_smithy_http_server::response::IntoResponse<
39025         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
39026         -
    > for crate::output::HttpEnumPayloadOutput
39027         -
{
39028         -
    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         -
        ) {
39032         -
            Ok(response) => response,
39033         -
            Err(e) => {
39034         -
                ::tracing::error!(error = %e, "failed to serialize response");
39035         -
                ::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         -
            }
39037         -
        }
39038         -
    }
39039         -
}
39040         -
impl
39041         -
    ::aws_smithy_http_server::response::IntoResponse<
39042         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
39043         -
    > for crate::error::HttpEnumPayloadError
39044         -
{
39045         -
    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         -
        ) {
39049         -
            Ok(mut response) => {
39050         -
                response.extensions_mut().insert(
39051         -
                    ::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()),
39052         -
                );
39053         -
                response
39054         -
            }
39055         -
            Err(e) => {
39056         -
                ::tracing::error!(error = %e, "failed to serialize response");
39057         -
                ::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))
       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  +
                ,
39058  37552   
            }
39059         -
        }
39060         -
    }
39061         -
}
39062         -
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         -
    >;
39077         -
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)
39084         -
    }
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);
       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 {
39110  37579   
            }
39111         -
            crate::protocol_serde::shape_http_payload_with_structure::de_http_payload_with_structure_http_request(request)
39112         -
                            .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         -
            },
       37580  +
        ;
       37581  +
        Ok(response) };
       37582  +
                                sender.send(()).await.expect("receiver dropped early");
       37583  +
                                result
       37584  +
                            }
       37585  +
                        })
       37586  +
                        .build_unchecked();
       37587  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       37588  +
            .await
       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"
39123  37593   
        );
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         -
                        }
39141         -
                    }
39142         -
    }
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  37594   
    }
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);
       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
       37652  +
                        }
       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  +
                ,
39197  37709   
            }
39198         -
            crate::protocol_serde::shape_http_payload_traits_with_media_type::de_http_payload_traits_with_media_type_http_request(request)
39199         -
                            .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         -
            },
       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 {
       37736  +
            }
       37737  +
        ;
       37738  +
        Ok(response) };
       37739  +
                                sender.send(()).await.expect("receiver dropped early");
       37740  +
                                result
       37741  +
                            }
       37742  +
                        })
       37743  +
                        .build_unchecked();
       37744  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       37745  +
            .await
       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"
39210  37750   
        );
39211         -
        HttpPayloadTraitsWithMediaTypeInputFuture {
39212         -
            inner: Box::pin(fut),
39213         -
        }
39214  37751   
    }
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))
       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")
       37781  +
                    )
       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  +
                                ]
       37799  +
                            );
       37800  +
                            ret.insert(
       37801  +
                                "Double".to_owned()
       37802  +
                                ,
       37803  +
                                vec![
       37804  +
                                    "-Infinity".to_owned()
       37805  +
                                    ,
       37806  +
                                ]
       37807  +
                            );
       37808  +
                            ret
39227  37809   
                        }
39228         -
                    }
39229         -
    }
39230         -
}
39231         -
39232         -
::pin_project_lite::pin_project! {
39233         -
    /// 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>>
39237         -
    }
39238         -
}
39239         -
39240         -
impl std::future::Future for HttpPayloadTraitsInputFuture {
39241         -
    type Output = Result<
39242         -
        crate::input::HttpPayloadTraitsInput,
39243         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
39244         -
    >;
39245         -
39246         -
    fn poll(
39247         -
        self: std::pin::Pin<&mut Self>,
39248         -
        cx: &mut std::task::Context<'_>,
39249         -
    ) -> std::task::Poll<Self::Output> {
39250         -
        let this = self.project();
39251         -
        this.inner.as_mut().poll(cx)
39252         -
    }
39253         -
}
39254         -
39255         -
impl<B>
39256         -
    ::aws_smithy_http_server::request::FromRequest<
39257         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
39258         -
        B,
39259         -
    > for crate::input::HttpPayloadTraitsInput
39260         -
where
39261         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
39262         -
    B: 'static,
39263         -
39264         -
    B::Data: Send,
39265         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
39266         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
39267         -
{
39268         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
39269         -
    type Future = HttpPayloadTraitsInputFuture;
39270         -
39271         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
39272         -
        let fut = async move {
39273         -
            crate::protocol_serde::shape_http_payload_traits::de_http_payload_traits_http_request(
39274         -
                request,
39275         -
            )
       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  +
                ,
       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 {
       37893  +
            }
       37894  +
        ;
       37895  +
        Ok(response) };
       37896  +
                                sender.send(()).await.expect("receiver dropped early");
       37897  +
                                result
       37898  +
                            }
       37899  +
                        })
       37900  +
                        .build_unchecked();
       37901  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
39276  37902   
            .await
39277         -
            .map_err(Into::into)
39278         -
        };
39279         -
        use ::futures_util::future::TryFutureExt;
39280         -
        let fut = fut.map_err(
39281         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
39282         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
39283         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
39284         -
                    e,
39285         -
                )
39286         -
            },
       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"
39287  37907   
        );
39288         -
        HttpPayloadTraitsInputFuture {
39289         -
            inner: Box::pin(fut),
39290         -
        }
39291  37908   
    }
39292         -
}
39293         -
impl
39294         -
    ::aws_smithy_http_server::response::IntoResponse<
39295         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
39296         -
    > for crate::output::HttpPayloadTraitsOutput
39297         -
{
39298         -
    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) {
39300         -
                        Ok(response) => response,
39301         -
                        Err(e) => {
39302         -
                            ::tracing::error!(error = %e, "failed to serialize response");
39303         -
                            ::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         -
                        }
39305         -
                    }
       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
       38074  +
                }
       38075  +
            })
       38076  +
            .build_unchecked();
       38077  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       38078  +
            .await
       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"
       38083  +
        );
39306  38084   
    }
39307  38085   
}
39308  38086   
39309         -
const CONTENT_TYPE_HTTPPREFIXHEADERSINRESPONSE: ::mime::Mime = ::mime::APPLICATION_JSON;
       38087  +
const CONTENT_TYPE_HTTPREQUESTWITHREGEXLITERAL: ::mime::Mime = ::mime::APPLICATION_JSON;
39310  38088   
::pin_project_lite::pin_project! {
39311  38089   
    /// 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>>
       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>>
39315  38093   
    }
39316  38094   
}
39317  38095   
39318         -
impl std::future::Future for HttpPrefixHeadersInResponseInputFuture {
       38096  +
impl std::future::Future for HttpRequestWithRegexLiteralInputFuture {
39319  38097   
    type Output = Result<
39320         -
        crate::input::HttpPrefixHeadersInResponseInput,
       38098  +
        crate::input::HttpRequestWithRegexLiteralInput,
39321  38099   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
39322  38100   
    >;
39323  38101   
39324  38102   
    fn poll(
39325  38103   
        self: std::pin::Pin<&mut Self>,
39326  38104   
        cx: &mut std::task::Context<'_>,
39327  38105   
    ) -> std::task::Poll<Self::Output> {
39328  38106   
        let this = self.project();
39329  38107   
        this.inner.as_mut().poll(cx)
39330  38108   
    }
39331  38109   
}
39332  38110   
39333  38111   
impl<B>
39334  38112   
    ::aws_smithy_http_server::request::FromRequest<
39335  38113   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
39336  38114   
        B,
39337         -
    > for crate::input::HttpPrefixHeadersInResponseInput
       38115  +
    > for crate::input::HttpRequestWithRegexLiteralInput
39338  38116   
where
39339  38117   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
39340  38118   
    B: 'static,
39341  38119   
39342  38120   
    B::Data: Send,
39343  38121   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
39344  38122   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
39345  38123   
{
39346  38124   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
39347         -
    type Future = HttpPrefixHeadersInResponseInputFuture;
       38125  +
    type Future = HttpRequestWithRegexLiteralInputFuture;
39348  38126   
39349  38127   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
39350  38128   
        let fut = async move {
39351  38129   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
39352  38130   
                request.headers(),
39353         -
                &CONTENT_TYPE_HTTPPREFIXHEADERSINRESPONSE,
       38131  +
                &CONTENT_TYPE_HTTPREQUESTWITHREGEXLITERAL,
39354  38132   
            ) {
39355  38133   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
39356  38134   
            }
39357         -
            crate::protocol_serde::shape_http_prefix_headers_in_response::de_http_prefix_headers_in_response_http_request(request)
       38135  +
            crate::protocol_serde::shape_http_request_with_regex_literal::de_http_request_with_regex_literal_http_request(request)
39358  38136   
                            .await
39359  38137   
                            .map_err(Into::into)
39360  38138   
        };
39361  38139   
        use ::futures_util::future::TryFutureExt;
39362  38140   
        let fut = fut.map_err(
39363  38141   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
39364  38142   
                ::tracing::debug!(error = %e, "failed to deserialize request");
39365  38143   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
39366  38144   
                    e,
39367  38145   
                )
39368  38146   
            },
39369  38147   
        );
39370         -
        HttpPrefixHeadersInResponseInputFuture {
       38148  +
        HttpRequestWithRegexLiteralInputFuture {
39371  38149   
            inner: Box::pin(fut),
39372  38150   
        }
39373  38151   
    }
39374  38152   
}
39375  38153   
impl
39376  38154   
    ::aws_smithy_http_server::response::IntoResponse<
39377  38155   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
39378         -
    > for crate::output::HttpPrefixHeadersInResponseOutput
       38156  +
    > for crate::output::HttpRequestWithRegexLiteralOutput
39379  38157   
{
39380  38158   
    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) {
       38159  +
        match crate::protocol_serde::shape_http_request_with_regex_literal::ser_http_request_with_regex_literal_http_response(self) {
39382  38160   
                        Ok(response) => response,
39383  38161   
                        Err(e) => {
39384  38162   
                            ::tracing::error!(error = %e, "failed to serialize response");
39385  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))
39386  38164   
                        }
39387  38165   
                    }
39388  38166   
    }
39389  38167   
}
       38168  +
impl
       38169  +
    ::aws_smithy_http_server::response::IntoResponse<
       38170  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       38171  +
    > for crate::error::HttpRequestWithRegexLiteralError
       38172  +
{
       38173  +
    fn into_response(self) -> ::aws_smithy_http_server::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  +
            },
       38179  +
            Err(e) => {
       38180  +
                ::tracing::error!(error = %e, "failed to serialize response");
       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))
       38182  +
            }
       38183  +
        }
       38184  +
    }
       38185  +
}
39390  38186   
39391         -
const CONTENT_TYPE_HTTPPREFIXHEADERS: ::mime::Mime = ::mime::APPLICATION_JSON;
       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;
39392  38237   
::pin_project_lite::pin_project! {
39393  38238   
    /// 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>>
       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>>
39397  38242   
    }
39398  38243   
}
39399  38244   
39400         -
impl std::future::Future for HttpPrefixHeadersInputFuture {
       38245  +
impl std::future::Future for HttpRequestWithFloatLabelsInputFuture {
39401  38246   
    type Output = Result<
39402         -
        crate::input::HttpPrefixHeadersInput,
       38247  +
        crate::input::HttpRequestWithFloatLabelsInput,
39403  38248   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
39404  38249   
    >;
39405  38250   
39406  38251   
    fn poll(
39407  38252   
        self: std::pin::Pin<&mut Self>,
39408  38253   
        cx: &mut std::task::Context<'_>,
39409  38254   
    ) -> std::task::Poll<Self::Output> {
39410  38255   
        let this = self.project();
39411  38256   
        this.inner.as_mut().poll(cx)
39412  38257   
    }
39413  38258   
}
39414  38259   
39415  38260   
impl<B>
39416  38261   
    ::aws_smithy_http_server::request::FromRequest<
39417  38262   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
39418  38263   
        B,
39419         -
    > for crate::input::HttpPrefixHeadersInput
       38264  +
    > for crate::input::HttpRequestWithFloatLabelsInput
39420  38265   
where
39421  38266   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
39422  38267   
    B: 'static,
39423  38268   
39424  38269   
    B::Data: Send,
39425  38270   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
39426  38271   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
39427  38272   
{
39428  38273   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
39429         -
    type Future = HttpPrefixHeadersInputFuture;
       38274  +
    type Future = HttpRequestWithFloatLabelsInputFuture;
39430  38275   
39431  38276   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
39432  38277   
        let fut = async move {
39433  38278   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
39434  38279   
                request.headers(),
39435         -
                &CONTENT_TYPE_HTTPPREFIXHEADERS,
       38280  +
                &CONTENT_TYPE_HTTPREQUESTWITHFLOATLABELS,
39436  38281   
            ) {
39437  38282   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
39438  38283   
            }
39439         -
            crate::protocol_serde::shape_http_prefix_headers::de_http_prefix_headers_http_request(
39440         -
                request,
39441         -
            )
39442         -
            .await
39443         -
            .map_err(Into::into)
       38284  +
            crate::protocol_serde::shape_http_request_with_float_labels::de_http_request_with_float_labels_http_request(request)
       38285  +
                            .await
       38286  +
                            .map_err(Into::into)
39444  38287   
        };
39445  38288   
        use ::futures_util::future::TryFutureExt;
39446  38289   
        let fut = fut.map_err(
39447  38290   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
39448  38291   
                ::tracing::debug!(error = %e, "failed to deserialize request");
39449  38292   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
39450  38293   
                    e,
39451  38294   
                )
39452  38295   
            },
39453  38296   
        );
39454         -
        HttpPrefixHeadersInputFuture {
       38297  +
        HttpRequestWithFloatLabelsInputFuture {
39455  38298   
            inner: Box::pin(fut),
39456  38299   
        }
39457  38300   
    }
39458  38301   
}
39459  38302   
impl
39460  38303   
    ::aws_smithy_http_server::response::IntoResponse<
39461  38304   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
39462         -
    > for crate::output::HttpPrefixHeadersOutput
       38305  +
    > for crate::output::HttpRequestWithFloatLabelsOutput
39463  38306   
{
39464  38307   
    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) {
       38308  +
        match crate::protocol_serde::shape_http_request_with_float_labels::ser_http_request_with_float_labels_http_response(self) {
39466  38309   
                        Ok(response) => response,
39467  38310   
                        Err(e) => {
39468  38311   
                            ::tracing::error!(error = %e, "failed to serialize response");
39469  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))
39470  38313   
                        }
39471  38314   
                    }
39472  38315   
    }
39473  38316   
}
       38317  +
impl
       38318  +
    ::aws_smithy_http_server::response::IntoResponse<
       38319  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       38320  +
    > for crate::error::HttpRequestWithFloatLabelsError
       38321  +
{
       38322  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
       38323  +
        match crate::protocol_serde::shape_http_request_with_float_labels::ser_http_request_with_float_labels_http_error(&self) {
       38324  +
            Ok(mut response) => {
       38325  +
                response.extensions_mut().insert(::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()));
       38326  +
                response
       38327  +
            },
       38328  +
            Err(e) => {
       38329  +
                ::tracing::error!(error = %e, "failed to serialize response");
       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))
       38331  +
            }
       38332  +
        }
       38333  +
    }
       38334  +
}
39474  38335   
39475         -
const CONTENT_TYPE_QUERYPARAMSASSTRINGLISTMAP: ::mime::Mime = ::mime::APPLICATION_JSON;
       38336  +
#[allow(unreachable_code, unused_variables)]
       38337  +
#[cfg(test)]
       38338  +
mod http_request_with_float_labels_test {
       38339  +
       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  +
                ,
       38369  +
            }
       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 {
       38377  +
            }
       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)
       38386  +
            .await
       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"
       38391  +
        );
       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  +
                ,
       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 {
       38430  +
            }
       38431  +
        ;
       38432  +
        Ok(response) };
       38433  +
                                sender.send(()).await.expect("receiver dropped early");
       38434  +
                                result
       38435  +
                            }
       38436  +
                        })
       38437  +
                        .build_unchecked();
       38438  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       38439  +
            .await
       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"
       38444  +
        );
       38445  +
    }
       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  +
                ,
       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
       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  +
        );
       38498  +
    }
       38499  +
}
       38500  +
       38501  +
const CONTENT_TYPE_HTTPREQUESTWITHGREEDYLABELINPATH: ::mime::Mime = ::mime::APPLICATION_JSON;
39476  38502   
::pin_project_lite::pin_project! {
39477  38503   
    /// 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>>
       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>>
39481  38507   
    }
39482  38508   
}
39483  38509   
39484         -
impl std::future::Future for QueryParamsAsStringListMapInputFuture {
       38510  +
impl std::future::Future for HttpRequestWithGreedyLabelInPathInputFuture {
39485  38511   
    type Output = Result<
39486         -
        crate::input::QueryParamsAsStringListMapInput,
       38512  +
        crate::input::HttpRequestWithGreedyLabelInPathInput,
39487  38513   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
39488  38514   
    >;
39489  38515   
39490  38516   
    fn poll(
39491  38517   
        self: std::pin::Pin<&mut Self>,
39492  38518   
        cx: &mut std::task::Context<'_>,
39493  38519   
    ) -> std::task::Poll<Self::Output> {
39494  38520   
        let this = self.project();
39495  38521   
        this.inner.as_mut().poll(cx)
39496  38522   
    }
39497  38523   
}
39498  38524   
39499  38525   
impl<B>
39500  38526   
    ::aws_smithy_http_server::request::FromRequest<
39501  38527   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
39502  38528   
        B,
39503         -
    > for crate::input::QueryParamsAsStringListMapInput
       38529  +
    > for crate::input::HttpRequestWithGreedyLabelInPathInput
39504  38530   
where
39505  38531   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
39506  38532   
    B: 'static,
39507  38533   
39508  38534   
    B::Data: Send,
39509  38535   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
39510  38536   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
39511  38537   
{
39512  38538   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
39513         -
    type Future = QueryParamsAsStringListMapInputFuture;
       38539  +
    type Future = HttpRequestWithGreedyLabelInPathInputFuture;
39514  38540   
39515  38541   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
39516  38542   
        let fut = async move {
39517  38543   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
39518  38544   
                request.headers(),
39519         -
                &CONTENT_TYPE_QUERYPARAMSASSTRINGLISTMAP,
       38545  +
                &CONTENT_TYPE_HTTPREQUESTWITHGREEDYLABELINPATH,
39520  38546   
            ) {
39521  38547   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
39522  38548   
            }
39523         -
            crate::protocol_serde::shape_query_params_as_string_list_map::de_query_params_as_string_list_map_http_request(request)
       38549  +
            crate::protocol_serde::shape_http_request_with_greedy_label_in_path::de_http_request_with_greedy_label_in_path_http_request(request)
39524  38550   
                            .await
39525  38551   
                            .map_err(Into::into)
39526  38552   
        };
39527  38553   
        use ::futures_util::future::TryFutureExt;
39528  38554   
        let fut = fut.map_err(
39529  38555   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
39530  38556   
                ::tracing::debug!(error = %e, "failed to deserialize request");
39531  38557   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
39532  38558   
                    e,
39533  38559   
                )
39534  38560   
            },
39535  38561   
        );
39536         -
        QueryParamsAsStringListMapInputFuture {
       38562  +
        HttpRequestWithGreedyLabelInPathInputFuture {
39537  38563   
            inner: Box::pin(fut),
39538  38564   
        }
39539  38565   
    }
39540  38566   
}
39541  38567   
impl
39542  38568   
    ::aws_smithy_http_server::response::IntoResponse<
39543  38569   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
39544         -
    > for crate::output::QueryParamsAsStringListMapOutput
       38570  +
    > for crate::output::HttpRequestWithGreedyLabelInPathOutput
39545  38571   
{
39546  38572   
    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) {
       38573  +
        match crate::protocol_serde::shape_http_request_with_greedy_label_in_path::ser_http_request_with_greedy_label_in_path_http_response(self) {
39548  38574   
                        Ok(response) => response,
39549  38575   
                        Err(e) => {
39550  38576   
                            ::tracing::error!(error = %e, "failed to serialize response");
39551  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))
39552  38578   
                        }
39553  38579   
                    }
39554  38580   
    }
39555  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  +
}
39556  38600   
39557         -
const CONTENT_TYPE_QUERYPRECEDENCE: ::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;
39558  38652   
::pin_project_lite::pin_project! {
39559  38653   
    /// 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>>
       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>>
39563  38657   
    }
39564  38658   
}
39565  38659   
39566         -
impl std::future::Future for QueryPrecedenceInputFuture {
       38660  +
impl std::future::Future for HttpRequestWithLabelsAndTimestampFormatInputFuture {
39567  38661   
    type Output = Result<
39568         -
        crate::input::QueryPrecedenceInput,
       38662  +
        crate::input::HttpRequestWithLabelsAndTimestampFormatInput,
39569  38663   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
39570  38664   
    >;
39571  38665   
39572  38666   
    fn poll(
39573  38667   
        self: std::pin::Pin<&mut Self>,
39574  38668   
        cx: &mut std::task::Context<'_>,
39575  38669   
    ) -> std::task::Poll<Self::Output> {
39576  38670   
        let this = self.project();
39577  38671   
        this.inner.as_mut().poll(cx)
39578  38672   
    }
39579  38673   
}
39580  38674   
39581  38675   
impl<B>
39582  38676   
    ::aws_smithy_http_server::request::FromRequest<
39583  38677   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
39584  38678   
        B,
39585         -
    > for crate::input::QueryPrecedenceInput
       38679  +
    > for crate::input::HttpRequestWithLabelsAndTimestampFormatInput
39586  38680   
where
39587  38681   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
39588  38682   
    B: 'static,
39589  38683   
39590  38684   
    B::Data: Send,
39591  38685   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
39592  38686   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
39593  38687   
{
39594  38688   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
39595         -
    type Future = QueryPrecedenceInputFuture;
       38689  +
    type Future = HttpRequestWithLabelsAndTimestampFormatInputFuture;
39596  38690   
39597  38691   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
39598  38692   
        let fut = async move {
39599  38693   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
39600  38694   
                request.headers(),
39601         -
                &CONTENT_TYPE_QUERYPRECEDENCE,
       38695  +
                &CONTENT_TYPE_HTTPREQUESTWITHLABELSANDTIMESTAMPFORMAT,
39602  38696   
            ) {
39603  38697   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
39604  38698   
            }
39605         -
            crate::protocol_serde::shape_query_precedence::de_query_precedence_http_request(request)
39606         -
                .await
39607         -
                .map_err(Into::into)
       38699  +
            crate::protocol_serde::shape_http_request_with_labels_and_timestamp_format::de_http_request_with_labels_and_timestamp_format_http_request(request)
       38700  +
                            .await
       38701  +
                            .map_err(Into::into)
39608  38702   
        };
39609  38703   
        use ::futures_util::future::TryFutureExt;
39610  38704   
        let fut = fut.map_err(
39611  38705   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
39612  38706   
                ::tracing::debug!(error = %e, "failed to deserialize request");
39613  38707   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
39614  38708   
                    e,
39615  38709   
                )
39616  38710   
            },
39617  38711   
        );
39618         -
        QueryPrecedenceInputFuture {
       38712  +
        HttpRequestWithLabelsAndTimestampFormatInputFuture {
39619  38713   
            inner: Box::pin(fut),
39620  38714   
        }
39621  38715   
    }
39622  38716   
}
39623  38717   
impl
39624  38718   
    ::aws_smithy_http_server::response::IntoResponse<
39625  38719   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
39626         -
    > for crate::output::QueryPrecedenceOutput
       38720  +
    > for crate::output::HttpRequestWithLabelsAndTimestampFormatOutput
39627  38721   
{
39628  38722   
    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         -
        ) {
39632         -
            Ok(response) => response,
       38723  +
        match crate::protocol_serde::shape_http_request_with_labels_and_timestamp_format::ser_http_request_with_labels_and_timestamp_format_http_response(self) {
       38724  +
                        Ok(response) => response,
       38725  +
                        Err(e) => {
       38726  +
                            ::tracing::error!(error = %e, "failed to serialize response");
       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))
       38728  +
                        }
       38729  +
                    }
       38730  +
    }
       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  +
            },
39633  38743   
            Err(e) => {
39634  38744   
                ::tracing::error!(error = %e, "failed to serialize response");
39635  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))
39636  38746   
            }
39637  38747   
        }
39638  38748   
    }
39639  38749   
}
39640  38750   
39641         -
const CONTENT_TYPE_QUERYIDEMPOTENCYTOKENAUTOFILL: ::mime::Mime = ::mime::APPLICATION_JSON;
39642         -
::pin_project_lite::pin_project! {
39643         -
    /// 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>>
39647         -
    }
39648         -
}
39649         -
39650         -
impl std::future::Future for QueryIdempotencyTokenAutoFillInputFuture {
39651         -
    type Output = Result<
39652         -
        crate::input::QueryIdempotencyTokenAutoFillInput,
39653         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
39654         -
    >;
39655         -
39656         -
    fn poll(
39657         -
        self: std::pin::Pin<&mut Self>,
39658         -
        cx: &mut std::task::Context<'_>,
39659         -
    ) -> std::task::Poll<Self::Output> {
39660         -
        let this = self.project();
39661         -
        this.inner.as_mut().poll(cx)
39662         -
    }
39663         -
}
39664         -
39665         -
impl<B>
39666         -
    ::aws_smithy_http_server::request::FromRequest<
39667         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
39668         -
        B,
39669         -
    > for crate::input::QueryIdempotencyTokenAutoFillInput
39670         -
where
39671         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
39672         -
    B: 'static,
39673         -
39674         -
    B::Data: Send,
39675         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
39676         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
39677         -
{
39678         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
39679         -
    type Future = QueryIdempotencyTokenAutoFillInputFuture;
       38751  +
#[allow(unreachable_code, unused_variables)]
       38752  +
#[cfg(test)]
       38753  +
mod http_request_with_labels_and_timestamp_format_test {
39680  38754   
39681         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
39682         -
        let fut = async move {
39683         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
39684         -
                request.headers(),
39685         -
                &CONTENT_TYPE_QUERYIDEMPOTENCYTOKENAUTOFILL,
39686         -
            ) {
39687         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
       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  +
                ,
39688  38799   
            }
39689         -
            crate::protocol_serde::shape_query_idempotency_token_auto_fill::de_query_idempotency_token_auto_fill_http_request(request)
39690         -
                            .await
39691         -
                            .map_err(Into::into)
39692         -
        };
39693         -
        use ::futures_util::future::TryFutureExt;
39694         -
        let fut = fut.map_err(
39695         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
39696         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
39697         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
39698         -
                    e,
       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  +
                    },
39699  38812   
                )
39700         -
            },
       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"
39701  38820   
        );
39702         -
        QueryIdempotencyTokenAutoFillInputFuture {
39703         -
            inner: Box::pin(fut),
39704         -
        }
39705         -
    }
39706         -
}
39707         -
impl
39708         -
    ::aws_smithy_http_server::response::IntoResponse<
39709         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
39710         -
    > for crate::output::QueryIdempotencyTokenAutoFillOutput
39711         -
{
39712         -
    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) {
39714         -
                        Ok(response) => response,
39715         -
                        Err(e) => {
39716         -
                            ::tracing::error!(error = %e, "failed to serialize response");
39717         -
                            ::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         -
                        }
39719         -
                    }
39720  38821   
    }
39721  38822   
}
39722  38823   
39723         -
const CONTENT_TYPE_OMITSSERIALIZINGEMPTYLISTS: ::mime::Mime = ::mime::APPLICATION_JSON;
       38824  +
const CONTENT_TYPE_HTTPREQUESTWITHLABELS: ::mime::Mime = ::mime::APPLICATION_JSON;
39724  38825   
::pin_project_lite::pin_project! {
39725  38826   
    /// 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>>
       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>>
39729  38830   
    }
39730  38831   
}
39731  38832   
39732         -
impl std::future::Future for OmitsSerializingEmptyListsInputFuture {
       38833  +
impl std::future::Future for HttpRequestWithLabelsInputFuture {
39733  38834   
    type Output = Result<
39734         -
        crate::input::OmitsSerializingEmptyListsInput,
       38835  +
        crate::input::HttpRequestWithLabelsInput,
39735  38836   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
39736  38837   
    >;
39737  38838   
39738  38839   
    fn poll(
39739  38840   
        self: std::pin::Pin<&mut Self>,
39740  38841   
        cx: &mut std::task::Context<'_>,
39741  38842   
    ) -> std::task::Poll<Self::Output> {
39742  38843   
        let this = self.project();
39743  38844   
        this.inner.as_mut().poll(cx)
39744  38845   
    }
39745  38846   
}
39746  38847   
39747  38848   
impl<B>
39748  38849   
    ::aws_smithy_http_server::request::FromRequest<
39749  38850   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
39750  38851   
        B,
39751         -
    > for crate::input::OmitsSerializingEmptyListsInput
       38852  +
    > for crate::input::HttpRequestWithLabelsInput
39752  38853   
where
39753  38854   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
39754  38855   
    B: 'static,
39755  38856   
39756  38857   
    B::Data: Send,
39757  38858   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
39758  38859   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
39759  38860   
{
39760  38861   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
39761         -
    type Future = OmitsSerializingEmptyListsInputFuture;
       38862  +
    type Future = HttpRequestWithLabelsInputFuture;
39762  38863   
39763  38864   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
39764  38865   
        let fut = async move {
39765  38866   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
39766  38867   
                request.headers(),
39767         -
                &CONTENT_TYPE_OMITSSERIALIZINGEMPTYLISTS,
       38868  +
                &CONTENT_TYPE_HTTPREQUESTWITHLABELS,
39768  38869   
            ) {
39769  38870   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
39770  38871   
            }
39771         -
            crate::protocol_serde::shape_omits_serializing_empty_lists::de_omits_serializing_empty_lists_http_request(request)
       38872  +
            crate::protocol_serde::shape_http_request_with_labels::de_http_request_with_labels_http_request(request)
39772  38873   
                            .await
39773  38874   
                            .map_err(Into::into)
39774  38875   
        };
39775  38876   
        use ::futures_util::future::TryFutureExt;
39776  38877   
        let fut = fut.map_err(
39777  38878   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
39778  38879   
                ::tracing::debug!(error = %e, "failed to deserialize request");
39779  38880   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
39780  38881   
                    e,
39781  38882   
                )
39782  38883   
            },
39783  38884   
        );
39784         -
        OmitsSerializingEmptyListsInputFuture {
       38885  +
        HttpRequestWithLabelsInputFuture {
39785  38886   
            inner: Box::pin(fut),
39786  38887   
        }
39787  38888   
    }
39788  38889   
}
39789  38890   
impl
39790  38891   
    ::aws_smithy_http_server::response::IntoResponse<
39791  38892   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
39792         -
    > for crate::output::OmitsSerializingEmptyListsOutput
       38893  +
    > for crate::output::HttpRequestWithLabelsOutput
39793  38894   
{
39794  38895   
    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) {
       38896  +
        match crate::protocol_serde::shape_http_request_with_labels::ser_http_request_with_labels_http_response(self) {
39796  38897   
                        Ok(response) => response,
39797  38898   
                        Err(e) => {
39798  38899   
                            ::tracing::error!(error = %e, "failed to serialize response");
39799  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))
39800  38901   
                        }
39801  38902   
                    }
39802  38903   
    }
39803  38904   
}
39804  38905   
impl
39805  38906   
    ::aws_smithy_http_server::response::IntoResponse<
39806  38907   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
39807         -
    > for crate::error::OmitsSerializingEmptyListsError
       38908  +
    > for crate::error::HttpRequestWithLabelsError
39808  38909   
{
39809  38910   
    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) {
       38911  +
        match crate::protocol_serde::shape_http_request_with_labels::ser_http_request_with_labels_http_error(&self) {
39811  38912   
            Ok(mut response) => {
39812  38913   
                response.extensions_mut().insert(::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()));
39813  38914   
                response
39814  38915   
            },
39815  38916   
            Err(e) => {
39816  38917   
                ::tracing::error!(error = %e, "failed to serialize response");
39817  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))
39818  38919   
            }
39819  38920   
        }
39820  38921   
    }
39821  38922   
}
39822  38923   
39823         -
const CONTENT_TYPE_OMITSNULLSERIALIZESEMPTYSTRING: ::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;
39824  39112   
::pin_project_lite::pin_project! {
39825  39113   
    /// 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>>
       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>>
39829  39117   
    }
39830  39118   
}
39831  39119   
39832         -
impl std::future::Future for OmitsNullSerializesEmptyStringInputFuture {
       39120  +
impl std::future::Future for MediaTypeHeaderInputFuture {
39833  39121   
    type Output = Result<
39834         -
        crate::input::OmitsNullSerializesEmptyStringInput,
       39122  +
        crate::input::MediaTypeHeaderInput,
39835  39123   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
39836  39124   
    >;
39837  39125   
39838  39126   
    fn poll(
39839  39127   
        self: std::pin::Pin<&mut Self>,
39840  39128   
        cx: &mut std::task::Context<'_>,
39841  39129   
    ) -> std::task::Poll<Self::Output> {
39842  39130   
        let this = self.project();
39843  39131   
        this.inner.as_mut().poll(cx)
39844  39132   
    }
39845  39133   
}
39846  39134   
39847  39135   
impl<B>
39848  39136   
    ::aws_smithy_http_server::request::FromRequest<
39849  39137   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
39850  39138   
        B,
39851         -
    > for crate::input::OmitsNullSerializesEmptyStringInput
       39139  +
    > for crate::input::MediaTypeHeaderInput
39852  39140   
where
39853  39141   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
39854  39142   
    B: 'static,
39855  39143   
39856  39144   
    B::Data: Send,
39857  39145   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
39858  39146   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
39859  39147   
{
39860  39148   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
39861         -
    type Future = OmitsNullSerializesEmptyStringInputFuture;
       39149  +
    type Future = MediaTypeHeaderInputFuture;
39862  39150   
39863  39151   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
39864  39152   
        let fut = async move {
39865  39153   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
39866  39154   
                request.headers(),
39867         -
                &CONTENT_TYPE_OMITSNULLSERIALIZESEMPTYSTRING,
       39155  +
                &CONTENT_TYPE_MEDIATYPEHEADER,
39868  39156   
            ) {
39869  39157   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
39870  39158   
            }
39871         -
            crate::protocol_serde::shape_omits_null_serializes_empty_string::de_omits_null_serializes_empty_string_http_request(request)
39872         -
                            .await
39873         -
                            .map_err(Into::into)
       39159  +
            crate::protocol_serde::shape_media_type_header::de_media_type_header_http_request(
       39160  +
                request,
       39161  +
            )
       39162  +
            .await
       39163  +
            .map_err(Into::into)
39874  39164   
        };
39875  39165   
        use ::futures_util::future::TryFutureExt;
39876  39166   
        let fut = fut.map_err(
39877  39167   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
39878  39168   
                ::tracing::debug!(error = %e, "failed to deserialize request");
39879  39169   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
39880  39170   
                    e,
39881  39171   
                )
39882  39172   
            },
39883  39173   
        );
39884         -
        OmitsNullSerializesEmptyStringInputFuture {
       39174  +
        MediaTypeHeaderInputFuture {
39885  39175   
            inner: Box::pin(fut),
39886  39176   
        }
39887  39177   
    }
39888  39178   
}
39889  39179   
impl
39890  39180   
    ::aws_smithy_http_server::response::IntoResponse<
39891  39181   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
39892         -
    > for crate::output::OmitsNullSerializesEmptyStringOutput
       39182  +
    > for crate::output::MediaTypeHeaderOutput
39893  39183   
{
39894  39184   
    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) {
39896         -
                        Ok(response) => response,
39897         -
                        Err(e) => {
39898         -
                            ::tracing::error!(error = %e, "failed to serialize response");
39899         -
                            ::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         -
                        }
39901         -
                    }
       39185  +
        match crate::protocol_serde::shape_media_type_header::ser_media_type_header_http_response(
       39186  +
            self,
       39187  +
        ) {
       39188  +
            Ok(response) => response,
       39189  +
            Err(e) => {
       39190  +
                ::tracing::error!(error = %e, "failed to serialize response");
       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))
       39192  +
            }
       39193  +
        }
39902  39194   
    }
39903  39195   
}
39904  39196   
39905         -
const CONTENT_TYPE_IGNOREQUERYPARAMSINRESPONSE: ::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;
39906  39268   
::pin_project_lite::pin_project! {
39907  39269   
    /// 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>>
       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>>
39911  39273   
    }
39912  39274   
}
39913  39275   
39914         -
impl std::future::Future for IgnoreQueryParamsInResponseInputFuture {
       39276  +
impl std::future::Future for TimestampFormatHeadersInputFuture {
39915  39277   
    type Output = Result<
39916         -
        crate::input::IgnoreQueryParamsInResponseInput,
       39278  +
        crate::input::TimestampFormatHeadersInput,
39917  39279   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
39918  39280   
    >;
39919  39281   
39920  39282   
    fn poll(
39921  39283   
        self: std::pin::Pin<&mut Self>,
39922  39284   
        cx: &mut std::task::Context<'_>,
39923  39285   
    ) -> std::task::Poll<Self::Output> {
39924  39286   
        let this = self.project();
39925  39287   
        this.inner.as_mut().poll(cx)
39926  39288   
    }
39927  39289   
}
39928  39290   
39929  39291   
impl<B>
39930  39292   
    ::aws_smithy_http_server::request::FromRequest<
39931  39293   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
39932  39294   
        B,
39933         -
    > for crate::input::IgnoreQueryParamsInResponseInput
       39295  +
    > for crate::input::TimestampFormatHeadersInput
39934  39296   
where
39935  39297   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
39936  39298   
    B: 'static,
39937  39299   
39938  39300   
    B::Data: Send,
39939  39301   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
39940  39302   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
39941  39303   
{
39942  39304   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
39943         -
    type Future = IgnoreQueryParamsInResponseInputFuture;
       39305  +
    type Future = TimestampFormatHeadersInputFuture;
39944  39306   
39945  39307   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
39946  39308   
        let fut = async move {
39947  39309   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
39948  39310   
                request.headers(),
39949         -
                &CONTENT_TYPE_IGNOREQUERYPARAMSINRESPONSE,
       39311  +
                &CONTENT_TYPE_TIMESTAMPFORMATHEADERS,
39950  39312   
            ) {
39951  39313   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
39952  39314   
            }
39953         -
            crate::protocol_serde::shape_ignore_query_params_in_response::de_ignore_query_params_in_response_http_request(request)
       39315  +
            crate::protocol_serde::shape_timestamp_format_headers::de_timestamp_format_headers_http_request(request)
39954  39316   
                            .await
39955  39317   
                            .map_err(Into::into)
39956  39318   
        };
39957  39319   
        use ::futures_util::future::TryFutureExt;
39958  39320   
        let fut = fut.map_err(
39959  39321   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
39960  39322   
                ::tracing::debug!(error = %e, "failed to deserialize request");
39961  39323   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
39962  39324   
                    e,
39963  39325   
                )
39964  39326   
            },
39965  39327   
        );
39966         -
        IgnoreQueryParamsInResponseInputFuture {
       39328  +
        TimestampFormatHeadersInputFuture {
39967  39329   
            inner: Box::pin(fut),
39968  39330   
        }
39969  39331   
    }
39970  39332   
}
39971  39333   
impl
39972  39334   
    ::aws_smithy_http_server::response::IntoResponse<
39973  39335   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
39974         -
    > for crate::output::IgnoreQueryParamsInResponseOutput
       39336  +
    > for crate::output::TimestampFormatHeadersOutput
39975  39337   
{
39976  39338   
    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) {
       39339  +
        match crate::protocol_serde::shape_timestamp_format_headers::ser_timestamp_format_headers_http_response(self) {
39978  39340   
                        Ok(response) => response,
39979  39341   
                        Err(e) => {
39980  39342   
                            ::tracing::error!(error = %e, "failed to serialize response");
39981  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))
39982  39344   
                        }
39983  39345   
                    }
39984  39346   
    }
39985  39347   
}
39986  39348   
39987         -
const CONTENT_TYPE_CONSTANTANDVARIABLEQUERYSTRING: ::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;
39988  39494   
::pin_project_lite::pin_project! {
39989  39495   
    /// 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>>
       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>>
39993  39499   
    }
39994  39500   
}
39995  39501   
39996         -
impl std::future::Future for ConstantAndVariableQueryStringInputFuture {
       39502  +
impl std::future::Future for NullAndEmptyHeadersServerInputFuture {
39997  39503   
    type Output = Result<
39998         -
        crate::input::ConstantAndVariableQueryStringInput,
       39504  +
        crate::input::NullAndEmptyHeadersServerInput,
39999  39505   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
40000  39506   
    >;
40001  39507   
40002  39508   
    fn poll(
40003  39509   
        self: std::pin::Pin<&mut Self>,
40004  39510   
        cx: &mut std::task::Context<'_>,
40005  39511   
    ) -> std::task::Poll<Self::Output> {
40006  39512   
        let this = self.project();
40007  39513   
        this.inner.as_mut().poll(cx)
40008  39514   
    }
40009  39515   
}
40010  39516   
40011  39517   
impl<B>
40012  39518   
    ::aws_smithy_http_server::request::FromRequest<
40013  39519   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
40014  39520   
        B,
40015         -
    > for crate::input::ConstantAndVariableQueryStringInput
       39521  +
    > for crate::input::NullAndEmptyHeadersServerInput
40016  39522   
where
40017  39523   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
40018  39524   
    B: 'static,
40019  39525   
40020  39526   
    B::Data: Send,
40021  39527   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
40022  39528   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
40023  39529   
{
40024  39530   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
40025         -
    type Future = ConstantAndVariableQueryStringInputFuture;
       39531  +
    type Future = NullAndEmptyHeadersServerInputFuture;
40026  39532   
40027  39533   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
40028  39534   
        let fut = async move {
40029  39535   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
40030  39536   
                request.headers(),
40031         -
                &CONTENT_TYPE_CONSTANTANDVARIABLEQUERYSTRING,
       39537  +
                &CONTENT_TYPE_NULLANDEMPTYHEADERSSERVER,
40032  39538   
            ) {
40033  39539   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
40034  39540   
            }
40035         -
            crate::protocol_serde::shape_constant_and_variable_query_string::de_constant_and_variable_query_string_http_request(request)
       39541  +
            crate::protocol_serde::shape_null_and_empty_headers_server::de_null_and_empty_headers_server_http_request(request)
40036  39542   
                            .await
40037  39543   
                            .map_err(Into::into)
40038  39544   
        };
40039  39545   
        use ::futures_util::future::TryFutureExt;
40040  39546   
        let fut = fut.map_err(
40041  39547   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
40042  39548   
                ::tracing::debug!(error = %e, "failed to deserialize request");
40043  39549   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
40044  39550   
                    e,
40045  39551   
                )
40046  39552   
            },
40047  39553   
        );
40048         -
        ConstantAndVariableQueryStringInputFuture {
       39554  +
        NullAndEmptyHeadersServerInputFuture {
40049  39555   
            inner: Box::pin(fut),
40050  39556   
        }
40051  39557   
    }
40052  39558   
}
40053  39559   
impl
40054  39560   
    ::aws_smithy_http_server::response::IntoResponse<
40055  39561   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
40056         -
    > for crate::output::ConstantAndVariableQueryStringOutput
       39562  +
    > for crate::output::NullAndEmptyHeadersServerOutput
40057  39563   
{
40058  39564   
    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) {
       39565  +
        match crate::protocol_serde::shape_null_and_empty_headers_server::ser_null_and_empty_headers_server_http_response(self) {
40060  39566   
                        Ok(response) => response,
40061  39567   
                        Err(e) => {
40062  39568   
                            ::tracing::error!(error = %e, "failed to serialize response");
40063  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))
40064  39570   
                        }
40065  39571   
                    }
40066  39572   
    }
40067  39573   
}
40068  39574   
40069         -
const CONTENT_TYPE_CONSTANTQUERYSTRING: ::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;
40070  39604   
::pin_project_lite::pin_project! {
40071  39605   
    /// 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>>
       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>>
40075  39609   
    }
40076  39610   
}
40077  39611   
40078         -
impl std::future::Future for ConstantQueryStringInputFuture {
       39612  +
impl std::future::Future for NullAndEmptyHeadersClientInputFuture {
40079  39613   
    type Output = Result<
40080         -
        crate::input::ConstantQueryStringInput,
       39614  +
        crate::input::NullAndEmptyHeadersClientInput,
40081  39615   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
40082  39616   
    >;
40083  39617   
40084  39618   
    fn poll(
40085  39619   
        self: std::pin::Pin<&mut Self>,
40086  39620   
        cx: &mut std::task::Context<'_>,
40087  39621   
    ) -> std::task::Poll<Self::Output> {
40088  39622   
        let this = self.project();
40089  39623   
        this.inner.as_mut().poll(cx)
40090  39624   
    }
40091  39625   
}
40092  39626   
40093  39627   
impl<B>
40094  39628   
    ::aws_smithy_http_server::request::FromRequest<
40095  39629   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
40096  39630   
        B,
40097         -
    > for crate::input::ConstantQueryStringInput
       39631  +
    > for crate::input::NullAndEmptyHeadersClientInput
40098  39632   
where
40099  39633   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
40100  39634   
    B: 'static,
40101  39635   
40102  39636   
    B::Data: Send,
40103  39637   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
40104  39638   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
40105  39639   
{
40106  39640   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
40107         -
    type Future = ConstantQueryStringInputFuture;
       39641  +
    type Future = NullAndEmptyHeadersClientInputFuture;
40108  39642   
40109  39643   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
40110  39644   
        let fut = async move {
40111  39645   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
40112  39646   
                request.headers(),
40113         -
                &CONTENT_TYPE_CONSTANTQUERYSTRING,
       39647  +
                &CONTENT_TYPE_NULLANDEMPTYHEADERSCLIENT,
40114  39648   
            ) {
40115  39649   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
40116  39650   
            }
40117         -
            crate::protocol_serde::shape_constant_query_string::de_constant_query_string_http_request(request)
       39651  +
            crate::protocol_serde::shape_null_and_empty_headers_client::de_null_and_empty_headers_client_http_request(request)
40118  39652   
                            .await
40119  39653   
                            .map_err(Into::into)
40120  39654   
        };
40121  39655   
        use ::futures_util::future::TryFutureExt;
40122  39656   
        let fut = fut.map_err(
40123  39657   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
40124  39658   
                ::tracing::debug!(error = %e, "failed to deserialize request");
40125  39659   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
40126  39660   
                    e,
40127  39661   
                )
40128  39662   
            },
40129  39663   
        );
40130         -
        ConstantQueryStringInputFuture {
       39664  +
        NullAndEmptyHeadersClientInputFuture {
40131  39665   
            inner: Box::pin(fut),
40132  39666   
        }
40133  39667   
    }
40134  39668   
}
40135  39669   
impl
40136  39670   
    ::aws_smithy_http_server::response::IntoResponse<
40137  39671   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
40138         -
    > for crate::output::ConstantQueryStringOutput
       39672  +
    > for crate::output::NullAndEmptyHeadersClientOutput
40139  39673   
{
40140  39674   
    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) {
       39675  +
        match crate::protocol_serde::shape_null_and_empty_headers_client::ser_null_and_empty_headers_client_http_response(self) {
40142  39676   
                        Ok(response) => response,
40143  39677   
                        Err(e) => {
40144  39678   
                            ::tracing::error!(error = %e, "failed to serialize response");
40145  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))
40146  39680   
                        }
40147  39681   
                    }
40148  39682   
    }
40149  39683   
}
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         -
            },
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  39684   
40169         -
const CONTENT_TYPE_ALLQUERYSTRINGTYPES: ::mime::Mime = ::mime::APPLICATION_JSON;
       39685  +
const CONTENT_TYPE_INPUTANDOUTPUTWITHHEADERS: ::mime::Mime = ::mime::APPLICATION_JSON;
40170  39686   
::pin_project_lite::pin_project! {
40171  39687   
    /// 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>>
       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>>
40175  39691   
    }
40176  39692   
}
40177  39693   
40178         -
impl std::future::Future for AllQueryStringTypesInputFuture {
       39694  +
impl std::future::Future for InputAndOutputWithHeadersInputFuture {
40179  39695   
    type Output = Result<
40180         -
        crate::input::AllQueryStringTypesInput,
       39696  +
        crate::input::InputAndOutputWithHeadersInput,
40181  39697   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
40182  39698   
    >;
40183  39699   
40184  39700   
    fn poll(
40185  39701   
        self: std::pin::Pin<&mut Self>,
40186  39702   
        cx: &mut std::task::Context<'_>,
40187  39703   
    ) -> std::task::Poll<Self::Output> {
40188  39704   
        let this = self.project();
40189  39705   
        this.inner.as_mut().poll(cx)
40190  39706   
    }
40191  39707   
}
40192  39708   
40193  39709   
impl<B>
40194  39710   
    ::aws_smithy_http_server::request::FromRequest<
40195  39711   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
40196  39712   
        B,
40197         -
    > for crate::input::AllQueryStringTypesInput
       39713  +
    > for crate::input::InputAndOutputWithHeadersInput
40198  39714   
where
40199  39715   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
40200  39716   
    B: 'static,
40201  39717   
40202  39718   
    B::Data: Send,
40203  39719   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
40204  39720   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
40205  39721   
{
40206  39722   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
40207         -
    type Future = AllQueryStringTypesInputFuture;
       39723  +
    type Future = InputAndOutputWithHeadersInputFuture;
40208  39724   
40209  39725   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
40210  39726   
        let fut = async move {
40211  39727   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
40212  39728   
                request.headers(),
40213         -
                &CONTENT_TYPE_ALLQUERYSTRINGTYPES,
       39729  +
                &CONTENT_TYPE_INPUTANDOUTPUTWITHHEADERS,
40214  39730   
            ) {
40215  39731   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
40216  39732   
            }
40217         -
            crate::protocol_serde::shape_all_query_string_types::de_all_query_string_types_http_request(request)
       39733  +
            crate::protocol_serde::shape_input_and_output_with_headers::de_input_and_output_with_headers_http_request(request)
40218  39734   
                            .await
40219  39735   
                            .map_err(Into::into)
40220  39736   
        };
40221  39737   
        use ::futures_util::future::TryFutureExt;
40222  39738   
        let fut = fut.map_err(
40223  39739   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
40224  39740   
                ::tracing::debug!(error = %e, "failed to deserialize request");
40225  39741   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
40226  39742   
                    e,
40227  39743   
                )
40228  39744   
            },
40229  39745   
        );
40230         -
        AllQueryStringTypesInputFuture {
       39746  +
        InputAndOutputWithHeadersInputFuture {
40231  39747   
            inner: Box::pin(fut),
40232  39748   
        }
40233  39749   
    }
40234  39750   
}
40235  39751   
impl
40236  39752   
    ::aws_smithy_http_server::response::IntoResponse<
40237  39753   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
40238         -
    > for crate::output::AllQueryStringTypesOutput
       39754  +
    > for crate::output::InputAndOutputWithHeadersOutput
40239  39755   
{
40240  39756   
    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) {
       39757  +
        match crate::protocol_serde::shape_input_and_output_with_headers::ser_input_and_output_with_headers_http_response(self) {
40242  39758   
                        Ok(response) => response,
40243  39759   
                        Err(e) => {
40244  39760   
                            ::tracing::error!(error = %e, "failed to serialize response");
40245  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))
40246  39762   
                        }
40247  39763   
                    }
40248  39764   
    }
40249  39765   
}
40250  39766   
impl
40251  39767   
    ::aws_smithy_http_server::response::IntoResponse<
40252  39768   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
40253         -
    > for crate::error::AllQueryStringTypesError
       39769  +
    > for crate::error::InputAndOutputWithHeadersError
40254  39770   
{
40255  39771   
    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) {
       39772  +
        match crate::protocol_serde::shape_input_and_output_with_headers::ser_input_and_output_with_headers_http_error(&self) {
40257  39773   
            Ok(mut response) => {
40258  39774   
                response.extensions_mut().insert(::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()));
40259  39775   
                response
40260  39776   
            },
40261  39777   
            Err(e) => {
40262  39778   
                ::tracing::error!(error = %e, "failed to serialize response");
40263  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))
40264  39780   
            }
40265  39781   
        }
40266  39782   
    }
40267  39783   
}
40268  39784   
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;
       39785  +
#[allow(unreachable_code, unused_variables)]
       39786  +
#[cfg(test)]
       39787  +
mod input_and_output_with_headers_test {
40308  39788   
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)
40318         -
                            .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,
40327         -
                )
40328         -
            },
       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,
       39954  +
                            };
       39955  +
                            Ok(response)
       39956  +
                        };
       39957  +
                        sender.send(()).await.expect("receiver dropped early");
       39958  +
                        result
       39959  +
                    }
       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"
40329  39969   
        );
40330         -
        HttpRequestWithRegexLiteralInputFuture {
40331         -
            inner: Box::pin(fut),
40332         -
        }
40333  39970   
    }
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         -
                        }
       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,
       40018  +
                            };
       40019  +
                            ::pretty_assertions::assert_eq!(
       40020  +
                                input.header_string,
       40021  +
                                expected.header_string,
       40022  +
                                "Unexpected value for `header_string`"
       40023  +
                            );
       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
40347  40135   
                    }
40348         -
    }
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         -
            },
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         -
                )
40428         -
            },
       40136  +
                },
       40137  +
            )
       40138  +
            .build_unchecked();
       40139  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       40140  +
            .await
       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"
40429  40145   
        );
40430         -
        HttpRequestWithFloatLabelsInputFuture {
40431         -
            inner: Box::pin(fut),
40432         -
        }
40433  40146   
    }
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         -
                        }
       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,
       40196  +
                            };
       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`"
       40278  +
                            );
       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
40447  40313   
                    }
       40314  +
                },
       40315  +
            )
       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"
       40323  +
        );
40448  40324   
    }
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         -
        }
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)
40520         -
        };
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         -
            },
       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
       40489  +
                    }
       40490  +
                },
       40491  +
            )
       40492  +
            .build_unchecked();
       40493  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       40494  +
            .await
       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"
40529  40499   
        );
40530         -
        HttpRequestWithGreedyLabelInPathInputFuture {
40531         -
            inner: Box::pin(fut),
40532         -
        }
40533  40500   
    }
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         -
                        }
       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",
       40513  +
            )
       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`"
       40616  +
                            );
       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
40547  40671   
                    }
       40672  +
                },
       40673  +
            )
       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"
       40681  +
        );
40548  40682   
    }
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)
40620         -
        };
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         -
            },
       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,
       40741  +
                            };
       40742  +
                            ::pretty_assertions::assert_eq!(
       40743  +
                                input.header_string,
       40744  +
                                expected.header_string,
       40745  +
                                "Unexpected value for `header_string`"
       40746  +
                            );
       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)
       40855  +
                        };
       40856  +
                        sender.send(()).await.expect("receiver dropped early");
       40857  +
                        result
       40858  +
                    }
       40859  +
                },
       40860  +
            )
       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"
40629  40868   
        );
40630         -
        HttpRequestWithLabelsAndTimestampFormatInputFuture {
40631         -
            inner: Box::pin(fut),
40632         -
        }
40633  40869   
    }
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         -
                        }
       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
40647  41033   
                    }
       41034  +
                },
       41035  +
            )
       41036  +
            .build_unchecked();
       41037  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       41038  +
            .await
       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"
       41043  +
        );
40648  41044   
    }
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         -
            },
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))
       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  +
                ,
40664  41128   
            }
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)
       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  +
                ,
       41206  +
            }
       41207  +
        ;
       41208  +
        Ok(response) };
       41209  +
                                sender.send(()).await.expect("receiver dropped early");
       41210  +
                                result
       41211  +
                            }
       41212  +
                        })
       41213  +
                        .build_unchecked();
       41214  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       41215  +
            .await
       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"
       41220  +
        );
40690  41221   
    }
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);
       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  +
                ,
40716  41305   
            }
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         -
                )
40728         -
            },
       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  +
                ,
       41383  +
            }
       41384  +
        ;
       41385  +
        Ok(response) };
       41386  +
                                sender.send(()).await.expect("receiver dropped early");
       41387  +
                                result
       41388  +
                            }
       41389  +
                        })
       41390  +
                        .build_unchecked();
       41391  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       41392  +
            .await
       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"
40729  41397   
        );
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         -
                    }
40748  41398   
    }
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         -
            },
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))
       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  +
                ,
40764  41482   
            }
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);
       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  +
                ,
40816  41560   
            }
40817         -
            crate::protocol_serde::shape_media_type_header::de_media_type_header_http_request(
40818         -
                request,
40819         -
            )
       41561  +
        ;
       41562  +
        Ok(response) };
       41563  +
                                sender.send(()).await.expect("receiver dropped early");
       41564  +
                                result
       41565  +
                            }
       41566  +
                        })
       41567  +
                        .build_unchecked();
       41568  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
40820  41569   
            .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         -
            },
       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"
40831  41574   
        );
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         -
        }
40852         -
    }
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  41575   
    }
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)
       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  +
        ));
40876  41624   
    }
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);
40902         -
            }
40903         -
            crate::protocol_serde::shape_timestamp_format_headers::de_timestamp_format_headers_http_request(request)
40904         -
                            .await
40905         -
                            .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,
40906  41653   
        };
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         -
            },
       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()
40915  41659   
        );
40916         -
        TimestampFormatHeadersInputFuture {
40917         -
            inner: Box::pin(fut),
40918         -
        }
40919         -
    }
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>>
40943         -
    }
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)
       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  +
        ));
40958  41665   
    }
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);
40984         -
            }
40985         -
            crate::protocol_serde::shape_null_and_empty_headers_server::de_null_and_empty_headers_server_http_request(request)
40986         -
                            .await
40987         -
                            .map_err(Into::into)
       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,
40988  41690   
        };
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         -
            },
       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()
40997  41696   
        );
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         -
                        }
41015         -
                    }
41016         -
    }
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>>
       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  +
        ));
41025  41710   
    }
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)
       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  +
        ));
41040  41751   
    }
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);
41066         -
            }
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)
       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,
41070  41779   
        };
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         -
            },
       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()
41079  41785   
        );
41080         -
        NullAndEmptyHeadersClientInputFuture {
41081         -
            inner: Box::pin(fut),
41082         -
        }
       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  +
        ));
41083  41794   
    }
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))
41096         -
                        }
41097         -
                    }
       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);
41148         -
            }
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)
       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,
41152  41956   
        };
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         -
            },
       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()
41161  41962   
        );
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         -
                    }
       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  +
        ));
41180  41968   
    }
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         -
        }
       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,
       41999  +
        };
       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()
       42005  +
        );
       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  +
}