Server Test

Server Test

rev. 9f5fb9826a6af51ebfb3736d0a778b00ec7b08b3

Files changed:

tmp-codegen-diff/codegen-server-test/constraints/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_EVENTSTREAMSOPERATION: ::once_cell::sync::Lazy<::mime::Mime> =
    4      3   
    ::once_cell::sync::Lazy::new(|| {
    5      4   
        "application/vnd.amazon.eventstream"
    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   
    /// [`EventStreamsOperationInput`](crate::input::EventStreamsOperationInput) using modelled bindings.
   12     11   
    pub struct EventStreamsOperationInputFuture {

tmp-codegen-diff/codegen-server-test/constraints_without_public_constrained_types/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_EVENTSTREAMSOPERATION: ::once_cell::sync::Lazy<::mime::Mime> =
    4      3   
    ::once_cell::sync::Lazy::new(|| {
    5      4   
        "application/vnd.amazon.eventstream"
    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   
    /// [`EventStreamsOperationInput`](crate::input::EventStreamsOperationInput) using modelled bindings.
   12     11   
    pub struct EventStreamsOperationInputFuture {

tmp-codegen-diff/codegen-server-test/ebs/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_STARTSNAPSHOT: ::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   
    /// [`StartSnapshotInput`](crate::input::StartSnapshotInput) using modelled bindings.
    7      6   
    pub struct StartSnapshotInputFuture {
    8      7   
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::StartSnapshotInput, ::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 StartSnapshotInputFuture {

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

@@ -1,1 +53,56 @@
   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"
   39     37   
[dev-dependencies.aws-smithy-protocol-test]
   40     38   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-protocol-test"
          39  +
[dev-dependencies.bytes]
          40  +
version = "1.4.0"
   41     41   
[dev-dependencies.hyper]
   42     42   
version = "0.14.12"
   43     43   
[dev-dependencies.pretty_assertions]
   44     44   
version = "1.3.0"
   45     45   
[dev-dependencies.tokio]
   46     46   
version = "1.23.1"
   47     47   
features = ["macros", "test-util", "rt-multi-thread"]
          48  +
[dev-dependencies.tracing-test]
          49  +
version = "0.2.5"
          50  +
features = ["no-env-filter"]
   48     51   
[features]
   49     52   
aws-lambda = ["aws-smithy-http-server/aws-lambda"]
   50     53   
rt-tokio = ["aws-smithy-types/rt-tokio"]
   51     54   
default = ["aws-lambda", "rt-tokio"]
   52     55   
   53     56   

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

@@ -1,1 +1404,731 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[cfg(test)]
           2  +
static CONTENT_TYPE_OPERATIONWITHNESTEDSTRUCTURE: ::once_cell::sync::Lazy<::mime::Mime> =
           3  +
    ::once_cell::sync::Lazy::new(|| {
           4  +
        "application/x-amz-json-1.0"
           5  +
            .parse::<::mime::Mime>()
           6  +
            .expect("BUG: MIME parsing failed, content_type is not valid")
           7  +
    });
           8  +
::pin_project_lite::pin_project! {
           9  +
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
          10  +
    /// [`OperationWithNestedStructureInput`](crate::input::OperationWithNestedStructureInput) using modelled bindings.
          11  +
    pub struct OperationWithNestedStructureInputFuture {
          12  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::OperationWithNestedStructureInput, ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError>> + Send>>
          13  +
    }
          14  +
}
          15  +
          16  +
impl std::future::Future for OperationWithNestedStructureInputFuture {
          17  +
    type Output = Result<
          18  +
        crate::input::OperationWithNestedStructureInput,
          19  +
        ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError,
          20  +
    >;
          21  +
          22  +
    fn poll(
          23  +
        self: std::pin::Pin<&mut Self>,
          24  +
        cx: &mut std::task::Context<'_>,
          25  +
    ) -> std::task::Poll<Self::Output> {
          26  +
        let this = self.project();
          27  +
        this.inner.as_mut().poll(cx)
          28  +
    }
          29  +
}
          30  +
          31  +
impl<B>
          32  +
    ::aws_smithy_http_server::request::FromRequest<
          33  +
        ::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0,
          34  +
        B,
          35  +
    > for crate::input::OperationWithNestedStructureInput
          36  +
where
          37  +
    B: ::aws_smithy_http_server::body::HttpBody + Send,
          38  +
    B: 'static,
          39  +
          40  +
    B::Data: Send,
          41  +
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection:
          42  +
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
          43  +
{
          44  +
    type Rejection = ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError;
          45  +
    type Future = OperationWithNestedStructureInputFuture;
          46  +
          47  +
    fn from_request(request: ::http::Request<B>) -> Self::Future {
          48  +
        let fut = async move {
          49  +
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
          50  +
                request.headers(),
          51  +
                &CONTENT_TYPE_OPERATIONWITHNESTEDSTRUCTURE,
          52  +
            ) {
          53  +
                return Err(::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection::NotAcceptable);
          54  +
            }
          55  +
            crate::protocol_serde::shape_operation_with_nested_structure::de_operation_with_nested_structure_http_request(request)
          56  +
                            .await
          57  +
                            .map_err(Into::into)
          58  +
        };
          59  +
        use ::futures_util::future::TryFutureExt;
          60  +
        let fut = fut.map_err(
          61  +
            |e: ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection| {
          62  +
                ::tracing::debug!(error = %e, "failed to deserialize request");
          63  +
                ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e)
          64  +
            },
          65  +
        );
          66  +
        OperationWithNestedStructureInputFuture {
          67  +
            inner: Box::pin(fut),
          68  +
        }
          69  +
    }
          70  +
}
          71  +
impl
          72  +
    ::aws_smithy_http_server::response::IntoResponse<
          73  +
        ::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0,
          74  +
    > for crate::output::OperationWithNestedStructureOutput
          75  +
{
          76  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
          77  +
        match crate::protocol_serde::shape_operation_with_nested_structure::ser_operation_with_nested_structure_http_response(self) {
          78  +
                        Ok(response) => response,
          79  +
                        Err(e) => {
          80  +
                            ::tracing::error!(error = %e, "failed to serialize response");
          81  +
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0>::into_response(::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e))
          82  +
                        }
          83  +
                    }
          84  +
    }
          85  +
}
          86  +
impl
          87  +
    ::aws_smithy_http_server::response::IntoResponse<
          88  +
        ::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0,
          89  +
    > for crate::error::OperationWithNestedStructureError
          90  +
{
          91  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
          92  +
        match crate::protocol_serde::shape_operation_with_nested_structure::ser_operation_with_nested_structure_http_error(&self) {
          93  +
            Ok(mut response) => {
          94  +
                response.extensions_mut().insert(::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()));
          95  +
                response
          96  +
            },
          97  +
            Err(e) => {
          98  +
                ::tracing::error!(error = %e, "failed to serialize response");
          99  +
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0>::into_response(::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e))
         100  +
            }
         101  +
        }
         102  +
    }
         103  +
}
         104  +
    3    105   
#[allow(unreachable_code, unused_variables)]
    4         -
mod server_empty_input_and_empty_output_test {
    5         -
    /// Clients must always send an empty object if input is modeled.
    6         -
    /// Test ID: AwsJson10EmptyInputAndEmptyOutput
         106  +
#[cfg(test)]
         107  +
mod operation_with_nested_structure_test {
         108  +
         109  +
    /// Server populates nested default values when missing in request body.
         110  +
    /// Test ID: AwsJson10ServerPopulatesNestedDefaultsWhenMissingInRequestBody
    7    111   
    #[::tokio::test]
    8         -
    async fn aws_json10_empty_input_and_empty_output_request() {
         112  +
    #[::tracing_test::traced_test]
         113  +
    #[should_panic]
         114  +
    async fn aws_json10_server_populates_nested_defaults_when_missing_in_request_body_request() {
    9    115   
        #[allow(unused_mut)]
   10         -
        let mut http_request = http::Request::builder()
   11         -
            .uri("/")
   12         -
            .method("POST")
   13         -
            .header("Content-Type", "application/x-amz-json-1.0")
   14         -
            .header("X-Amz-Target", "JsonRpc10.EmptyInputAndEmptyOutput")
   15         -
            .body(::aws_smithy_http_server::body::Body::from(
   16         -
                ::bytes::Bytes::from_static("{}".as_bytes()),
   17         -
            ))
   18         -
            .unwrap();
         116  +
                    let mut http_request = http::Request::builder()
         117  +
                        .uri("/")
         118  +
                        .method("POST")
         119  +
        .header("Content-Type", "application/x-amz-json-1.0")
         120  +
        .body(::aws_smithy_http_server::body::Body::from(::bytes::Bytes::from_static("{\n    \"topLevel\": {\n        \"dialog\": {\n            \"language\": \"en\"\n        },\n        \"dialogList\": [\n            {\n            },\n            {\n                \"farewell\": {}\n            },\n            {\n                \"language\": \"it\",\n                \"greeting\": \"ciao\",\n                \"farewell\": {\n                    \"phrase\": \"arrivederci\"\n                }\n            }\n        ],\n        \"dialogMap\": {\n            \"emptyDialog\": {\n            },\n            \"partialEmptyDialog\": {\n                \"language\": \"en\",\n                \"farewell\": {}\n            },\n            \"nonEmptyDialog\": {\n                \"greeting\": \"konnichiwa\",\n                \"farewell\": {\n                    \"phrase\": \"sayonara\"\n                }\n            }\n        }\n    }\n}".as_bytes()))).unwrap();
   19    121   
        #[allow(unused_mut)]
   20    122   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
   21    123   
        let config = crate::service::JsonRpc10Config::builder().build();
   22    124   
        let service = crate::service::JsonRpc10::builder::<::hyper::body::Body, _, _, _>(config)
   23         -
            .empty_input_and_empty_output(
   24         -
                move |input: crate::input::EmptyInputAndEmptyOutputInput| {
         125  +
            .operation_with_nested_structure(
         126  +
                move |input: crate::input::OperationWithNestedStructureInput| {
   25    127   
                    let sender = sender.clone();
   26    128   
                    async move {
   27    129   
                        let result = {
   28         -
                            let expected = crate::input::EmptyInputAndEmptyOutputInput {};
         130  +
                            let expected = crate::input::OperationWithNestedStructureInput {
         131  +
                                top_level: crate::model::TopLevel {
         132  +
                                    dialog: crate::model::Dialog {
         133  +
                                        language: ::std::option::Option::Some("en".to_owned()),
         134  +
                                        greeting: "hi".to_owned(),
         135  +
                                        farewell: ::std::option::Option::None,
         136  +
                                    },
         137  +
                                    dialog_list: vec![
         138  +
                                        crate::model::Dialog {
         139  +
                                            greeting: "hi".to_owned(),
         140  +
                                            language: ::std::option::Option::None,
         141  +
                                            farewell: ::std::option::Option::None,
         142  +
                                        },
         143  +
                                        crate::model::Dialog {
         144  +
                                            greeting: "hi".to_owned(),
         145  +
                                            farewell: ::std::option::Option::Some(
         146  +
                                                crate::model::Farewell {
         147  +
                                                    phrase: "bye".to_owned(),
         148  +
                                                },
         149  +
                                            ),
         150  +
                                            language: ::std::option::Option::None,
         151  +
                                        },
         152  +
                                        crate::model::Dialog {
         153  +
                                            language: ::std::option::Option::Some("it".to_owned()),
         154  +
                                            greeting: "ciao".to_owned(),
         155  +
                                            farewell: ::std::option::Option::Some(
         156  +
                                                crate::model::Farewell {
         157  +
                                                    phrase: "arrivederci".to_owned(),
         158  +
                                                },
         159  +
                                            ),
         160  +
                                        },
         161  +
                                    ],
         162  +
                                    dialog_map: {
         163  +
                                        let mut ret = ::std::collections::HashMap::new();
         164  +
                                        ret.insert(
         165  +
                                            "emptyDialog".to_owned(),
         166  +
                                            crate::model::Dialog {
         167  +
                                                greeting: "hi".to_owned(),
         168  +
                                                language: ::std::option::Option::None,
         169  +
                                                farewell: ::std::option::Option::None,
         170  +
                                            },
         171  +
                                        );
         172  +
                                        ret.insert(
         173  +
                                            "partialEmptyDialog".to_owned(),
         174  +
                                            crate::model::Dialog {
         175  +
                                                language: ::std::option::Option::Some(
         176  +
                                                    "en".to_owned(),
         177  +
                                                ),
         178  +
                                                greeting: "hi".to_owned(),
         179  +
                                                farewell: ::std::option::Option::Some(
         180  +
                                                    crate::model::Farewell {
         181  +
                                                        phrase: "bye".to_owned(),
         182  +
                                                    },
         183  +
                                                ),
         184  +
                                            },
         185  +
                                        );
         186  +
                                        ret.insert(
         187  +
                                            "nonEmptyDialog".to_owned(),
         188  +
                                            crate::model::Dialog {
         189  +
                                                greeting: "konnichiwa".to_owned(),
         190  +
                                                farewell: ::std::option::Option::Some(
         191  +
                                                    crate::model::Farewell {
         192  +
                                                        phrase: "sayonara".to_owned(),
         193  +
                                                    },
         194  +
                                                ),
         195  +
                                                language: ::std::option::Option::None,
         196  +
                                            },
         197  +
                                        );
         198  +
                                        ret
         199  +
                                    },
         200  +
                                },
         201  +
                            };
   29    202   
                            ::pretty_assertions::assert_eq!(input, expected);
   30         -
                            let response = crate::output::EmptyInputAndEmptyOutputOutput {};
   31         -
                            response
         203  +
                            let response = crate::output::OperationWithNestedStructureOutput {
         204  +
                                dialog: crate::model::Dialog {
         205  +
                                    greeting: "".to_owned(),
         206  +
                                    language: ::std::option::Option::None,
         207  +
                                    farewell: ::std::option::Option::None,
         208  +
                                },
         209  +
                                dialog_list: vec![],
         210  +
                                dialog_map: ::std::collections::HashMap::new(),
         211  +
                            };
         212  +
                            Ok(response)
   32    213   
                        };
   33    214   
                        sender.send(()).await.expect("receiver dropped early");
   34    215   
                        result
   35    216   
                    }
   36    217   
                },
   37    218   
            )
   38    219   
            .build_unchecked();
   39    220   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
   40    221   
            .await
   41    222   
            .expect("unable to make an HTTP request");
   42         -
        assert!(receiver.recv().await.is_some());
   43         -
    }
   44         -
    /// A service will always return a JSON object for operations with modeled output.
   45         -
    /// Test ID: AwsJson10EmptyInputAndEmptyOutputSendJsonObject
   46         -
    #[::tokio::test]
   47         -
    async fn aws_json10_empty_input_and_empty_output_send_json_object_response() {
   48         -
        let output = crate::output::EmptyInputAndEmptyOutputOutput {};
   49         -
        use ::aws_smithy_http_server::response::IntoResponse;
   50         -
        let http_response = output.into_response();
   51         -
        ::pretty_assertions::assert_eq!(
   52         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
   53         -
            http_response.status()
         223  +
        assert!(
         224  +
            receiver.recv().await.is_some(),
         225  +
            "we expected operation handler to be invoked but it was not entered"
   54    226   
        );
   55         -
        let expected_headers = [("Content-Type", "application/x-amz-json-1.0")];
   56         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
   57         -
            http_response.headers(),
   58         -
            expected_headers,
   59         -
        ));
   60         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
   61         -
            .await
   62         -
            .expect("unable to extract body to bytes");
   63         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
   64         -
            &body,
   65         -
            "{}",
   66         -
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
   67         -
        ));
   68    227   
    }
   69         -
}
   70         -
#[cfg(test)]
   71         -
#[allow(unreachable_code, unused_variables)]
   72         -
mod server_endpoint_operation_test {
   73         -
    /// Operations can prepend to the given host if they define the
   74         -
    /// endpoint trait.
   75         -
    /// Test ID: AwsJson10EndpointTrait
         228  +
    /// Server populates nested default values when missing in response params.
         229  +
    /// Test ID: AwsJson10ServerPopulatesNestedDefaultValuesWhenMissingInInResponseParams
   76    230   
    #[::tokio::test]
         231  +
    #[::tracing_test::traced_test]
   77    232   
    #[should_panic]
   78         -
    async fn aws_json10_endpoint_trait_request() {
   79         -
        #[allow(unused_mut)]
   80         -
        let mut http_request = http::Request::builder()
   81         -
            .uri("/")
   82         -
            .method("POST")
   83         -
            .body(::aws_smithy_http_server::body::Body::from(
   84         -
                ::bytes::Bytes::from_static("{}".as_bytes()),
   85         -
            ))
   86         -
            .unwrap();
   87         -
        todo!("endpoint trait not supported yet");
   88         -
        #[allow(unused_mut)]
   89         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
   90         -
        let config = crate::service::JsonRpc10Config::builder().build();
   91         -
        let service = crate::service::JsonRpc10::builder::<::hyper::body::Body, _, _, _>(config)
   92         -
            .endpoint_operation(move |input: crate::input::EndpointOperationInput| {
   93         -
                let sender = sender.clone();
   94         -
                async move {
   95         -
                    let result = {
   96         -
                        let expected = crate::input::EndpointOperationInput {};
   97         -
                        ::pretty_assertions::assert_eq!(input, expected);
   98         -
                        let response = crate::output::EndpointOperationOutput {};
   99         -
                        response
  100         -
                    };
  101         -
                    sender.send(()).await.expect("receiver dropped early");
  102         -
                    result
  103         -
                }
  104         -
            })
  105         -
            .build_unchecked();
  106         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
  107         -
            .await
  108         -
            .expect("unable to make an HTTP request");
  109         -
        assert!(receiver.recv().await.is_some());
  110         -
    }
  111         -
}
  112         -
#[cfg(test)]
  113         -
#[allow(unreachable_code, unused_variables)]
  114         -
mod server_endpoint_with_host_label_operation_test {
  115         -
    /// Operations can prepend to the given host if they define the
  116         -
    /// endpoint trait, and can use the host label trait to define
  117         -
    /// further customization based on user input.
  118         -
    /// Test ID: AwsJson10EndpointTraitWithHostLabel
  119         -
    #[::tokio::test]
  120         -
    #[should_panic]
  121         -
    async fn aws_json10_endpoint_trait_with_host_label_request() {
  122         -
        #[allow(unused_mut)]
  123         -
        let mut http_request = http::Request::builder()
  124         -
            .uri("/")
  125         -
            .method("POST")
  126         -
            .body(::aws_smithy_http_server::body::Body::from(
  127         -
                ::bytes::Bytes::from_static("{\"label\": \"bar\"}".as_bytes()),
  128         -
            ))
  129         -
            .unwrap();
  130         -
        todo!("endpoint trait not supported yet");
  131         -
        #[allow(unused_mut)]
  132         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
  133         -
        let config = crate::service::JsonRpc10Config::builder().build();
  134         -
        let service = crate::service::JsonRpc10::builder::<::hyper::body::Body, _, _, _>(config)
  135         -
            .endpoint_with_host_label_operation(
  136         -
                move |input: crate::input::EndpointWithHostLabelOperationInput| {
  137         -
                    let sender = sender.clone();
  138         -
                    async move {
  139         -
                        let result = {
  140         -
                            let expected = crate::input::EndpointWithHostLabelOperationInput {
  141         -
                                label: "bar".to_owned(),
  142         -
                            };
  143         -
                            ::pretty_assertions::assert_eq!(input, expected);
  144         -
                            let response = crate::output::EndpointWithHostLabelOperationOutput {};
  145         -
                            Ok(response)
  146         -
                        };
  147         -
                        sender.send(()).await.expect("receiver dropped early");
  148         -
                        result
  149         -
                    }
         233  +
    async fn aws_json10_server_populates_nested_default_values_when_missing_in_in_response_params_response(
         234  +
    ) {
         235  +
        let output = crate::output::OperationWithNestedStructureOutput {
         236  +
            dialog: crate::model::Dialog {
         237  +
                greeting: "".to_owned(),
         238  +
                language: ::std::option::Option::Some("en".to_owned()),
         239  +
                farewell: ::std::option::Option::None,
         240  +
            },
         241  +
            dialog_list: vec![
         242  +
                crate::model::Dialog {
         243  +
                    greeting: "".to_owned(),
         244  +
                    language: ::std::option::Option::None,
         245  +
                    farewell: ::std::option::Option::None,
  150    246   
                },
  151         -
            )
  152         -
            .build_unchecked();
  153         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
  154         -
            .await
  155         -
            .expect("unable to make an HTTP request");
  156         -
        assert!(receiver.recv().await.is_some());
  157         -
    }
  158         -
}
  159         -
#[cfg(test)]
  160         -
#[allow(unreachable_code, unused_variables)]
  161         -
mod server_greeting_with_errors_test {
  162         -
    /// Parses simple JSON errors
  163         -
    /// Test ID: AwsJson10InvalidGreetingError
  164         -
    #[::tokio::test]
  165         -
    async fn aws_json10_invalid_greeting_error_response() {
  166         -
        let output = crate::error::InvalidGreeting {
  167         -
            message: ::std::option::Option::Some("Hi".to_owned()),
         247  +
                crate::model::Dialog {
         248  +
                    greeting: "".to_owned(),
         249  +
                    farewell: ::std::option::Option::Some(crate::model::Farewell {
         250  +
                        phrase: "".to_owned(),
         251  +
                    }),
         252  +
                    language: ::std::option::Option::None,
         253  +
                },
         254  +
                crate::model::Dialog {
         255  +
                    language: ::std::option::Option::Some("it".to_owned()),
         256  +
                    greeting: "ciao".to_owned(),
         257  +
                    farewell: ::std::option::Option::Some(crate::model::Farewell {
         258  +
                        phrase: "arrivederci".to_owned(),
         259  +
                    }),
         260  +
                },
         261  +
            ],
         262  +
            dialog_map: {
         263  +
                let mut ret = ::std::collections::HashMap::new();
         264  +
                ret.insert(
         265  +
                    "emptyDialog".to_owned(),
         266  +
                    crate::model::Dialog {
         267  +
                        greeting: "".to_owned(),
         268  +
                        language: ::std::option::Option::None,
         269  +
                        farewell: ::std::option::Option::None,
         270  +
                    },
         271  +
                );
         272  +
                ret.insert(
         273  +
                    "partialEmptyDialog".to_owned(),
         274  +
                    crate::model::Dialog {
         275  +
                        greeting: "".to_owned(),
         276  +
                        language: ::std::option::Option::Some("en".to_owned()),
         277  +
                        farewell: ::std::option::Option::Some(crate::model::Farewell {
         278  +
                            phrase: "".to_owned(),
         279  +
                        }),
         280  +
                    },
         281  +
                );
         282  +
                ret.insert(
         283  +
                    "nonEmptyDialog".to_owned(),
         284  +
                    crate::model::Dialog {
         285  +
                        greeting: "konnichiwa".to_owned(),
         286  +
                        farewell: ::std::option::Option::Some(crate::model::Farewell {
         287  +
                            phrase: "sayonara".to_owned(),
         288  +
                        }),
         289  +
                        language: ::std::option::Option::None,
         290  +
                    },
         291  +
                );
         292  +
                ret
         293  +
            },
  168    294   
        };
  169         -
        let output = crate::error::GreetingWithErrorsError::InvalidGreeting(output);
  170    295   
        use ::aws_smithy_http_server::response::IntoResponse;
  171    296   
        let http_response = output.into_response();
  172    297   
        ::pretty_assertions::assert_eq!(
  173         -
            http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
         298  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
  174    299   
            http_response.status()
  175    300   
        );
  176    301   
        let expected_headers = [("Content-Type", "application/x-amz-json-1.0")];
  177    302   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
  178    303   
            http_response.headers(),
  179    304   
            expected_headers,
  180    305   
        ));
  181    306   
        let body = ::hyper::body::to_bytes(http_response.into_body())
  182    307   
            .await
  183    308   
            .expect("unable to extract body to bytes");
  184    309   
        ::aws_smithy_protocol_test::assert_ok(
  185         -
        ::aws_smithy_protocol_test::validate_body(&body, "{\n    \"__type\": \"aws.protocoltests.json10#InvalidGreeting\",\n    \"Message\": \"Hi\"\n}", ::aws_smithy_protocol_test::MediaType::from("application/json"))
         310  +
        ::aws_smithy_protocol_test::validate_body(&body, "{\n    \"dialog\": {\n        \"language\": \"en\",\n        \"greeting\": \"hi\"\n    },\n    \"dialogList\": [\n        {\n            \"greeting\": \"hi\"\n        },\n        {\n            \"greeting\": \"hi\",\n            \"farewell\": {\n                \"phrase\": \"bye\"\n            }\n        },\n        {\n            \"language\": \"it\",\n            \"greeting\": \"ciao\",\n            \"farewell\": {\n                \"phrase\": \"arrivederci\"\n            }\n        }\n    ],\n    \"dialogMap\": {\n        \"emptyDialog\": {\n            \"greeting\": \"hi\"\n        },\n        \"partialEmptyDialog\": {\n            \"language\": \"en\",\n            \"greeting\": \"hi\",\n            \"farewell\": {\n                \"phrase\": \"bye\"\n            }\n        },\n        \"nonEmptyDialog\": {\n            \"greeting\": \"konnichiwa\",\n            \"farewell\": {\n                \"phrase\": \"sayonara\"\n            }\n        }\n    }\n}", ::aws_smithy_protocol_test::MediaType::from("application/json"))
  186    311   
        );
  187    312   
    }
  188         -
    /// Parses a complex error with no message member
  189         -
    /// Test ID: AwsJson10ComplexError
  190         -
    #[::tokio::test]
  191         -
    async fn aws_json10_complex_error_response() {
  192         -
        let output = crate::error::ComplexError {
  193         -
            top_level: ::std::option::Option::Some("Top level".to_owned()),
  194         -
            nested: ::std::option::Option::Some(crate::model::ComplexNestedErrorData {
  195         -
                foo: ::std::option::Option::Some("bar".to_owned()),
  196         -
            }),
  197         -
        };
  198         -
        let output = crate::error::GreetingWithErrorsError::ComplexError(output);
  199         -
        use ::aws_smithy_http_server::response::IntoResponse;
  200         -
        let http_response = output.into_response();
  201         -
        ::pretty_assertions::assert_eq!(
  202         -
            http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
  203         -
            http_response.status()
  204         -
        );
  205         -
        let expected_headers = [("Content-Type", "application/x-amz-json-1.0")];
  206         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
  207         -
            http_response.headers(),
  208         -
            expected_headers,
  209         -
        ));
  210         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
  211         -
            .await
  212         -
            .expect("unable to extract body to bytes");
  213         -
        ::aws_smithy_protocol_test::assert_ok(
  214         -
        ::aws_smithy_protocol_test::validate_body(&body, "{\n    \"__type\": \"aws.protocoltests.json10#ComplexError\",\n    \"TopLevel\": \"Top level\",\n    \"Nested\": {\n        \"Foo\": \"bar\"\n    }\n}", ::aws_smithy_protocol_test::MediaType::from("application/json"))
  215         -
        );
         313  +
}
         314  +
         315  +
static CONTENT_TYPE_OPERATIONWITHREQUIREDMEMBERS: ::once_cell::sync::Lazy<::mime::Mime> =
         316  +
    ::once_cell::sync::Lazy::new(|| {
         317  +
        "application/x-amz-json-1.0"
         318  +
            .parse::<::mime::Mime>()
         319  +
            .expect("BUG: MIME parsing failed, content_type is not valid")
         320  +
    });
         321  +
::pin_project_lite::pin_project! {
         322  +
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
         323  +
    /// [`OperationWithRequiredMembersInput`](crate::input::OperationWithRequiredMembersInput) using modelled bindings.
         324  +
    pub struct OperationWithRequiredMembersInputFuture {
         325  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::OperationWithRequiredMembersInput, ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError>> + Send>>
  216    326   
    }
  217         -
    /// Parses a complex error with an empty body
  218         -
    /// Test ID: AwsJson10EmptyComplexError
  219         -
    #[::tokio::test]
  220         -
    async fn aws_json10_empty_complex_error_response() {
  221         -
        let output = crate::error::ComplexError {
  222         -
            top_level: ::std::option::Option::None,
  223         -
            nested: ::std::option::Option::None,
  224         -
        };
  225         -
        let output = crate::error::GreetingWithErrorsError::ComplexError(output);
  226         -
        use ::aws_smithy_http_server::response::IntoResponse;
  227         -
        let http_response = output.into_response();
  228         -
        ::pretty_assertions::assert_eq!(
  229         -
            http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
  230         -
            http_response.status()
  231         -
        );
  232         -
        let expected_headers = [("Content-Type", "application/x-amz-json-1.0")];
  233         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
  234         -
            http_response.headers(),
  235         -
            expected_headers,
  236         -
        ));
  237         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
  238         -
            .await
  239         -
            .expect("unable to extract body to bytes");
  240         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
  241         -
            &body,
  242         -
            "{\n    \"__type\": \"aws.protocoltests.json10#ComplexError\"\n}",
  243         -
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
  244         -
        ));
         327  +
}
         328  +
         329  +
impl std::future::Future for OperationWithRequiredMembersInputFuture {
         330  +
    type Output = Result<
         331  +
        crate::input::OperationWithRequiredMembersInput,
         332  +
        ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError,
         333  +
    >;
         334  +
         335  +
    fn poll(
         336  +
        self: std::pin::Pin<&mut Self>,
         337  +
        cx: &mut std::task::Context<'_>,
         338  +
    ) -> std::task::Poll<Self::Output> {
         339  +
        let this = self.project();
         340  +
        this.inner.as_mut().poll(cx)
  245    341   
    }
  246    342   
}
  247         -
#[cfg(test)]
  248         -
#[allow(unreachable_code, unused_variables)]
  249         -
mod server_json_unions_test {
  250         -
    /// Serializes a string union value
  251         -
    /// Test ID: AwsJson10SerializeStringUnionValue
  252         -
    #[::tokio::test]
  253         -
    async fn aws_json10_serialize_string_union_value_request() {
  254         -
        #[allow(unused_mut)]
  255         -
        let mut http_request = http::Request::builder()
  256         -
            .uri("/")
  257         -
            .method("POST")
  258         -
            .header("Content-Type", "application/x-amz-json-1.0")
  259         -
            .header("X-Amz-Target", "JsonRpc10.JsonUnions")
  260         -
            .body(::aws_smithy_http_server::body::Body::from(
  261         -
                ::bytes::Bytes::from_static(
  262         -
                    "{\n    \"contents\": {\n        \"stringValue\": \"foo\"\n    }\n}".as_bytes(),
  263         -
                ),
  264         -
            ))
  265         -
            .unwrap();
  266         -
        #[allow(unused_mut)]
  267         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
  268         -
        let config = crate::service::JsonRpc10Config::builder().build();
  269         -
        let service = crate::service::JsonRpc10::builder::<::hyper::body::Body, _, _, _>(config)
  270         -
            .json_unions(move |input: crate::input::JsonUnionsInput| {
  271         -
                let sender = sender.clone();
  272         -
                async move {
  273         -
                    let result = {
  274         -
                        let expected = crate::input::JsonUnionsInput {
  275         -
                            contents: ::std::option::Option::Some(
  276         -
                                crate::model::MyUnion::StringValue("foo".to_owned()),
  277         -
                            ),
  278         -
                        };
  279         -
                        ::pretty_assertions::assert_eq!(input, expected);
  280         -
                        let response = crate::output::JsonUnionsOutput {
  281         -
                            contents: ::std::option::Option::None,
  282         -
                        };
  283         -
                        Ok(response)
  284         -
                    };
  285         -
                    sender.send(()).await.expect("receiver dropped early");
  286         -
                    result
  287         -
                }
  288         -
            })
  289         -
            .build_unchecked();
  290         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
  291         -
            .await
  292         -
            .expect("unable to make an HTTP request");
  293         -
        assert!(receiver.recv().await.is_some());
         343  +
         344  +
impl<B>
         345  +
    ::aws_smithy_http_server::request::FromRequest<
         346  +
        ::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0,
         347  +
        B,
         348  +
    > for crate::input::OperationWithRequiredMembersInput
         349  +
where
         350  +
    B: ::aws_smithy_http_server::body::HttpBody + Send,
         351  +
    B: 'static,
         352  +
         353  +
    B::Data: Send,
         354  +
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection:
         355  +
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
         356  +
{
         357  +
    type Rejection = ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError;
         358  +
    type Future = OperationWithRequiredMembersInputFuture;
         359  +
         360  +
    fn from_request(request: ::http::Request<B>) -> Self::Future {
         361  +
        let fut = async move {
         362  +
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
         363  +
                request.headers(),
         364  +
                &CONTENT_TYPE_OPERATIONWITHREQUIREDMEMBERS,
         365  +
            ) {
         366  +
                return Err(::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection::NotAcceptable);
         367  +
            }
         368  +
            crate::protocol_serde::shape_operation_with_required_members::de_operation_with_required_members_http_request(request)
         369  +
                            .await
         370  +
                            .map_err(Into::into)
         371  +
        };
         372  +
        use ::futures_util::future::TryFutureExt;
         373  +
        let fut = fut.map_err(
         374  +
            |e: ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection| {
         375  +
                ::tracing::debug!(error = %e, "failed to deserialize request");
         376  +
                ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e)
         377  +
            },
         378  +
        );
         379  +
        OperationWithRequiredMembersInputFuture {
         380  +
            inner: Box::pin(fut),
         381  +
        }
  294    382   
    }
  295         -
    /// Serializes a boolean union value
  296         -
    /// Test ID: AwsJson10SerializeBooleanUnionValue
  297         -
    #[::tokio::test]
  298         -
    async fn aws_json10_serialize_boolean_union_value_request() {
  299         -
        #[allow(unused_mut)]
  300         -
        let mut http_request = http::Request::builder()
  301         -
            .uri("/")
  302         -
            .method("POST")
  303         -
            .header("Content-Type", "application/x-amz-json-1.0")
  304         -
            .header("X-Amz-Target", "JsonRpc10.JsonUnions")
  305         -
            .body(::aws_smithy_http_server::body::Body::from(
  306         -
                ::bytes::Bytes::from_static(
  307         -
                    "{\n    \"contents\": {\n        \"booleanValue\": true\n    }\n}".as_bytes(),
  308         -
                ),
  309         -
            ))
  310         -
            .unwrap();
  311         -
        #[allow(unused_mut)]
  312         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
  313         -
        let config = crate::service::JsonRpc10Config::builder().build();
  314         -
        let service = crate::service::JsonRpc10::builder::<::hyper::body::Body, _, _, _>(config)
  315         -
            .json_unions(move |input: crate::input::JsonUnionsInput| {
  316         -
                let sender = sender.clone();
  317         -
                async move {
  318         -
                    let result = {
  319         -
                        let expected = crate::input::JsonUnionsInput {
  320         -
                            contents: ::std::option::Option::Some(
  321         -
                                crate::model::MyUnion::BooleanValue(true),
  322         -
                            ),
  323         -
                        };
  324         -
                        ::pretty_assertions::assert_eq!(input, expected);
  325         -
                        let response = crate::output::JsonUnionsOutput {
  326         -
                            contents: ::std::option::Option::None,
  327         -
                        };
  328         -
                        Ok(response)
  329         -
                    };
  330         -
                    sender.send(()).await.expect("receiver dropped early");
  331         -
                    result
  332         -
                }
  333         -
            })
  334         -
            .build_unchecked();
  335         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
  336         -
            .await
  337         -
            .expect("unable to make an HTTP request");
  338         -
        assert!(receiver.recv().await.is_some());
         383  +
}
         384  +
impl
         385  +
    ::aws_smithy_http_server::response::IntoResponse<
         386  +
        ::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0,
         387  +
    > for crate::output::OperationWithRequiredMembersOutput
         388  +
{
         389  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
         390  +
        match crate::protocol_serde::shape_operation_with_required_members::ser_operation_with_required_members_http_response(self) {
         391  +
                        Ok(response) => response,
         392  +
                        Err(e) => {
         393  +
                            ::tracing::error!(error = %e, "failed to serialize response");
         394  +
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0>::into_response(::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e))
         395  +
                        }
         396  +
                    }
  339    397   
    }
  340         -
    /// Serializes a number union value
  341         -
    /// Test ID: AwsJson10SerializeNumberUnionValue
         398  +
}
         399  +
         400  +
static CONTENT_TYPE_OPERATIONWITHDEFAULTS: ::once_cell::sync::Lazy<::mime::Mime> =
         401  +
    ::once_cell::sync::Lazy::new(|| {
         402  +
        "application/x-amz-json-1.0"
         403  +
            .parse::<::mime::Mime>()
         404  +
            .expect("BUG: MIME parsing failed, content_type is not valid")
         405  +
    });
         406  +
::pin_project_lite::pin_project! {
         407  +
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
         408  +
    /// [`OperationWithDefaultsInput`](crate::input::OperationWithDefaultsInput) using modelled bindings.
         409  +
    pub struct OperationWithDefaultsInputFuture {
         410  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::OperationWithDefaultsInput, ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError>> + Send>>
         411  +
    }
         412  +
}
         413  +
         414  +
impl std::future::Future for OperationWithDefaultsInputFuture {
         415  +
    type Output = Result<
         416  +
        crate::input::OperationWithDefaultsInput,
         417  +
        ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError,
         418  +
    >;
         419  +
         420  +
    fn poll(
         421  +
        self: std::pin::Pin<&mut Self>,
         422  +
        cx: &mut std::task::Context<'_>,
         423  +
    ) -> std::task::Poll<Self::Output> {
         424  +
        let this = self.project();
         425  +
        this.inner.as_mut().poll(cx)
         426  +
    }
         427  +
}
         428  +
         429  +
impl<B>
         430  +
    ::aws_smithy_http_server::request::FromRequest<
         431  +
        ::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0,
         432  +
        B,
         433  +
    > for crate::input::OperationWithDefaultsInput
         434  +
where
         435  +
    B: ::aws_smithy_http_server::body::HttpBody + Send,
         436  +
    B: 'static,
         437  +
         438  +
    B::Data: Send,
         439  +
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection:
         440  +
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
         441  +
{
         442  +
    type Rejection = ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError;
         443  +
    type Future = OperationWithDefaultsInputFuture;
         444  +
         445  +
    fn from_request(request: ::http::Request<B>) -> Self::Future {
         446  +
        let fut = async move {
         447  +
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
         448  +
                request.headers(),
         449  +
                &CONTENT_TYPE_OPERATIONWITHDEFAULTS,
         450  +
            ) {
         451  +
                return Err(::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection::NotAcceptable);
         452  +
            }
         453  +
            crate::protocol_serde::shape_operation_with_defaults::de_operation_with_defaults_http_request(request)
         454  +
                            .await
         455  +
                            .map_err(Into::into)
         456  +
        };
         457  +
        use ::futures_util::future::TryFutureExt;
         458  +
        let fut = fut.map_err(
         459  +
            |e: ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection| {
         460  +
                ::tracing::debug!(error = %e, "failed to deserialize request");
         461  +
                ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e)
         462  +
            },
         463  +
        );
         464  +
        OperationWithDefaultsInputFuture {
         465  +
            inner: Box::pin(fut),
         466  +
        }
         467  +
    }
         468  +
}
         469  +
impl
         470  +
    ::aws_smithy_http_server::response::IntoResponse<
         471  +
        ::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0,
         472  +
    > for crate::output::OperationWithDefaultsOutput
         473  +
{
         474  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
         475  +
        match crate::protocol_serde::shape_operation_with_defaults::ser_operation_with_defaults_http_response(self) {
         476  +
                        Ok(response) => response,
         477  +
                        Err(e) => {
         478  +
                            ::tracing::error!(error = %e, "failed to serialize response");
         479  +
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0>::into_response(::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e))
         480  +
                        }
         481  +
                    }
         482  +
    }
         483  +
}
         484  +
impl
         485  +
    ::aws_smithy_http_server::response::IntoResponse<
         486  +
        ::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0,
         487  +
    > for crate::error::OperationWithDefaultsError
         488  +
{
         489  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
         490  +
        match crate::protocol_serde::shape_operation_with_defaults::ser_operation_with_defaults_http_error(&self) {
         491  +
            Ok(mut response) => {
         492  +
                response.extensions_mut().insert(::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()));
         493  +
                response
         494  +
            },
         495  +
            Err(e) => {
         496  +
                ::tracing::error!(error = %e, "failed to serialize response");
         497  +
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0>::into_response(::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e))
         498  +
            }
         499  +
        }
         500  +
    }
         501  +
}
         502  +
         503  +
#[allow(unreachable_code, unused_variables)]
         504  +
#[cfg(test)]
         505  +
mod operation_with_defaults_test {
         506  +
         507  +
    /// Server populates default values when missing in request body.
         508  +
    /// Test ID: AwsJson10ServerPopulatesDefaultsWhenMissingInRequestBody
  342    509   
    #[::tokio::test]
  343         -
    async fn aws_json10_serialize_number_union_value_request() {
         510  +
    #[::tracing_test::traced_test]
         511  +
    #[should_panic]
         512  +
    async fn aws_json10_server_populates_defaults_when_missing_in_request_body_request() {
  344    513   
        #[allow(unused_mut)]
  345    514   
        let mut http_request = http::Request::builder()
  346    515   
            .uri("/")
  347    516   
            .method("POST")
  348    517   
            .header("Content-Type", "application/x-amz-json-1.0")
  349         -
            .header("X-Amz-Target", "JsonRpc10.JsonUnions")
  350    518   
            .body(::aws_smithy_http_server::body::Body::from(
  351         -
                ::bytes::Bytes::from_static(
  352         -
                    "{\n    \"contents\": {\n        \"numberValue\": 1\n    }\n}".as_bytes(),
  353         -
                ),
         519  +
                ::bytes::Bytes::from_static("{\n\"defaults\": {}\n}".as_bytes()),
  354    520   
            ))
  355    521   
            .unwrap();
  356    522   
        #[allow(unused_mut)]
  357    523   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
  358    524   
        let config = crate::service::JsonRpc10Config::builder().build();
  359    525   
        let service = crate::service::JsonRpc10::builder::<::hyper::body::Body, _, _, _>(config)
  360         -
            .json_unions(move |input: crate::input::JsonUnionsInput| {
         526  +
            .operation_with_defaults(move |input: crate::input::OperationWithDefaultsInput| {
  361    527   
                let sender = sender.clone();
  362    528   
                async move {
  363    529   
                    let result = {
  364         -
                        let expected = crate::input::JsonUnionsInput {
  365         -
                            contents: ::std::option::Option::Some(
  366         -
                                crate::model::MyUnion::NumberValue(1),
  367         -
                            ),
  368         -
                        };
  369         -
                        ::pretty_assertions::assert_eq!(input, expected);
  370         -
                        let response = crate::output::JsonUnionsOutput {
  371         -
                            contents: ::std::option::Option::None,
  372         -
                        };
  373         -
                        Ok(response)
  374         -
                    };
  375         -
                    sender.send(()).await.expect("receiver dropped early");
  376         -
                    result
  377         -
                }
  378         -
            })
  379         -
            .build_unchecked();
  380         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
  381         -
            .await
  382         -
            .expect("unable to make an HTTP request");
  383         -
        assert!(receiver.recv().await.is_some());
  384         -
    }
  385         -
    /// Serializes a blob union value
  386         -
    /// Test ID: AwsJson10SerializeBlobUnionValue
  387         -
    #[::tokio::test]
  388         -
    async fn aws_json10_serialize_blob_union_value_request() {
  389         -
        #[allow(unused_mut)]
  390         -
        let mut http_request = http::Request::builder()
  391         -
            .uri("/")
  392         -
            .method("POST")
  393         -
            .header("Content-Type", "application/x-amz-json-1.0")
  394         -
            .header("X-Amz-Target", "JsonRpc10.JsonUnions")
  395         -
            .body(::aws_smithy_http_server::body::Body::from(
  396         -
                ::bytes::Bytes::from_static(
  397         -
                    "{\n    \"contents\": {\n        \"blobValue\": \"Zm9v\"\n    }\n}".as_bytes(),
  398         -
                ),
  399         -
            ))
  400         -
            .unwrap();
  401         -
        #[allow(unused_mut)]
  402         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
  403         -
        let config = crate::service::JsonRpc10Config::builder().build();
  404         -
        let service = crate::service::JsonRpc10::builder::<::hyper::body::Body, _, _, _>(config)
  405         -
            .json_unions(move |input: crate::input::JsonUnionsInput| {
  406         -
                let sender = sender.clone();
  407         -
                async move {
  408         -
                    let result = {
  409         -
                        let expected = crate::input::JsonUnionsInput {
  410         -
                            contents: ::std::option::Option::Some(
  411         -
                                crate::model::MyUnion::BlobValue(::aws_smithy_types::Blob::new(
  412         -
                                    "foo",
  413         -
                                )),
  414         -
                            ),
         530  +
                        let expected = crate::input::OperationWithDefaultsInput {
         531  +
                            defaults: ::std::option::Option::Some(crate::model::Defaults {
         532  +
                                default_string: "hi".to_owned(),
         533  +
                                default_boolean: true,
         534  +
                                default_list: vec![],
         535  +
                                default_document_map: {
         536  +
                                    let json_bytes = br#"{}"#;
         537  +
                                    let mut tokens =
         538  +
                                        ::aws_smithy_json::deserialize::json_token_iter(json_bytes)
         539  +
                                            .peekable();
         540  +
                                    ::aws_smithy_json::deserialize::token::expect_document(
         541  +
                                        &mut tokens,
         542  +
                                    )
         543  +
                                    .expect("well formed json")
         544  +
                                },
         545  +
                                default_document_string: {
         546  +
                                    let json_bytes = br#""hi""#;
         547  +
                                    let mut tokens =
         548  +
                                        ::aws_smithy_json::deserialize::json_token_iter(json_bytes)
         549  +
                                            .peekable();
         550  +
                                    ::aws_smithy_json::deserialize::token::expect_document(
         551  +
                                        &mut tokens,
         552  +
                                    )
         553  +
                                    .expect("well formed json")
         554  +
                                },
         555  +
                                default_document_boolean: {
         556  +
                                    let json_bytes = br#"true"#;
         557  +
                                    let mut tokens =
         558  +
                                        ::aws_smithy_json::deserialize::json_token_iter(json_bytes)
         559  +
                                            .peekable();
         560  +
                                    ::aws_smithy_json::deserialize::token::expect_document(
         561  +
                                        &mut tokens,
         562  +
                                    )
         563  +
                                    .expect("well formed json")
         564  +
                                },
         565  +
                                default_document_list: {
         566  +
                                    let json_bytes = br#"[]"#;
         567  +
                                    let mut tokens =
         568  +
                                        ::aws_smithy_json::deserialize::json_token_iter(json_bytes)
         569  +
                                            .peekable();
         570  +
                                    ::aws_smithy_json::deserialize::token::expect_document(
         571  +
                                        &mut tokens,
         572  +
                                    )
         573  +
                                    .expect("well formed json")
         574  +
                                },
         575  +
                                default_timestamp:
         576  +
                                    ::aws_smithy_types::DateTime::from_fractional_secs(0, 0_f64),
         577  +
                                default_blob: ::aws_smithy_types::Blob::new("abc"),
         578  +
                                default_byte: 1,
         579  +
                                default_short: 1,
         580  +
                                default_integer: 10,
         581  +
                                default_long: 100,
         582  +
                                default_float: 1.0_f32,
         583  +
                                default_double: 1.0_f64,
         584  +
                                default_map: ::std::collections::HashMap::new(),
         585  +
                                default_enum: "FOO"
         586  +
                                    .parse::<crate::model::TestEnum>()
         587  +
                                    .expect("static value validated to member"),
         588  +
                                default_int_enum: 1,
         589  +
                                empty_string: "".to_owned(),
         590  +
                                false_boolean: false,
         591  +
                                empty_blob: ::aws_smithy_types::Blob::new(""),
         592  +
                                zero_byte: 0,
         593  +
                                zero_short: 0,
         594  +
                                zero_integer: 0,
         595  +
                                zero_long: 0,
         596  +
                                zero_float: 0.0_f32,
         597  +
                                zero_double: 0.0_f64,
         598  +
                                default_null_document: ::std::option::Option::Some({
         599  +
                                    let json_bytes = br#"null"#;
         600  +
                                    let mut tokens =
         601  +
                                        ::aws_smithy_json::deserialize::json_token_iter(json_bytes)
         602  +
                                            .peekable();
         603  +
                                    ::aws_smithy_json::deserialize::token::expect_document(
         604  +
                                        &mut tokens,
         605  +
                                    )
         606  +
                                    .expect("well formed json")
         607  +
                                }),
         608  +
                            }),
         609  +
                            top_level_default: "hi".to_owned(),
         610  +
                            other_top_level_default: 0,
         611  +
                            client_optional_defaults: ::std::option::Option::None,
  415    612   
                        };
  416    613   
                        ::pretty_assertions::assert_eq!(input, expected);
  417         -
                        let response = crate::output::JsonUnionsOutput {
  418         -
                            contents: ::std::option::Option::None,
  419         -
                        };
  420         -
                        Ok(response)
  421         -
                    };
  422         -
                    sender.send(()).await.expect("receiver dropped early");
  423         -
                    result
  424         -
                }
  425         -
            })
  426         -
            .build_unchecked();
  427         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
  428         -
            .await
  429         -
            .expect("unable to make an HTTP request");
  430         -
        assert!(receiver.recv().await.is_some());
  431         -
    }
  432         -
    /// Serializes a timestamp union value
  433         -
    /// Test ID: AwsJson10SerializeTimestampUnionValue
  434         -
    #[::tokio::test]
  435         -
    async fn aws_json10_serialize_timestamp_union_value_request() {
  436         -
        #[allow(unused_mut)]
  437         -
        let mut http_request = http::Request::builder()
  438         -
            .uri("/")
  439         -
            .method("POST")
  440         -
            .header("Content-Type", "application/x-amz-json-1.0")
  441         -
            .header("X-Amz-Target", "JsonRpc10.JsonUnions")
  442         -
            .body(::aws_smithy_http_server::body::Body::from(
  443         -
                ::bytes::Bytes::from_static(
  444         -
                    "{\n    \"contents\": {\n        \"timestampValue\": 1398796238\n    }\n}"
  445         -
                        .as_bytes(),
  446         -
                ),
  447         -
            ))
  448         -
            .unwrap();
  449         -
        #[allow(unused_mut)]
  450         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
  451         -
        let config = crate::service::JsonRpc10Config::builder().build();
  452         -
        let service = crate::service::JsonRpc10::builder::<::hyper::body::Body, _, _, _>(config)
  453         -
            .json_unions(move |input: crate::input::JsonUnionsInput| {
  454         -
                let sender = sender.clone();
  455         -
                async move {
  456         -
                    let result = {
  457         -
                        let expected = crate::input::JsonUnionsInput {
  458         -
                            contents: ::std::option::Option::Some(
  459         -
                                crate::model::MyUnion::TimestampValue(
  460         -
                                    ::aws_smithy_types::DateTime::from_fractional_secs(
  461         -
                                        1398796238, 0_f64,
  462         -
                                    ),
  463         -
                                ),
         614  +
                        let response = crate::output::OperationWithDefaultsOutput {
         615  +
                            default_string: "".to_owned(),
         616  +
                            default_boolean: false,
         617  +
                            default_list: vec![],
         618  +
                            default_document_map: {
         619  +
                                let json_bytes = br#"{}"#;
         620  +
                                let mut tokens =
         621  +
                                    ::aws_smithy_json::deserialize::json_token_iter(json_bytes)
         622  +
                                        .peekable();
         623  +
                                ::aws_smithy_json::deserialize::token::expect_document(&mut tokens)
         624  +
                                    .expect("well formed json")
         625  +
                            },
         626  +
                            default_document_string: {
         627  +
                                let json_bytes = br#"{}"#;
         628  +
                                let mut tokens =
         629  +
                                    ::aws_smithy_json::deserialize::json_token_iter(json_bytes)
         630  +
                                        .peekable();
         631  +
                                ::aws_smithy_json::deserialize::token::expect_document(&mut tokens)
         632  +
                                    .expect("well formed json")
         633  +
                            },
         634  +
                            default_document_boolean: {
         635  +
                                let json_bytes = br#"{}"#;
         636  +
                                let mut tokens =
         637  +
                                    ::aws_smithy_json::deserialize::json_token_iter(json_bytes)
         638  +
                                        .peekable();
         639  +
                                ::aws_smithy_json::deserialize::token::expect_document(&mut tokens)
         640  +
                                    .expect("well formed json")
         641  +
                            },
         642  +
                            default_document_list: {
         643  +
                                let json_bytes = br#"{}"#;
         644  +
                                let mut tokens =
         645  +
                                    ::aws_smithy_json::deserialize::json_token_iter(json_bytes)
         646  +
                                        .peekable();
         647  +
                                ::aws_smithy_json::deserialize::token::expect_document(&mut tokens)
         648  +
                                    .expect("well formed json")
         649  +
                            },
         650  +
                            default_timestamp: ::aws_smithy_types::DateTime::from_fractional_secs(
         651  +
                                0, 0_f64,
  464    652   
                            ),
  465         -
                        };
  466         -
                        ::pretty_assertions::assert_eq!(input, expected);
  467         -
                        let response = crate::output::JsonUnionsOutput {
  468         -
                            contents: ::std::option::Option::None,
         653  +
                            default_blob: ::aws_smithy_types::Blob::new(""),
         654  +
                            default_byte: 0,
         655  +
                            default_short: 0,
         656  +
                            default_integer: 0,
         657  +
                            default_long: 0,
         658  +
                            default_float: 0_f32,
         659  +
                            default_double: 0_f64,
         660  +
                            default_map: ::std::collections::HashMap::new(),
         661  +
                            default_enum: ""
         662  +
                                .parse::<crate::model::TestEnum>()
         663  +
                                .expect("static value validated to member"),
         664  +
                            default_int_enum: 0,
         665  +
                            empty_string: "".to_owned(),
         666  +
                            false_boolean: false,
         667  +
                            empty_blob: ::aws_smithy_types::Blob::new(""),
         668  +
                            zero_byte: 0,
         669  +
                            zero_short: 0,
         670  +
                            zero_integer: 0,
         671  +
                            zero_long: 0,
         672  +
                            zero_float: 0_f32,
         673  +
                            zero_double: 0_f64,
         674  +
                            default_null_document: ::std::option::Option::Some({
         675  +
                                let json_bytes = br#"null"#;
         676  +
                                let mut tokens =
         677  +
                                    ::aws_smithy_json::deserialize::json_token_iter(json_bytes)
         678  +
                                        .peekable();
         679  +
                                ::aws_smithy_json::deserialize::token::expect_document(&mut tokens)
         680  +
                                    .expect("well formed json")
         681  +
                            }),
  469    682   
                        };
  470    683   
                        Ok(response)
  471    684   
                    };
  472    685   
                    sender.send(()).await.expect("receiver dropped early");
  473    686   
                    result
  474    687   
                }
  475    688   
            })
  476    689   
            .build_unchecked();
  477    690   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
  478    691   
            .await
  479    692   
            .expect("unable to make an HTTP request");
  480         -
        assert!(receiver.recv().await.is_some());
         693  +
        assert!(
         694  +
            receiver.recv().await.is_some(),
         695  +
            "we expected operation handler to be invoked but it was not entered"
         696  +
        );
  481    697   
    }
  482         -
    /// Serializes an enum union value
  483         -
    /// Test ID: AwsJson10SerializeEnumUnionValue
  484         -
    #[::tokio::test]
  485         -
    async fn aws_json10_serialize_enum_union_value_request() {
  486         -
        #[allow(unused_mut)]
  487         -
        let mut http_request = http::Request::builder()
  488         -
            .uri("/")
  489         -
            .method("POST")
  490         -
            .header("Content-Type", "application/x-amz-json-1.0")
  491         -
            .header("X-Amz-Target", "JsonRpc10.JsonUnions")
  492         -
            .body(::aws_smithy_http_server::body::Body::from(
  493         -
                ::bytes::Bytes::from_static(
  494         -
                    "{\n    \"contents\": {\n        \"enumValue\": \"Foo\"\n    }\n}".as_bytes(),
  495         -
                ),
  496         -
            ))
  497         -
            .unwrap();
  498         -
        #[allow(unused_mut)]
  499         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
  500         -
        let config = crate::service::JsonRpc10Config::builder().build();
  501         -
        let service = crate::service::JsonRpc10::builder::<::hyper::body::Body, _, _, _>(config)
  502         -
            .json_unions(move |input: crate::input::JsonUnionsInput| {
  503         -
                let sender = sender.clone();
  504         -
                async move {
  505         -
                    let result = {
  506         -
                        let expected = crate::input::JsonUnionsInput {
  507         -
                            contents: ::std::option::Option::Some(
  508         -
                                crate::model::MyUnion::EnumValue(
  509         -
                                    "Foo"
  510         -
                                        .parse::<crate::model::FooEnum>()
  511         -
                                        .expect("static value validated to member"),
  512         -
                                ),
  513         -
                            ),
  514         -
                        };
  515         -
                        ::pretty_assertions::assert_eq!(input, expected);
  516         -
                        let response = crate::output::JsonUnionsOutput {
  517         -
                            contents: ::std::option::Option::None,
  518         -
                        };
  519         -
                        Ok(response)
  520         -
                    };
  521         -
                    sender.send(()).await.expect("receiver dropped early");
  522         -
                    result
  523         -
                }
  524         -
            })
  525         -
            .build_unchecked();
  526         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
  527         -
            .await
  528         -
            .expect("unable to make an HTTP request");
  529         -
        assert!(receiver.recv().await.is_some());
  530         -
    }
  531         -
    /// Serializes an intEnum union value
  532         -
    /// Test ID: AwsJson10SerializeIntEnumUnionValue
  533         -
    #[::tokio::test]
  534         -
    async fn aws_json10_serialize_int_enum_union_value_request() {
  535         -
        #[allow(unused_mut)]
  536         -
        let mut http_request = http::Request::builder()
  537         -
            .uri("/")
  538         -
            .method("POST")
  539         -
            .header("Content-Type", "application/x-amz-json-1.0")
  540         -
            .header("X-Amz-Target", "JsonRpc10.JsonUnions")
  541         -
            .body(::aws_smithy_http_server::body::Body::from(
  542         -
                ::bytes::Bytes::from_static(
  543         -
                    "{\n    \"contents\": {\n        \"intEnumValue\": 1\n    }\n}".as_bytes(),
  544         -
                ),
  545         -
            ))
  546         -
            .unwrap();
  547         -
        #[allow(unused_mut)]
  548         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
  549         -
        let config = crate::service::JsonRpc10Config::builder().build();
  550         -
        let service = crate::service::JsonRpc10::builder::<::hyper::body::Body, _, _, _>(config)
  551         -
            .json_unions(move |input: crate::input::JsonUnionsInput| {
  552         -
                let sender = sender.clone();
  553         -
                async move {
  554         -
                    let result = {
  555         -
                        let expected = crate::input::JsonUnionsInput {
  556         -
                            contents: ::std::option::Option::Some(
  557         -
                                crate::model::MyUnion::IntEnumValue(1),
  558         -
                            ),
  559         -
                        };
  560         -
                        ::pretty_assertions::assert_eq!(input, expected);
  561         -
                        let response = crate::output::JsonUnionsOutput {
  562         -
                            contents: ::std::option::Option::None,
  563         -
                        };
  564         -
                        Ok(response)
  565         -
                    };
  566         -
                    sender.send(()).await.expect("receiver dropped early");
  567         -
                    result
  568         -
                }
  569         -
            })
  570         -
            .build_unchecked();
  571         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
  572         -
            .await
  573         -
            .expect("unable to make an HTTP request");
  574         -
        assert!(receiver.recv().await.is_some());
  575         -
    }
  576         -
    /// Serializes a list union value
  577         -
    /// Test ID: AwsJson10SerializeListUnionValue
  578         -
    #[::tokio::test]
  579         -
    async fn aws_json10_serialize_list_union_value_request() {
  580         -
        #[allow(unused_mut)]
  581         -
        let mut http_request = http::Request::builder()
  582         -
            .uri("/")
  583         -
            .method("POST")
  584         -
            .header("Content-Type", "application/x-amz-json-1.0")
  585         -
            .header("X-Amz-Target", "JsonRpc10.JsonUnions")
  586         -
            .body(::aws_smithy_http_server::body::Body::from(
  587         -
                ::bytes::Bytes::from_static(
  588         -
                    "{\n    \"contents\": {\n        \"listValue\": [\"foo\", \"bar\"]\n    }\n}"
  589         -
                        .as_bytes(),
  590         -
                ),
  591         -
            ))
  592         -
            .unwrap();
  593         -
        #[allow(unused_mut)]
  594         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
  595         -
        let config = crate::service::JsonRpc10Config::builder().build();
  596         -
        let service = crate::service::JsonRpc10::builder::<::hyper::body::Body, _, _, _>(config)
  597         -
            .json_unions(move |input: crate::input::JsonUnionsInput| {
  598         -
                let sender = sender.clone();
  599         -
                async move {
  600         -
                    let result = {
  601         -
                        let expected = crate::input::JsonUnionsInput {
  602         -
                            contents: ::std::option::Option::Some(
  603         -
                                crate::model::MyUnion::ListValue(vec![
  604         -
                                    "foo".to_owned(),
  605         -
                                    "bar".to_owned(),
  606         -
                                ]),
  607         -
                            ),
  608         -
                        };
  609         -
                        ::pretty_assertions::assert_eq!(input, expected);
  610         -
                        let response = crate::output::JsonUnionsOutput {
  611         -
                            contents: ::std::option::Option::None,
  612         -
                        };
  613         -
                        Ok(response)
  614         -
                    };
  615         -
                    sender.send(()).await.expect("receiver dropped early");
  616         -
                    result
  617         -
                }
  618         -
            })
  619         -
            .build_unchecked();
  620         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
  621         -
            .await
  622         -
            .expect("unable to make an HTTP request");
  623         -
        assert!(receiver.recv().await.is_some());
  624         -
    }
  625         -
    /// Serializes a map union value
  626         -
    /// Test ID: AwsJson10SerializeMapUnionValue
  627         -
    #[::tokio::test]
  628         -
    async fn aws_json10_serialize_map_union_value_request() {
  629         -
        #[allow(unused_mut)]
  630         -
                    let mut http_request = http::Request::builder()
  631         -
                        .uri("/")
  632         -
                        .method("POST")
  633         -
        .header("Content-Type", "application/x-amz-json-1.0")
  634         -
        .header("X-Amz-Target", "JsonRpc10.JsonUnions")
  635         -
        .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();
  636         -
        #[allow(unused_mut)]
  637         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
  638         -
        let config = crate::service::JsonRpc10Config::builder().build();
  639         -
        let service = crate::service::JsonRpc10::builder::<::hyper::body::Body, _, _, _>(config)
  640         -
            .json_unions(move |input: crate::input::JsonUnionsInput| {
  641         -
                let sender = sender.clone();
  642         -
                async move {
  643         -
                    let result = {
  644         -
                        let expected = crate::input::JsonUnionsInput {
  645         -
                            contents: ::std::option::Option::Some(crate::model::MyUnion::MapValue(
  646         -
                                {
  647         -
                                    let mut ret = ::std::collections::HashMap::new();
  648         -
                                    ret.insert("foo".to_owned(), "bar".to_owned());
  649         -
                                    ret.insert("spam".to_owned(), "eggs".to_owned());
  650         -
                                    ret
  651         -
                                },
  652         -
                            )),
  653         -
                        };
  654         -
                        ::pretty_assertions::assert_eq!(input, expected);
  655         -
                        let response = crate::output::JsonUnionsOutput {
  656         -
                            contents: ::std::option::Option::None,
  657         -
                        };
  658         -
                        Ok(response)
  659         -
                    };
  660         -
                    sender.send(()).await.expect("receiver dropped early");
  661         -
                    result
  662         -
                }
  663         -
            })
  664         -
            .build_unchecked();
  665         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
  666         -
            .await
  667         -
            .expect("unable to make an HTTP request");
  668         -
        assert!(receiver.recv().await.is_some());
  669         -
    }
  670         -
    /// Serializes a structure union value
  671         -
    /// Test ID: AwsJson10SerializeStructureUnionValue
  672         -
    #[::tokio::test]
  673         -
    async fn aws_json10_serialize_structure_union_value_request() {
  674         -
        #[allow(unused_mut)]
  675         -
                    let mut http_request = http::Request::builder()
  676         -
                        .uri("/")
  677         -
                        .method("POST")
  678         -
        .header("Content-Type", "application/x-amz-json-1.0")
  679         -
        .header("X-Amz-Target", "JsonRpc10.JsonUnions")
  680         -
        .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();
  681         -
        #[allow(unused_mut)]
  682         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
  683         -
        let config = crate::service::JsonRpc10Config::builder().build();
  684         -
        let service = crate::service::JsonRpc10::builder::<::hyper::body::Body, _, _, _>(config)
  685         -
            .json_unions(move |input: crate::input::JsonUnionsInput| {
  686         -
                let sender = sender.clone();
  687         -
                async move {
  688         -
                    let result = {
  689         -
                        let expected = crate::input::JsonUnionsInput {
  690         -
                            contents: ::std::option::Option::Some(
  691         -
                                crate::model::MyUnion::StructureValue(
  692         -
                                    crate::model::GreetingStruct {
  693         -
                                        hi: ::std::option::Option::Some("hello".to_owned()),
  694         -
                                    },
  695         -
                                ),
  696         -
                            ),
  697         -
                        };
  698         -
                        ::pretty_assertions::assert_eq!(input, expected);
  699         -
                        let response = crate::output::JsonUnionsOutput {
  700         -
                            contents: ::std::option::Option::None,
  701         -
                        };
  702         -
                        Ok(response)
  703         -
                    };
  704         -
                    sender.send(()).await.expect("receiver dropped early");
  705         -
                    result
  706         -
                }
  707         -
            })
  708         -
            .build_unchecked();
  709         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
  710         -
            .await
  711         -
            .expect("unable to make an HTTP request");
  712         -
        assert!(receiver.recv().await.is_some());
  713         -
    }
  714         -
    /// Deserializes a string union value
  715         -
    /// Test ID: AwsJson10DeserializeStringUnionValue
  716         -
    #[::tokio::test]
  717         -
    async fn aws_json10_deserialize_string_union_value_response() {
  718         -
        let output = crate::output::JsonUnionsOutput {
  719         -
            contents: ::std::option::Option::Some(crate::model::MyUnion::StringValue(
  720         -
                "foo".to_owned(),
  721         -
            )),
  722         -
        };
  723         -
        use ::aws_smithy_http_server::response::IntoResponse;
  724         -
        let http_response = output.into_response();
  725         -
        ::pretty_assertions::assert_eq!(
  726         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
  727         -
            http_response.status()
  728         -
        );
  729         -
        let expected_headers = [("Content-Type", "application/x-amz-json-1.0")];
  730         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
  731         -
            http_response.headers(),
  732         -
            expected_headers,
  733         -
        ));
  734         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
  735         -
            .await
  736         -
            .expect("unable to extract body to bytes");
  737         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
  738         -
            &body,
  739         -
            "{\n    \"contents\": {\n        \"stringValue\": \"foo\"\n    }\n}",
  740         -
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
  741         -
        ));
  742         -
    }
  743         -
    /// Deserializes a boolean union value
  744         -
    /// Test ID: AwsJson10DeserializeBooleanUnionValue
  745         -
    #[::tokio::test]
  746         -
    async fn aws_json10_deserialize_boolean_union_value_response() {
  747         -
        let output = crate::output::JsonUnionsOutput {
  748         -
            contents: ::std::option::Option::Some(crate::model::MyUnion::BooleanValue(true)),
  749         -
        };
  750         -
        use ::aws_smithy_http_server::response::IntoResponse;
  751         -
        let http_response = output.into_response();
  752         -
        ::pretty_assertions::assert_eq!(
  753         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
  754         -
            http_response.status()
  755         -
        );
  756         -
        let expected_headers = [("Content-Type", "application/x-amz-json-1.0")];
  757         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
  758         -
            http_response.headers(),
  759         -
            expected_headers,
  760         -
        ));
  761         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
  762         -
            .await
  763         -
            .expect("unable to extract body to bytes");
  764         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
  765         -
            &body,
  766         -
            "{\n    \"contents\": {\n        \"booleanValue\": true\n    }\n}",
  767         -
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
  768         -
        ));
  769         -
    }
  770         -
    /// Deserializes a number union value
  771         -
    /// Test ID: AwsJson10DeserializeNumberUnionValue
  772         -
    #[::tokio::test]
  773         -
    async fn aws_json10_deserialize_number_union_value_response() {
  774         -
        let output = crate::output::JsonUnionsOutput {
  775         -
            contents: ::std::option::Option::Some(crate::model::MyUnion::NumberValue(1)),
  776         -
        };
  777         -
        use ::aws_smithy_http_server::response::IntoResponse;
  778         -
        let http_response = output.into_response();
  779         -
        ::pretty_assertions::assert_eq!(
  780         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
  781         -
            http_response.status()
  782         -
        );
  783         -
        let expected_headers = [("Content-Type", "application/x-amz-json-1.0")];
  784         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
  785         -
            http_response.headers(),
  786         -
            expected_headers,
  787         -
        ));
  788         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
  789         -
            .await
  790         -
            .expect("unable to extract body to bytes");
  791         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
  792         -
            &body,
  793         -
            "{\n    \"contents\": {\n        \"numberValue\": 1\n    }\n}",
  794         -
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
  795         -
        ));
  796         -
    }
  797         -
    /// Deserializes a blob union value
  798         -
    /// Test ID: AwsJson10DeserializeBlobUnionValue
  799         -
    #[::tokio::test]
  800         -
    async fn aws_json10_deserialize_blob_union_value_response() {
  801         -
        let output = crate::output::JsonUnionsOutput {
  802         -
            contents: ::std::option::Option::Some(crate::model::MyUnion::BlobValue(
  803         -
                ::aws_smithy_types::Blob::new("foo"),
  804         -
            )),
  805         -
        };
  806         -
        use ::aws_smithy_http_server::response::IntoResponse;
  807         -
        let http_response = output.into_response();
  808         -
        ::pretty_assertions::assert_eq!(
  809         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
  810         -
            http_response.status()
  811         -
        );
  812         -
        let expected_headers = [("Content-Type", "application/x-amz-json-1.0")];
  813         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
  814         -
            http_response.headers(),
  815         -
            expected_headers,
  816         -
        ));
  817         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
  818         -
            .await
  819         -
            .expect("unable to extract body to bytes");
  820         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
  821         -
            &body,
  822         -
            "{\n    \"contents\": {\n        \"blobValue\": \"Zm9v\"\n    }\n}",
  823         -
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
  824         -
        ));
  825         -
    }
  826         -
    /// Deserializes a timestamp union value
  827         -
    /// Test ID: AwsJson10DeserializeTimestampUnionValue
  828         -
    #[::tokio::test]
  829         -
    async fn aws_json10_deserialize_timestamp_union_value_response() {
  830         -
        let output = crate::output::JsonUnionsOutput {
  831         -
            contents: ::std::option::Option::Some(crate::model::MyUnion::TimestampValue(
  832         -
                ::aws_smithy_types::DateTime::from_fractional_secs(1398796238, 0_f64),
  833         -
            )),
  834         -
        };
  835         -
        use ::aws_smithy_http_server::response::IntoResponse;
  836         -
        let http_response = output.into_response();
  837         -
        ::pretty_assertions::assert_eq!(
  838         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
  839         -
            http_response.status()
  840         -
        );
  841         -
        let expected_headers = [("Content-Type", "application/x-amz-json-1.0")];
  842         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
  843         -
            http_response.headers(),
  844         -
            expected_headers,
  845         -
        ));
  846         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
  847         -
            .await
  848         -
            .expect("unable to extract body to bytes");
  849         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
  850         -
            &body,
  851         -
            "{\n    \"contents\": {\n        \"timestampValue\": 1398796238\n    }\n}",
  852         -
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
  853         -
        ));
  854         -
    }
  855         -
    /// Deserializes an enum union value
  856         -
    /// Test ID: AwsJson10DeserializeEnumUnionValue
  857         -
    #[::tokio::test]
  858         -
    async fn aws_json10_deserialize_enum_union_value_response() {
  859         -
        let output = crate::output::JsonUnionsOutput {
  860         -
            contents: ::std::option::Option::Some(crate::model::MyUnion::EnumValue(
  861         -
                "Foo"
  862         -
                    .parse::<crate::model::FooEnum>()
  863         -
                    .expect("static value validated to member"),
  864         -
            )),
  865         -
        };
  866         -
        use ::aws_smithy_http_server::response::IntoResponse;
  867         -
        let http_response = output.into_response();
  868         -
        ::pretty_assertions::assert_eq!(
  869         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
  870         -
            http_response.status()
  871         -
        );
  872         -
        let expected_headers = [("Content-Type", "application/x-amz-json-1.0")];
  873         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
  874         -
            http_response.headers(),
  875         -
            expected_headers,
  876         -
        ));
  877         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
  878         -
            .await
  879         -
            .expect("unable to extract body to bytes");
  880         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
  881         -
            &body,
  882         -
            "{\n    \"contents\": {\n        \"enumValue\": \"Foo\"\n    }\n}",
  883         -
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
  884         -
        ));
  885         -
    }
  886         -
    /// Deserializes an intEnum union value
  887         -
    /// Test ID: AwsJson10DeserializeIntEnumUnionValue
  888         -
    #[::tokio::test]
  889         -
    async fn aws_json10_deserialize_int_enum_union_value_response() {
  890         -
        let output = crate::output::JsonUnionsOutput {
  891         -
            contents: ::std::option::Option::Some(crate::model::MyUnion::IntEnumValue(1)),
  892         -
        };
  893         -
        use ::aws_smithy_http_server::response::IntoResponse;
  894         -
        let http_response = output.into_response();
  895         -
        ::pretty_assertions::assert_eq!(
  896         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
  897         -
            http_response.status()
  898         -
        );
  899         -
        let expected_headers = [("Content-Type", "application/x-amz-json-1.0")];
  900         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
  901         -
            http_response.headers(),
  902         -
            expected_headers,
  903         -
        ));
  904         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
  905         -
            .await
  906         -
            .expect("unable to extract body to bytes");
  907         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
  908         -
            &body,
  909         -
            "{\n    \"contents\": {\n        \"intEnumValue\": 1\n    }\n}",
  910         -
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
  911         -
        ));
  912         -
    }
  913         -
    /// Deserializes a list union value
  914         -
    /// Test ID: AwsJson10DeserializeListUnionValue
  915         -
    #[::tokio::test]
  916         -
    async fn aws_json10_deserialize_list_union_value_response() {
  917         -
        let output = crate::output::JsonUnionsOutput {
  918         -
            contents: ::std::option::Option::Some(crate::model::MyUnion::ListValue(vec![
  919         -
                "foo".to_owned(),
  920         -
                "bar".to_owned(),
  921         -
            ])),
  922         -
        };
  923         -
        use ::aws_smithy_http_server::response::IntoResponse;
  924         -
        let http_response = output.into_response();
  925         -
        ::pretty_assertions::assert_eq!(
  926         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
  927         -
            http_response.status()
  928         -
        );
  929         -
        let expected_headers = [("Content-Type", "application/x-amz-json-1.0")];
  930         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
  931         -
            http_response.headers(),
  932         -
            expected_headers,
  933         -
        ));
  934         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
  935         -
            .await
  936         -
            .expect("unable to extract body to bytes");
  937         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
  938         -
            &body,
  939         -
            "{\n    \"contents\": {\n        \"listValue\": [\"foo\", \"bar\"]\n    }\n}",
  940         -
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
  941         -
        ));
  942         -
    }
  943         -
    /// Deserializes a map union value
  944         -
    /// Test ID: AwsJson10DeserializeMapUnionValue
  945         -
    #[::tokio::test]
  946         -
    async fn aws_json10_deserialize_map_union_value_response() {
  947         -
        let output = crate::output::JsonUnionsOutput {
  948         -
            contents: ::std::option::Option::Some(crate::model::MyUnion::MapValue({
  949         -
                let mut ret = ::std::collections::HashMap::new();
  950         -
                ret.insert("foo".to_owned(), "bar".to_owned());
  951         -
                ret.insert("spam".to_owned(), "eggs".to_owned());
  952         -
                ret
  953         -
            })),
  954         -
        };
  955         -
        use ::aws_smithy_http_server::response::IntoResponse;
  956         -
        let http_response = output.into_response();
  957         -
        ::pretty_assertions::assert_eq!(
  958         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
  959         -
            http_response.status()
  960         -
        );
  961         -
        let expected_headers = [("Content-Type", "application/x-amz-json-1.0")];
  962         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
  963         -
            http_response.headers(),
  964         -
            expected_headers,
  965         -
        ));
  966         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
  967         -
            .await
  968         -
            .expect("unable to extract body to bytes");
  969         -
        ::aws_smithy_protocol_test::assert_ok(
  970         -
        ::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"))
  971         -
        );
  972         -
    }
  973         -
    /// Deserializes a structure union value
  974         -
    /// Test ID: AwsJson10DeserializeStructureUnionValue
  975         -
    #[::tokio::test]
  976         -
    async fn aws_json10_deserialize_structure_union_value_response() {
  977         -
        let output = crate::output::JsonUnionsOutput {
  978         -
            contents: ::std::option::Option::Some(crate::model::MyUnion::StructureValue(
  979         -
                crate::model::GreetingStruct {
  980         -
                    hi: ::std::option::Option::Some("hello".to_owned()),
  981         -
                },
  982         -
            )),
  983         -
        };
  984         -
        use ::aws_smithy_http_server::response::IntoResponse;
  985         -
        let http_response = output.into_response();
  986         -
        ::pretty_assertions::assert_eq!(
  987         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
  988         -
            http_response.status()
  989         -
        );
  990         -
        let expected_headers = [("Content-Type", "application/x-amz-json-1.0")];
  991         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
  992         -
            http_response.headers(),
  993         -
            expected_headers,
  994         -
        ));
  995         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
  996         -
            .await
  997         -
            .expect("unable to extract body to bytes");
  998         -
        ::aws_smithy_protocol_test::assert_ok(
  999         -
        ::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"))
 1000         -
        );
 1001         -
    }
 1002         -
}
 1003         -
#[cfg(test)]
 1004         -
#[allow(unreachable_code, unused_variables)]
 1005         -
mod server_no_input_and_no_output_test {
 1006         -
    /// Clients must always send an empty JSON object payload for
 1007         -
    /// operations with no input (that is, `{}`). While AWS service
 1008         -
    /// implementations support requests with no payload or requests
 1009         -
    /// that send `{}`, always sending `{}` from the client is
 1010         -
    /// preferred for forward compatibility in case input is ever
 1011         -
    /// added to an operation.
 1012         -
    /// Test ID: AwsJson10MustAlwaysSendEmptyJsonPayload
 1013         -
    #[::tokio::test]
 1014         -
    async fn aws_json10_must_always_send_empty_json_payload_request() {
 1015         -
        #[allow(unused_mut)]
 1016         -
        let mut http_request = http::Request::builder()
 1017         -
            .uri("/")
 1018         -
            .method("POST")
 1019         -
            .header("Content-Type", "application/x-amz-json-1.0")
 1020         -
            .header("X-Amz-Target", "JsonRpc10.NoInputAndNoOutput")
 1021         -
            .body(::aws_smithy_http_server::body::Body::from(
 1022         -
                ::bytes::Bytes::from_static("{}".as_bytes()),
 1023         -
            ))
 1024         -
            .unwrap();
 1025         -
        #[allow(unused_mut)]
 1026         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 1027         -
        let config = crate::service::JsonRpc10Config::builder().build();
 1028         -
        let service = crate::service::JsonRpc10::builder::<::hyper::body::Body, _, _, _>(config)
 1029         -
            .no_input_and_no_output(move |input: crate::input::NoInputAndNoOutputInput| {
 1030         -
                let sender = sender.clone();
 1031         -
                async move {
 1032         -
                    let result = {
 1033         -
                        let expected = crate::input::NoInputAndNoOutputInput {};
 1034         -
                        ::pretty_assertions::assert_eq!(input, expected);
 1035         -
                        let response = crate::output::NoInputAndNoOutputOutput {};
 1036         -
                        response
 1037         -
                    };
 1038         -
                    sender.send(()).await.expect("receiver dropped early");
 1039         -
                    result
 1040         -
                }
 1041         -
            })
 1042         -
            .build_unchecked();
 1043         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 1044         -
            .await
 1045         -
            .expect("unable to make an HTTP request");
 1046         -
        assert!(receiver.recv().await.is_some());
 1047         -
    }
 1048         -
    /// Service implementations must support no payload or an empty
 1049         -
    /// object payload for operations that define no input. However,
 1050         -
    /// despite the lack of a payload, a Content-Type header is still
 1051         -
    /// required in order for the service to properly detect the
 1052         -
    /// protocol.
 1053         -
    /// Test ID: AwsJson10ServiceSupportsNoPayloadForNoInput
 1054         -
    #[::tokio::test]
 1055         -
    async fn aws_json10_service_supports_no_payload_for_no_input_request() {
 1056         -
        #[allow(unused_mut)]
 1057         -
        let mut http_request = http::Request::builder()
 1058         -
            .uri("/")
 1059         -
            .method("POST")
 1060         -
            .header("Content-Type", "application/x-amz-json-1.0")
 1061         -
            .header("X-Amz-Target", "JsonRpc10.NoInputAndNoOutput")
 1062         -
            .body(::aws_smithy_http_server::body::Body::from(
 1063         -
                ::bytes::Bytes::from_static("".as_bytes()),
 1064         -
            ))
 1065         -
            .unwrap();
 1066         -
        #[allow(unused_mut)]
 1067         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 1068         -
        let config = crate::service::JsonRpc10Config::builder().build();
 1069         -
        let service = crate::service::JsonRpc10::builder::<::hyper::body::Body, _, _, _>(config)
 1070         -
            .no_input_and_no_output(move |input: crate::input::NoInputAndNoOutputInput| {
 1071         -
                let sender = sender.clone();
 1072         -
                async move {
 1073         -
                    let result = {
 1074         -
                        let expected = crate::input::NoInputAndNoOutputInput {};
 1075         -
                        ::pretty_assertions::assert_eq!(input, expected);
 1076         -
                        let response = crate::output::NoInputAndNoOutputOutput {};
 1077         -
                        response
 1078         -
                    };
 1079         -
                    sender.send(()).await.expect("receiver dropped early");
 1080         -
                    result
 1081         -
                }
 1082         -
            })
 1083         -
            .build_unchecked();
 1084         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 1085         -
            .await
 1086         -
            .expect("unable to make an HTTP request");
 1087         -
        assert!(receiver.recv().await.is_some());
 1088         -
    }
 1089         -
    /// When no output is defined, the service is expected to return
 1090         -
    /// an empty payload. Despite the lack of a payload, the service
 1091         -
    /// is expected to always send a Content-Type header. Clients must
 1092         -
    /// handle cases where a service returns a JSON object and where
 1093         -
    /// a service returns no JSON at all.
 1094         -
    /// Test ID: AwsJson10ServiceRespondsWithNoPayload
 1095         -
    #[::tokio::test]
 1096         -
    async fn aws_json10_service_responds_with_no_payload_response() {
 1097         -
        let output = crate::output::NoInputAndNoOutputOutput {};
 1098         -
        use ::aws_smithy_http_server::response::IntoResponse;
 1099         -
        let http_response = output.into_response();
 1100         -
        ::pretty_assertions::assert_eq!(
 1101         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
 1102         -
            http_response.status()
 1103         -
        );
 1104         -
        let expected_headers = [("Content-Type", "application/x-amz-json-1.0")];
 1105         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 1106         -
            http_response.headers(),
 1107         -
            expected_headers,
 1108         -
        ));
 1109         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
 1110         -
            .await
 1111         -
            .expect("unable to extract body to bytes");
 1112         -
        // No body.
 1113         -
        ::pretty_assertions::assert_eq!(std::str::from_utf8(&body).unwrap(), "");
 1114         -
    }
 1115         -
}
 1116         -
#[cfg(test)]
 1117         -
#[allow(unreachable_code, unused_variables)]
 1118         -
mod server_no_input_and_output_test {
 1119         -
    /// A client should always send and empty JSON object payload.
 1120         -
    /// Test ID: AwsJson10NoInputAndOutput
 1121         -
    #[::tokio::test]
 1122         -
    async fn aws_json10_no_input_and_output_request() {
 1123         -
        #[allow(unused_mut)]
 1124         -
        let mut http_request = http::Request::builder()
 1125         -
            .uri("/")
 1126         -
            .method("POST")
 1127         -
            .header("Content-Type", "application/x-amz-json-1.0")
 1128         -
            .header("X-Amz-Target", "JsonRpc10.NoInputAndOutput")
 1129         -
            .body(::aws_smithy_http_server::body::Body::from(
 1130         -
                ::bytes::Bytes::from_static("{}".as_bytes()),
 1131         -
            ))
 1132         -
            .unwrap();
 1133         -
        #[allow(unused_mut)]
 1134         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 1135         -
        let config = crate::service::JsonRpc10Config::builder().build();
 1136         -
        let service = crate::service::JsonRpc10::builder::<::hyper::body::Body, _, _, _>(config)
 1137         -
            .no_input_and_output(move |input: crate::input::NoInputAndOutputInput| {
 1138         -
                let sender = sender.clone();
 1139         -
                async move {
 1140         -
                    let result = {
 1141         -
                        let expected = crate::input::NoInputAndOutputInput {};
 1142         -
                        ::pretty_assertions::assert_eq!(input, expected);
 1143         -
                        let response = crate::output::NoInputAndOutputOutput {};
 1144         -
                        response
 1145         -
                    };
 1146         -
                    sender.send(()).await.expect("receiver dropped early");
 1147         -
                    result
 1148         -
                }
 1149         -
            })
 1150         -
            .build_unchecked();
 1151         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 1152         -
            .await
 1153         -
            .expect("unable to make an HTTP request");
 1154         -
        assert!(receiver.recv().await.is_some());
 1155         -
    }
 1156         -
    /// Empty output always serializes an empty object payload.
 1157         -
    /// Test ID: AwsJson10NoInputAndOutput
 1158         -
    #[::tokio::test]
 1159         -
    async fn aws_json10_no_input_and_output_response() {
 1160         -
        let output = crate::output::NoInputAndOutputOutput {};
 1161         -
        use ::aws_smithy_http_server::response::IntoResponse;
 1162         -
        let http_response = output.into_response();
 1163         -
        ::pretty_assertions::assert_eq!(
 1164         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
 1165         -
            http_response.status()
 1166         -
        );
 1167         -
        let expected_headers = [("Content-Type", "application/x-amz-json-1.0")];
 1168         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 1169         -
            http_response.headers(),
 1170         -
            expected_headers,
 1171         -
        ));
 1172         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
 1173         -
            .await
 1174         -
            .expect("unable to extract body to bytes");
 1175         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
 1176         -
            &body,
 1177         -
            "{}",
 1178         -
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
 1179         -
        ));
 1180         -
    }
 1181         -
}
 1182         -
#[cfg(test)]
 1183         -
#[allow(unreachable_code, unused_variables)]
 1184         -
mod server_operation_with_defaults_test {
 1185         -
    /// Server populates default values when missing in request body.
 1186         -
    /// Test ID: AwsJson10ServerPopulatesDefaultsWhenMissingInRequestBody
 1187         -
    #[::tokio::test]
 1188         -
    #[should_panic]
 1189         -
    async fn aws_json10_server_populates_defaults_when_missing_in_request_body_request() {
 1190         -
        #[allow(unused_mut)]
 1191         -
        let mut http_request = http::Request::builder()
 1192         -
            .uri("/")
 1193         -
            .method("POST")
 1194         -
            .header("Content-Type", "application/x-amz-json-1.0")
 1195         -
            .body(::aws_smithy_http_server::body::Body::from(
 1196         -
                ::bytes::Bytes::from_static("{\n\"defaults\": {}\n}".as_bytes()),
 1197         -
            ))
 1198         -
            .unwrap();
 1199         -
        #[allow(unused_mut)]
 1200         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 1201         -
        let config = crate::service::JsonRpc10Config::builder().build();
 1202         -
        let service = crate::service::JsonRpc10::builder::<::hyper::body::Body, _, _, _>(config)
 1203         -
            .operation_with_defaults(move |input: crate::input::OperationWithDefaultsInput| {
 1204         -
                let sender = sender.clone();
 1205         -
                async move {
 1206         -
                    let result = {
 1207         -
                        let expected = crate::input::OperationWithDefaultsInput {
 1208         -
                            defaults: ::std::option::Option::Some(crate::model::Defaults {
 1209         -
                                default_string: "hi".to_owned(),
 1210         -
                                default_boolean: true,
 1211         -
                                default_list: vec![],
 1212         -
                                default_document_map: {
 1213         -
                                    let json_bytes = br#"{}"#;
 1214         -
                                    let mut tokens =
 1215         -
                                        ::aws_smithy_json::deserialize::json_token_iter(json_bytes)
 1216         -
                                            .peekable();
 1217         -
                                    ::aws_smithy_json::deserialize::token::expect_document(
 1218         -
                                        &mut tokens,
 1219         -
                                    )
 1220         -
                                    .expect("well formed json")
 1221         -
                                },
 1222         -
                                default_document_string: {
 1223         -
                                    let json_bytes = br#""hi""#;
 1224         -
                                    let mut tokens =
 1225         -
                                        ::aws_smithy_json::deserialize::json_token_iter(json_bytes)
 1226         -
                                            .peekable();
 1227         -
                                    ::aws_smithy_json::deserialize::token::expect_document(
 1228         -
                                        &mut tokens,
 1229         -
                                    )
 1230         -
                                    .expect("well formed json")
 1231         -
                                },
 1232         -
                                default_document_boolean: {
 1233         -
                                    let json_bytes = br#"true"#;
 1234         -
                                    let mut tokens =
 1235         -
                                        ::aws_smithy_json::deserialize::json_token_iter(json_bytes)
 1236         -
                                            .peekable();
 1237         -
                                    ::aws_smithy_json::deserialize::token::expect_document(
 1238         -
                                        &mut tokens,
 1239         -
                                    )
 1240         -
                                    .expect("well formed json")
 1241         -
                                },
 1242         -
                                default_document_list: {
 1243         -
                                    let json_bytes = br#"[]"#;
 1244         -
                                    let mut tokens =
 1245         -
                                        ::aws_smithy_json::deserialize::json_token_iter(json_bytes)
 1246         -
                                            .peekable();
 1247         -
                                    ::aws_smithy_json::deserialize::token::expect_document(
 1248         -
                                        &mut tokens,
 1249         -
                                    )
 1250         -
                                    .expect("well formed json")
 1251         -
                                },
 1252         -
                                default_timestamp:
 1253         -
                                    ::aws_smithy_types::DateTime::from_fractional_secs(0, 0_f64),
 1254         -
                                default_blob: ::aws_smithy_types::Blob::new("abc"),
 1255         -
                                default_byte: 1,
 1256         -
                                default_short: 1,
 1257         -
                                default_integer: 10,
 1258         -
                                default_long: 100,
 1259         -
                                default_float: 1.0_f32,
 1260         -
                                default_double: 1.0_f64,
 1261         -
                                default_map: ::std::collections::HashMap::new(),
 1262         -
                                default_enum: "FOO"
 1263         -
                                    .parse::<crate::model::TestEnum>()
 1264         -
                                    .expect("static value validated to member"),
 1265         -
                                default_int_enum: 1,
 1266         -
                                empty_string: "".to_owned(),
 1267         -
                                false_boolean: false,
 1268         -
                                empty_blob: ::aws_smithy_types::Blob::new(""),
 1269         -
                                zero_byte: 0,
 1270         -
                                zero_short: 0,
 1271         -
                                zero_integer: 0,
 1272         -
                                zero_long: 0,
 1273         -
                                zero_float: 0.0_f32,
 1274         -
                                zero_double: 0.0_f64,
 1275         -
                                default_null_document: ::std::option::Option::Some({
 1276         -
                                    let json_bytes = br#"null"#;
 1277         -
                                    let mut tokens =
 1278         -
                                        ::aws_smithy_json::deserialize::json_token_iter(json_bytes)
 1279         -
                                            .peekable();
 1280         -
                                    ::aws_smithy_json::deserialize::token::expect_document(
 1281         -
                                        &mut tokens,
 1282         -
                                    )
 1283         -
                                    .expect("well formed json")
 1284         -
                                }),
 1285         -
                            }),
 1286         -
                            top_level_default: "hi".to_owned(),
 1287         -
                            other_top_level_default: 0,
 1288         -
                            client_optional_defaults: ::std::option::Option::None,
 1289         -
                        };
 1290         -
                        ::pretty_assertions::assert_eq!(input, expected);
 1291         -
                        let response = crate::output::OperationWithDefaultsOutput {
 1292         -
                            default_string: "".to_owned(),
 1293         -
                            default_boolean: false,
 1294         -
                            default_list: vec![],
 1295         -
                            default_document_map: {
 1296         -
                                let json_bytes = br#"{}"#;
 1297         -
                                let mut tokens =
 1298         -
                                    ::aws_smithy_json::deserialize::json_token_iter(json_bytes)
 1299         -
                                        .peekable();
 1300         -
                                ::aws_smithy_json::deserialize::token::expect_document(&mut tokens)
 1301         -
                                    .expect("well formed json")
 1302         -
                            },
 1303         -
                            default_document_string: {
 1304         -
                                let json_bytes = br#"{}"#;
 1305         -
                                let mut tokens =
 1306         -
                                    ::aws_smithy_json::deserialize::json_token_iter(json_bytes)
 1307         -
                                        .peekable();
 1308         -
                                ::aws_smithy_json::deserialize::token::expect_document(&mut tokens)
 1309         -
                                    .expect("well formed json")
 1310         -
                            },
 1311         -
                            default_document_boolean: {
 1312         -
                                let json_bytes = br#"{}"#;
 1313         -
                                let mut tokens =
 1314         -
                                    ::aws_smithy_json::deserialize::json_token_iter(json_bytes)
 1315         -
                                        .peekable();
 1316         -
                                ::aws_smithy_json::deserialize::token::expect_document(&mut tokens)
 1317         -
                                    .expect("well formed json")
 1318         -
                            },
 1319         -
                            default_document_list: {
 1320         -
                                let json_bytes = br#"{}"#;
 1321         -
                                let mut tokens =
 1322         -
                                    ::aws_smithy_json::deserialize::json_token_iter(json_bytes)
 1323         -
                                        .peekable();
 1324         -
                                ::aws_smithy_json::deserialize::token::expect_document(&mut tokens)
 1325         -
                                    .expect("well formed json")
 1326         -
                            },
 1327         -
                            default_timestamp: ::aws_smithy_types::DateTime::from_fractional_secs(
 1328         -
                                0, 0_f64,
 1329         -
                            ),
 1330         -
                            default_blob: ::aws_smithy_types::Blob::new(""),
 1331         -
                            default_byte: 0,
 1332         -
                            default_short: 0,
 1333         -
                            default_integer: 0,
 1334         -
                            default_long: 0,
 1335         -
                            default_float: 0_f32,
 1336         -
                            default_double: 0_f64,
 1337         -
                            default_map: ::std::collections::HashMap::new(),
 1338         -
                            default_enum: ""
 1339         -
                                .parse::<crate::model::TestEnum>()
 1340         -
                                .expect("static value validated to member"),
 1341         -
                            default_int_enum: 0,
 1342         -
                            empty_string: "".to_owned(),
 1343         -
                            false_boolean: false,
 1344         -
                            empty_blob: ::aws_smithy_types::Blob::new(""),
 1345         -
                            zero_byte: 0,
 1346         -
                            zero_short: 0,
 1347         -
                            zero_integer: 0,
 1348         -
                            zero_long: 0,
 1349         -
                            zero_float: 0_f32,
 1350         -
                            zero_double: 0_f64,
 1351         -
                            default_null_document: ::std::option::Option::Some({
 1352         -
                                let json_bytes = br#"null"#;
 1353         -
                                let mut tokens =
 1354         -
                                    ::aws_smithy_json::deserialize::json_token_iter(json_bytes)
 1355         -
                                        .peekable();
 1356         -
                                ::aws_smithy_json::deserialize::token::expect_document(&mut tokens)
 1357         -
                                    .expect("well formed json")
 1358         -
                            }),
 1359         -
                        };
 1360         -
                        Ok(response)
 1361         -
                    };
 1362         -
                    sender.send(()).await.expect("receiver dropped early");
 1363         -
                    result
 1364         -
                }
 1365         -
            })
 1366         -
            .build_unchecked();
 1367         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 1368         -
            .await
 1369         -
            .expect("unable to make an HTTP request");
 1370         -
        assert!(receiver.recv().await.is_some());
 1371         -
    }
 1372         -
    /// Server populates default values in response when missing in params.
 1373         -
    /// Test ID: AwsJson10ServerPopulatesDefaultsInResponseWhenMissingInParams
         698  +
    /// Server populates default values in response when missing in params.
         699  +
    /// Test ID: AwsJson10ServerPopulatesDefaultsInResponseWhenMissingInParams
 1374    700   
    #[::tokio::test]
         701  +
    #[::tracing_test::traced_test]
 1375    702   
    #[should_panic]
 1376    703   
    async fn aws_json10_server_populates_defaults_in_response_when_missing_in_params_response() {
 1377    704   
        let output = crate::output::OperationWithDefaultsOutput {
 1378    705   
            default_string: "".to_owned(),
 1379    706   
            default_boolean: false,
 1380    707   
            default_list: vec![],
 1381    708   
            default_document_map: {
 1382    709   
                let json_bytes = br#"{}"#;
 1383    710   
                let mut tokens =
 1384    711   
                    ::aws_smithy_json::deserialize::json_token_iter(json_bytes).peekable();
@@ -1428,755 +2961,2813 @@
 1448    775   
            expected_headers,
 1449    776   
        ));
 1450    777   
        let body = ::hyper::body::to_bytes(http_response.into_body())
 1451    778   
            .await
 1452    779   
            .expect("unable to extract body to bytes");
 1453    780   
        ::aws_smithy_protocol_test::assert_ok(
 1454    781   
        ::aws_smithy_protocol_test::validate_body(&body, "{\n    \"defaultString\": \"hi\",\n    \"defaultBoolean\": true,\n    \"defaultList\": [],\n    \"defaultDocumentMap\": {},\n    \"defaultDocumentString\": \"hi\",\n    \"defaultDocumentBoolean\": true,\n    \"defaultDocumentList\": [],\n    \"defaultTimestamp\": 0,\n    \"defaultBlob\": \"YWJj\",\n    \"defaultByte\": 1,\n    \"defaultShort\": 1,\n    \"defaultInteger\": 10,\n    \"defaultLong\": 100,\n    \"defaultFloat\": 1.0,\n    \"defaultDouble\": 1.0,\n    \"defaultMap\": {},\n    \"defaultEnum\": \"FOO\",\n    \"defaultIntEnum\": 1,\n    \"emptyString\": \"\",\n    \"falseBoolean\": false,\n    \"emptyBlob\": \"\",\n    \"zeroByte\": 0,\n    \"zeroShort\": 0,\n    \"zeroInteger\": 0,\n    \"zeroLong\": 0,\n    \"zeroFloat\": 0.0,\n    \"zeroDouble\": 0.0\n}", ::aws_smithy_protocol_test::MediaType::from("application/json"))
 1455    782   
        );
 1456    783   
    }
 1457    784   
}
 1458         -
#[cfg(test)]
 1459         -
#[allow(unreachable_code, unused_variables)]
 1460         -
mod server_operation_with_nested_structure_test {
 1461         -
    /// Server populates nested default values when missing in request body.
 1462         -
    /// Test ID: AwsJson10ServerPopulatesNestedDefaultsWhenMissingInRequestBody
 1463         -
    #[::tokio::test]
 1464         -
    #[should_panic]
 1465         -
    async fn aws_json10_server_populates_nested_defaults_when_missing_in_request_body_request() {
 1466         -
        #[allow(unused_mut)]
 1467         -
                    let mut http_request = http::Request::builder()
 1468         -
                        .uri("/")
 1469         -
                        .method("POST")
 1470         -
        .header("Content-Type", "application/x-amz-json-1.0")
 1471         -
        .body(::aws_smithy_http_server::body::Body::from(::bytes::Bytes::from_static("{\n    \"topLevel\": {\n        \"dialog\": {\n            \"language\": \"en\"\n        },\n        \"dialogList\": [\n            {\n            },\n            {\n                \"farewell\": {}\n            },\n            {\n                \"language\": \"it\",\n                \"greeting\": \"ciao\",\n                \"farewell\": {\n                    \"phrase\": \"arrivederci\"\n                }\n            }\n        ],\n        \"dialogMap\": {\n            \"emptyDialog\": {\n            },\n            \"partialEmptyDialog\": {\n                \"language\": \"en\",\n                \"farewell\": {}\n            },\n            \"nonEmptyDialog\": {\n                \"greeting\": \"konnichiwa\",\n                \"farewell\": {\n                    \"phrase\": \"sayonara\"\n                }\n            }\n        }\n    }\n}".as_bytes()))).unwrap();
 1472         -
        #[allow(unused_mut)]
 1473         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 1474         -
        let config = crate::service::JsonRpc10Config::builder().build();
 1475         -
        let service = crate::service::JsonRpc10::builder::<::hyper::body::Body, _, _, _>(config)
 1476         -
            .operation_with_nested_structure(
 1477         -
                move |input: crate::input::OperationWithNestedStructureInput| {
 1478         -
                    let sender = sender.clone();
 1479         -
                    async move {
 1480         -
                        let result = {
 1481         -
                            let expected = crate::input::OperationWithNestedStructureInput {
 1482         -
                                top_level: crate::model::TopLevel {
 1483         -
                                    dialog: crate::model::Dialog {
 1484         -
                                        language: ::std::option::Option::Some("en".to_owned()),
 1485         -
                                        greeting: "hi".to_owned(),
 1486         -
                                        farewell: ::std::option::Option::None,
 1487         -
                                    },
 1488         -
                                    dialog_list: vec![
 1489         -
                                        crate::model::Dialog {
 1490         -
                                            greeting: "hi".to_owned(),
 1491         -
                                            language: ::std::option::Option::None,
 1492         -
                                            farewell: ::std::option::Option::None,
 1493         -
                                        },
 1494         -
                                        crate::model::Dialog {
 1495         -
                                            greeting: "hi".to_owned(),
 1496         -
                                            farewell: ::std::option::Option::Some(
 1497         -
                                                crate::model::Farewell {
 1498         -
                                                    phrase: "bye".to_owned(),
 1499         -
                                                },
 1500         -
                                            ),
 1501         -
                                            language: ::std::option::Option::None,
 1502         -
                                        },
 1503         -
                                        crate::model::Dialog {
 1504         -
                                            language: ::std::option::Option::Some("it".to_owned()),
 1505         -
                                            greeting: "ciao".to_owned(),
 1506         -
                                            farewell: ::std::option::Option::Some(
 1507         -
                                                crate::model::Farewell {
 1508         -
                                                    phrase: "arrivederci".to_owned(),
 1509         -
                                                },
 1510         -
                                            ),
 1511         -
                                        },
 1512         -
                                    ],
 1513         -
                                    dialog_map: {
 1514         -
                                        let mut ret = ::std::collections::HashMap::new();
 1515         -
                                        ret.insert(
 1516         -
                                            "emptyDialog".to_owned(),
 1517         -
                                            crate::model::Dialog {
 1518         -
                                                greeting: "hi".to_owned(),
 1519         -
                                                language: ::std::option::Option::None,
 1520         -
                                                farewell: ::std::option::Option::None,
 1521         -
                                            },
 1522         -
                                        );
 1523         -
                                        ret.insert(
 1524         -
                                            "partialEmptyDialog".to_owned(),
 1525         -
                                            crate::model::Dialog {
 1526         -
                                                language: ::std::option::Option::Some(
 1527         -
                                                    "en".to_owned(),
 1528         -
                                                ),
 1529         -
                                                greeting: "hi".to_owned(),
 1530         -
                                                farewell: ::std::option::Option::Some(
 1531         -
                                                    crate::model::Farewell {
 1532         -
                                                        phrase: "bye".to_owned(),
 1533         -
                                                    },
 1534         -
                                                ),
 1535         -
                                            },
 1536         -
                                        );
 1537         -
                                        ret.insert(
 1538         -
                                            "nonEmptyDialog".to_owned(),
 1539         -
                                            crate::model::Dialog {
 1540         -
                                                greeting: "konnichiwa".to_owned(),
 1541         -
                                                farewell: ::std::option::Option::Some(
 1542         -
                                                    crate::model::Farewell {
 1543         -
                                                        phrase: "sayonara".to_owned(),
 1544         -
                                                    },
 1545         -
                                                ),
 1546         -
                                                language: ::std::option::Option::None,
 1547         -
                                            },
 1548         -
                                        );
 1549         -
                                        ret
 1550         -
                                    },
 1551         -
                                },
 1552         -
                            };
 1553         -
                            ::pretty_assertions::assert_eq!(input, expected);
 1554         -
                            let response = crate::output::OperationWithNestedStructureOutput {
 1555         -
                                dialog: crate::model::Dialog {
 1556         -
                                    greeting: "".to_owned(),
 1557         -
                                    language: ::std::option::Option::None,
 1558         -
                                    farewell: ::std::option::Option::None,
 1559         -
                                },
 1560         -
                                dialog_list: vec![],
 1561         -
                                dialog_map: ::std::collections::HashMap::new(),
 1562         -
                            };
 1563         -
                            Ok(response)
 1564         -
                        };
 1565         -
                        sender.send(()).await.expect("receiver dropped early");
 1566         -
                        result
 1567         -
                    }
 1568         -
                },
 1569         -
            )
 1570         -
            .build_unchecked();
 1571         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 1572         -
            .await
 1573         -
            .expect("unable to make an HTTP request");
 1574         -
        assert!(receiver.recv().await.is_some());
         785  +
         786  +
static CONTENT_TYPE_PUTWITHCONTENTENCODING: ::once_cell::sync::Lazy<::mime::Mime> =
         787  +
    ::once_cell::sync::Lazy::new(|| {
         788  +
        "application/x-amz-json-1.0"
         789  +
            .parse::<::mime::Mime>()
         790  +
            .expect("BUG: MIME parsing failed, content_type is not valid")
         791  +
    });
         792  +
::pin_project_lite::pin_project! {
         793  +
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
         794  +
    /// [`PutWithContentEncodingInput`](crate::input::PutWithContentEncodingInput) using modelled bindings.
         795  +
    pub struct PutWithContentEncodingInputFuture {
         796  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::PutWithContentEncodingInput, ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError>> + Send>>
 1575    797   
    }
 1576         -
    /// Server populates nested default values when missing in response params.
 1577         -
    /// Test ID: AwsJson10ServerPopulatesNestedDefaultValuesWhenMissingInInResponseParams
 1578         -
    #[::tokio::test]
 1579         -
    #[should_panic]
 1580         -
    async fn aws_json10_server_populates_nested_default_values_when_missing_in_in_response_params_response(
 1581         -
    ) {
 1582         -
        let output = crate::output::OperationWithNestedStructureOutput {
 1583         -
            dialog: crate::model::Dialog {
 1584         -
                greeting: "".to_owned(),
 1585         -
                language: ::std::option::Option::Some("en".to_owned()),
 1586         -
                farewell: ::std::option::Option::None,
 1587         -
            },
 1588         -
            dialog_list: vec![
 1589         -
                crate::model::Dialog {
 1590         -
                    greeting: "".to_owned(),
 1591         -
                    language: ::std::option::Option::None,
 1592         -
                    farewell: ::std::option::Option::None,
 1593         -
                },
 1594         -
                crate::model::Dialog {
 1595         -
                    greeting: "".to_owned(),
 1596         -
                    farewell: ::std::option::Option::Some(crate::model::Farewell {
 1597         -
                        phrase: "".to_owned(),
 1598         -
                    }),
 1599         -
                    language: ::std::option::Option::None,
 1600         -
                },
 1601         -
                crate::model::Dialog {
 1602         -
                    language: ::std::option::Option::Some("it".to_owned()),
 1603         -
                    greeting: "ciao".to_owned(),
 1604         -
                    farewell: ::std::option::Option::Some(crate::model::Farewell {
 1605         -
                        phrase: "arrivederci".to_owned(),
 1606         -
                    }),
 1607         -
                },
 1608         -
            ],
 1609         -
            dialog_map: {
 1610         -
                let mut ret = ::std::collections::HashMap::new();
 1611         -
                ret.insert(
 1612         -
                    "emptyDialog".to_owned(),
 1613         -
                    crate::model::Dialog {
 1614         -
                        greeting: "".to_owned(),
 1615         -
                        language: ::std::option::Option::None,
 1616         -
                        farewell: ::std::option::Option::None,
 1617         -
                    },
 1618         -
                );
 1619         -
                ret.insert(
 1620         -
                    "partialEmptyDialog".to_owned(),
 1621         -
                    crate::model::Dialog {
 1622         -
                        greeting: "".to_owned(),
 1623         -
                        language: ::std::option::Option::Some("en".to_owned()),
 1624         -
                        farewell: ::std::option::Option::Some(crate::model::Farewell {
 1625         -
                            phrase: "".to_owned(),
 1626         -
                        }),
 1627         -
                    },
 1628         -
                );
 1629         -
                ret.insert(
 1630         -
                    "nonEmptyDialog".to_owned(),
 1631         -
                    crate::model::Dialog {
 1632         -
                        greeting: "konnichiwa".to_owned(),
 1633         -
                        farewell: ::std::option::Option::Some(crate::model::Farewell {
 1634         -
                            phrase: "sayonara".to_owned(),
 1635         -
                        }),
 1636         -
                        language: ::std::option::Option::None,
 1637         -
                    },
 1638         -
                );
 1639         -
                ret
 1640         -
            },
 1641         -
        };
 1642         -
        use ::aws_smithy_http_server::response::IntoResponse;
 1643         -
        let http_response = output.into_response();
 1644         -
        ::pretty_assertions::assert_eq!(
 1645         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
 1646         -
            http_response.status()
 1647         -
        );
 1648         -
        let expected_headers = [("Content-Type", "application/x-amz-json-1.0")];
 1649         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 1650         -
            http_response.headers(),
 1651         -
            expected_headers,
 1652         -
        ));
 1653         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
 1654         -
            .await
 1655         -
            .expect("unable to extract body to bytes");
 1656         -
        ::aws_smithy_protocol_test::assert_ok(
 1657         -
        ::aws_smithy_protocol_test::validate_body(&body, "{\n    \"dialog\": {\n        \"language\": \"en\",\n        \"greeting\": \"hi\"\n    },\n    \"dialogList\": [\n        {\n            \"greeting\": \"hi\"\n        },\n        {\n            \"greeting\": \"hi\",\n            \"farewell\": {\n                \"phrase\": \"bye\"\n            }\n        },\n        {\n            \"language\": \"it\",\n            \"greeting\": \"ciao\",\n            \"farewell\": {\n                \"phrase\": \"arrivederci\"\n            }\n        }\n    ],\n    \"dialogMap\": {\n        \"emptyDialog\": {\n            \"greeting\": \"hi\"\n        },\n        \"partialEmptyDialog\": {\n            \"language\": \"en\",\n            \"greeting\": \"hi\",\n            \"farewell\": {\n                \"phrase\": \"bye\"\n            }\n        },\n        \"nonEmptyDialog\": {\n            \"greeting\": \"konnichiwa\",\n            \"farewell\": {\n                \"phrase\": \"sayonara\"\n            }\n        }\n    }\n}", ::aws_smithy_protocol_test::MediaType::from("application/json"))
         798  +
}
         799  +
         800  +
impl std::future::Future for PutWithContentEncodingInputFuture {
         801  +
    type Output = Result<
         802  +
        crate::input::PutWithContentEncodingInput,
         803  +
        ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError,
         804  +
    >;
         805  +
         806  +
    fn poll(
         807  +
        self: std::pin::Pin<&mut Self>,
         808  +
        cx: &mut std::task::Context<'_>,
         809  +
    ) -> std::task::Poll<Self::Output> {
         810  +
        let this = self.project();
         811  +
        this.inner.as_mut().poll(cx)
         812  +
    }
         813  +
}
         814  +
         815  +
impl<B>
         816  +
    ::aws_smithy_http_server::request::FromRequest<
         817  +
        ::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0,
         818  +
        B,
         819  +
    > for crate::input::PutWithContentEncodingInput
         820  +
where
         821  +
    B: ::aws_smithy_http_server::body::HttpBody + Send,
         822  +
    B: 'static,
         823  +
         824  +
    B::Data: Send,
         825  +
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection:
         826  +
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
         827  +
{
         828  +
    type Rejection = ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError;
         829  +
    type Future = PutWithContentEncodingInputFuture;
         830  +
         831  +
    fn from_request(request: ::http::Request<B>) -> Self::Future {
         832  +
        let fut = async move {
         833  +
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
         834  +
                request.headers(),
         835  +
                &CONTENT_TYPE_PUTWITHCONTENTENCODING,
         836  +
            ) {
         837  +
                return Err(::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection::NotAcceptable);
         838  +
            }
         839  +
            crate::protocol_serde::shape_put_with_content_encoding::de_put_with_content_encoding_http_request(request)
         840  +
                            .await
         841  +
                            .map_err(Into::into)
         842  +
        };
         843  +
        use ::futures_util::future::TryFutureExt;
         844  +
        let fut = fut.map_err(
         845  +
            |e: ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection| {
         846  +
                ::tracing::debug!(error = %e, "failed to deserialize request");
         847  +
                ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e)
         848  +
            },
 1658    849   
        );
         850  +
        PutWithContentEncodingInputFuture {
         851  +
            inner: Box::pin(fut),
         852  +
        }
 1659    853   
    }
 1660    854   
}
 1661         -
#[cfg(test)]
 1662         -
#[allow(unreachable_code, unused_variables)]
 1663         -
mod server_simple_scalar_properties_test {
 1664         -
    /// Supports handling NaN float values.
 1665         -
    /// Test ID: AwsJson10SupportsNaNFloatInputs
 1666         -
    #[::tokio::test]
 1667         -
    async fn aws_json10_supports_na_n_float_inputs_request() {
 1668         -
        #[allow(unused_mut)]
 1669         -
        let mut http_request = http::Request::builder()
 1670         -
            .uri("/")
 1671         -
            .method("POST")
 1672         -
            .header("Content-Type", "application/x-amz-json-1.0")
 1673         -
            .header("X-Amz-Target", "JsonRpc10.SimpleScalarProperties")
 1674         -
            .body(::aws_smithy_http_server::body::Body::from(
 1675         -
                ::bytes::Bytes::from_static(
 1676         -
                    "{\n    \"floatValue\": \"NaN\",\n    \"doubleValue\": \"NaN\"\n}".as_bytes(),
 1677         -
                ),
 1678         -
            ))
 1679         -
            .unwrap();
 1680         -
        #[allow(unused_mut)]
 1681         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 1682         -
        let config = crate::service::JsonRpc10Config::builder().build();
 1683         -
        let service = crate::service::JsonRpc10::builder::<::hyper::body::Body, _, _, _>(config)
 1684         -
                        .simple_scalar_properties(move |input: crate::input::SimpleScalarPropertiesInput| {
 1685         -
                            let sender = sender.clone();
 1686         -
                            async move {
 1687         -
                                let result = { use ::aws_smithy_protocol_test::FloatEquals;
 1688         -
        let expected =
 1689         -
            crate::input::SimpleScalarPropertiesInput {
 1690         -
                float_value:
 1691         -
                    ::std::option::Option::Some(
 1692         -
                        <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("NaN").expect("invalid string for number")
 1693         -
                    )
 1694         -
                ,
 1695         -
                double_value:
 1696         -
                    ::std::option::Option::Some(
 1697         -
                        <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("NaN").expect("invalid string for number")
 1698         -
                    )
 1699         -
                ,
 1700         -
            }
 1701         -
        ;
 1702         -
        assert!(input.float_value.float_equals(&expected.float_value),
 1703         -
                                            "Unexpected value for `float_value` {:?} vs. {:?}", expected.float_value, input.float_value);
 1704         -
        assert!(input.double_value.float_equals(&expected.double_value),
 1705         -
                                            "Unexpected value for `double_value` {:?} vs. {:?}", expected.double_value, input.double_value);
 1706         -
        let response =
 1707         -
            crate::output::SimpleScalarPropertiesOutput {
 1708         -
                float_value:
 1709         -
                    ::std::option::Option::None
 1710         -
                ,
 1711         -
                double_value:
 1712         -
                    ::std::option::Option::None
 1713         -
                ,
         855  +
impl
         856  +
    ::aws_smithy_http_server::response::IntoResponse<
         857  +
        ::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0,
         858  +
    > for crate::output::PutWithContentEncodingOutput
         859  +
{
         860  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
         861  +
        match crate::protocol_serde::shape_put_with_content_encoding::ser_put_with_content_encoding_http_response(self) {
         862  +
                        Ok(response) => response,
         863  +
                        Err(e) => {
         864  +
                            ::tracing::error!(error = %e, "failed to serialize response");
         865  +
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0>::into_response(::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e))
         866  +
                        }
         867  +
                    }
         868  +
    }
         869  +
}
         870  +
         871  +
static CONTENT_TYPE_HOSTWITHPATHOPERATION: ::once_cell::sync::Lazy<::mime::Mime> =
         872  +
    ::once_cell::sync::Lazy::new(|| {
         873  +
        "application/x-amz-json-1.0"
         874  +
            .parse::<::mime::Mime>()
         875  +
            .expect("BUG: MIME parsing failed, content_type is not valid")
         876  +
    });
         877  +
::pin_project_lite::pin_project! {
         878  +
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
         879  +
    /// [`HostWithPathOperationInput`](crate::input::HostWithPathOperationInput) using modelled bindings.
         880  +
    pub struct HostWithPathOperationInputFuture {
         881  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::HostWithPathOperationInput, ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError>> + Send>>
         882  +
    }
         883  +
}
         884  +
         885  +
impl std::future::Future for HostWithPathOperationInputFuture {
         886  +
    type Output = Result<
         887  +
        crate::input::HostWithPathOperationInput,
         888  +
        ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError,
         889  +
    >;
         890  +
         891  +
    fn poll(
         892  +
        self: std::pin::Pin<&mut Self>,
         893  +
        cx: &mut std::task::Context<'_>,
         894  +
    ) -> std::task::Poll<Self::Output> {
         895  +
        let this = self.project();
         896  +
        this.inner.as_mut().poll(cx)
         897  +
    }
         898  +
}
         899  +
         900  +
impl<B>
         901  +
    ::aws_smithy_http_server::request::FromRequest<
         902  +
        ::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0,
         903  +
        B,
         904  +
    > for crate::input::HostWithPathOperationInput
         905  +
where
         906  +
    B: ::aws_smithy_http_server::body::HttpBody + Send,
         907  +
    B: 'static,
         908  +
         909  +
    B::Data: Send,
         910  +
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection:
         911  +
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
         912  +
{
         913  +
    type Rejection = ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError;
         914  +
    type Future = HostWithPathOperationInputFuture;
         915  +
         916  +
    fn from_request(request: ::http::Request<B>) -> Self::Future {
         917  +
        let fut = async move {
         918  +
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
         919  +
                request.headers(),
         920  +
                &CONTENT_TYPE_HOSTWITHPATHOPERATION,
         921  +
            ) {
         922  +
                return Err(::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection::NotAcceptable);
 1714    923   
            }
 1715         -
        ;
 1716         -
        response };
 1717         -
                                sender.send(()).await.expect("receiver dropped early");
 1718         -
                                result
 1719         -
                            }
 1720         -
                        })
 1721         -
                        .build_unchecked();
 1722         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 1723         -
            .await
 1724         -
            .expect("unable to make an HTTP request");
 1725         -
        assert!(receiver.recv().await.is_some());
         924  +
            crate::protocol_serde::shape_host_with_path_operation::de_host_with_path_operation_http_request(request)
         925  +
                            .await
         926  +
                            .map_err(Into::into)
         927  +
        };
         928  +
        use ::futures_util::future::TryFutureExt;
         929  +
        let fut = fut.map_err(
         930  +
            |e: ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection| {
         931  +
                ::tracing::debug!(error = %e, "failed to deserialize request");
         932  +
                ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e)
         933  +
            },
         934  +
        );
         935  +
        HostWithPathOperationInputFuture {
         936  +
            inner: Box::pin(fut),
         937  +
        }
 1726    938   
    }
 1727         -
    /// Supports handling Infinity float values.
 1728         -
    /// Test ID: AwsJson10SupportsInfinityFloatInputs
 1729         -
    #[::tokio::test]
 1730         -
    async fn aws_json10_supports_infinity_float_inputs_request() {
 1731         -
        #[allow(unused_mut)]
 1732         -
        let mut http_request = http::Request::builder()
 1733         -
            .uri("/")
 1734         -
            .method("POST")
 1735         -
            .header("Content-Type", "application/x-amz-json-1.0")
 1736         -
            .header("X-Amz-Target", "JsonRpc10.SimpleScalarProperties")
 1737         -
            .body(::aws_smithy_http_server::body::Body::from(
 1738         -
                ::bytes::Bytes::from_static(
 1739         -
                    "{\n    \"floatValue\": \"Infinity\",\n    \"doubleValue\": \"Infinity\"\n}"
 1740         -
                        .as_bytes(),
 1741         -
                ),
 1742         -
            ))
 1743         -
            .unwrap();
 1744         -
        #[allow(unused_mut)]
 1745         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 1746         -
        let config = crate::service::JsonRpc10Config::builder().build();
 1747         -
        let service = crate::service::JsonRpc10::builder::<::hyper::body::Body, _, _, _>(config)
 1748         -
                        .simple_scalar_properties(move |input: crate::input::SimpleScalarPropertiesInput| {
 1749         -
                            let sender = sender.clone();
 1750         -
                            async move {
 1751         -
                                let result = { use ::aws_smithy_protocol_test::FloatEquals;
 1752         -
        let expected =
 1753         -
            crate::input::SimpleScalarPropertiesInput {
 1754         -
                float_value:
 1755         -
                    ::std::option::Option::Some(
 1756         -
                        <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("Infinity").expect("invalid string for number")
 1757         -
                    )
 1758         -
                ,
 1759         -
                double_value:
 1760         -
                    ::std::option::Option::Some(
 1761         -
                        <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("Infinity").expect("invalid string for number")
 1762         -
                    )
 1763         -
                ,
         939  +
}
         940  +
impl
         941  +
    ::aws_smithy_http_server::response::IntoResponse<
         942  +
        ::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0,
         943  +
    > for crate::output::HostWithPathOperationOutput
         944  +
{
         945  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
         946  +
        match crate::protocol_serde::shape_host_with_path_operation::ser_host_with_path_operation_http_response(self) {
         947  +
                        Ok(response) => response,
         948  +
                        Err(e) => {
         949  +
                            ::tracing::error!(error = %e, "failed to serialize response");
         950  +
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0>::into_response(::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e))
         951  +
                        }
         952  +
                    }
         953  +
    }
         954  +
}
         955  +
         956  +
static CONTENT_TYPE_ENDPOINTWITHHOSTLABELOPERATION: ::once_cell::sync::Lazy<::mime::Mime> =
         957  +
    ::once_cell::sync::Lazy::new(|| {
         958  +
        "application/x-amz-json-1.0"
         959  +
            .parse::<::mime::Mime>()
         960  +
            .expect("BUG: MIME parsing failed, content_type is not valid")
         961  +
    });
         962  +
::pin_project_lite::pin_project! {
         963  +
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
         964  +
    /// [`EndpointWithHostLabelOperationInput`](crate::input::EndpointWithHostLabelOperationInput) using modelled bindings.
         965  +
    pub struct EndpointWithHostLabelOperationInputFuture {
         966  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::EndpointWithHostLabelOperationInput, ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError>> + Send>>
         967  +
    }
         968  +
}
         969  +
         970  +
impl std::future::Future for EndpointWithHostLabelOperationInputFuture {
         971  +
    type Output = Result<
         972  +
        crate::input::EndpointWithHostLabelOperationInput,
         973  +
        ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError,
         974  +
    >;
         975  +
         976  +
    fn poll(
         977  +
        self: std::pin::Pin<&mut Self>,
         978  +
        cx: &mut std::task::Context<'_>,
         979  +
    ) -> std::task::Poll<Self::Output> {
         980  +
        let this = self.project();
         981  +
        this.inner.as_mut().poll(cx)
         982  +
    }
         983  +
}
         984  +
         985  +
impl<B>
         986  +
    ::aws_smithy_http_server::request::FromRequest<
         987  +
        ::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0,
         988  +
        B,
         989  +
    > for crate::input::EndpointWithHostLabelOperationInput
         990  +
where
         991  +
    B: ::aws_smithy_http_server::body::HttpBody + Send,
         992  +
    B: 'static,
         993  +
         994  +
    B::Data: Send,
         995  +
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection:
         996  +
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
         997  +
{
         998  +
    type Rejection = ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError;
         999  +
    type Future = EndpointWithHostLabelOperationInputFuture;
        1000  +
        1001  +
    fn from_request(request: ::http::Request<B>) -> Self::Future {
        1002  +
        let fut = async move {
        1003  +
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
        1004  +
                request.headers(),
        1005  +
                &CONTENT_TYPE_ENDPOINTWITHHOSTLABELOPERATION,
        1006  +
            ) {
        1007  +
                return Err(::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection::NotAcceptable);
 1764   1008   
            }
 1765         -
        ;
 1766         -
        assert!(input.float_value.float_equals(&expected.float_value),
 1767         -
                                            "Unexpected value for `float_value` {:?} vs. {:?}", expected.float_value, input.float_value);
 1768         -
        assert!(input.double_value.float_equals(&expected.double_value),
 1769         -
                                            "Unexpected value for `double_value` {:?} vs. {:?}", expected.double_value, input.double_value);
 1770         -
        let response =
 1771         -
            crate::output::SimpleScalarPropertiesOutput {
 1772         -
                float_value:
 1773         -
                    ::std::option::Option::None
 1774         -
                ,
 1775         -
                double_value:
 1776         -
                    ::std::option::Option::None
 1777         -
                ,
        1009  +
            crate::protocol_serde::shape_endpoint_with_host_label_operation::de_endpoint_with_host_label_operation_http_request(request)
        1010  +
                            .await
        1011  +
                            .map_err(Into::into)
        1012  +
        };
        1013  +
        use ::futures_util::future::TryFutureExt;
        1014  +
        let fut = fut.map_err(
        1015  +
            |e: ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection| {
        1016  +
                ::tracing::debug!(error = %e, "failed to deserialize request");
        1017  +
                ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e)
        1018  +
            },
        1019  +
        );
        1020  +
        EndpointWithHostLabelOperationInputFuture {
        1021  +
            inner: Box::pin(fut),
        1022  +
        }
        1023  +
    }
        1024  +
}
        1025  +
impl
        1026  +
    ::aws_smithy_http_server::response::IntoResponse<
        1027  +
        ::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0,
        1028  +
    > for crate::output::EndpointWithHostLabelOperationOutput
        1029  +
{
        1030  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
        1031  +
        match crate::protocol_serde::shape_endpoint_with_host_label_operation::ser_endpoint_with_host_label_operation_http_response(self) {
        1032  +
                        Ok(response) => response,
        1033  +
                        Err(e) => {
        1034  +
                            ::tracing::error!(error = %e, "failed to serialize response");
        1035  +
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0>::into_response(::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e))
        1036  +
                        }
        1037  +
                    }
        1038  +
    }
        1039  +
}
        1040  +
impl
        1041  +
    ::aws_smithy_http_server::response::IntoResponse<
        1042  +
        ::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0,
        1043  +
    > for crate::error::EndpointWithHostLabelOperationError
        1044  +
{
        1045  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
        1046  +
        match crate::protocol_serde::shape_endpoint_with_host_label_operation::ser_endpoint_with_host_label_operation_http_error(&self) {
        1047  +
            Ok(mut response) => {
        1048  +
                response.extensions_mut().insert(::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()));
        1049  +
                response
        1050  +
            },
        1051  +
            Err(e) => {
        1052  +
                ::tracing::error!(error = %e, "failed to serialize response");
        1053  +
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0>::into_response(::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e))
 1778   1054   
            }
 1779         -
        ;
 1780         -
        response };
 1781         -
                                sender.send(()).await.expect("receiver dropped early");
 1782         -
                                result
 1783         -
                            }
 1784         -
                        })
 1785         -
                        .build_unchecked();
 1786         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 1787         -
            .await
 1788         -
            .expect("unable to make an HTTP request");
 1789         -
        assert!(receiver.recv().await.is_some());
        1055  +
        }
 1790   1056   
    }
 1791         -
    /// Supports handling -Infinity float values.
 1792         -
    /// Test ID: AwsJson10SupportsNegativeInfinityFloatInputs
        1057  +
}
        1058  +
        1059  +
#[allow(unreachable_code, unused_variables)]
        1060  +
#[cfg(test)]
        1061  +
mod endpoint_with_host_label_operation_test {
        1062  +
        1063  +
    /// Operations can prepend to the given host if they define the
        1064  +
    /// endpoint trait, and can use the host label trait to define
        1065  +
    /// further customization based on user input.
        1066  +
    /// Test ID: AwsJson10EndpointTraitWithHostLabel
 1793   1067   
    #[::tokio::test]
 1794         -
    async fn aws_json10_supports_negative_infinity_float_inputs_request() {
        1068  +
    #[::tracing_test::traced_test]
        1069  +
    #[should_panic]
        1070  +
    async fn aws_json10_endpoint_trait_with_host_label_request() {
 1795   1071   
        #[allow(unused_mut)]
 1796   1072   
        let mut http_request = http::Request::builder()
 1797   1073   
            .uri("/")
 1798   1074   
            .method("POST")
 1799         -
            .header("Content-Type", "application/x-amz-json-1.0")
 1800         -
            .header("X-Amz-Target", "JsonRpc10.SimpleScalarProperties")
 1801   1075   
            .body(::aws_smithy_http_server::body::Body::from(
 1802         -
                ::bytes::Bytes::from_static(
 1803         -
                    "{\n    \"floatValue\": \"-Infinity\",\n    \"doubleValue\": \"-Infinity\"\n}"
 1804         -
                        .as_bytes(),
 1805         -
                ),
        1076  +
                ::bytes::Bytes::from_static("{\"label\": \"bar\"}".as_bytes()),
 1806   1077   
            ))
 1807   1078   
            .unwrap();
        1079  +
        todo!("endpoint trait not supported yet");
 1808   1080   
        #[allow(unused_mut)]
 1809   1081   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 1810   1082   
        let config = crate::service::JsonRpc10Config::builder().build();
 1811   1083   
        let service = crate::service::JsonRpc10::builder::<::hyper::body::Body, _, _, _>(config)
 1812         -
                        .simple_scalar_properties(move |input: crate::input::SimpleScalarPropertiesInput| {
 1813         -
                            let sender = sender.clone();
 1814         -
                            async move {
 1815         -
                                let result = { use ::aws_smithy_protocol_test::FloatEquals;
 1816         -
        let expected =
 1817         -
            crate::input::SimpleScalarPropertiesInput {
 1818         -
                float_value:
 1819         -
                    ::std::option::Option::Some(
 1820         -
                        <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("-Infinity").expect("invalid string for number")
 1821         -
                    )
 1822         -
                ,
 1823         -
                double_value:
 1824         -
                    ::std::option::Option::Some(
 1825         -
                        <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("-Infinity").expect("invalid string for number")
 1826         -
                    )
 1827         -
                ,
 1828         -
            }
 1829         -
        ;
 1830         -
        assert!(input.float_value.float_equals(&expected.float_value),
 1831         -
                                            "Unexpected value for `float_value` {:?} vs. {:?}", expected.float_value, input.float_value);
 1832         -
        assert!(input.double_value.float_equals(&expected.double_value),
 1833         -
                                            "Unexpected value for `double_value` {:?} vs. {:?}", expected.double_value, input.double_value);
 1834         -
        let response =
 1835         -
            crate::output::SimpleScalarPropertiesOutput {
 1836         -
                float_value:
 1837         -
                    ::std::option::Option::None
 1838         -
                ,
 1839         -
                double_value:
 1840         -
                    ::std::option::Option::None
 1841         -
                ,
 1842         -
            }
 1843         -
        ;
 1844         -
        response };
 1845         -
                                sender.send(()).await.expect("receiver dropped early");
 1846         -
                                result
 1847         -
                            }
 1848         -
                        })
 1849         -
                        .build_unchecked();
 1850         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 1851         -
            .await
 1852         -
            .expect("unable to make an HTTP request");
 1853         -
        assert!(receiver.recv().await.is_some());
 1854         -
    }
 1855         -
    /// Supports handling NaN float values.
 1856         -
    /// Test ID: AwsJson10SupportsNaNFloatInputs
 1857         -
    #[::tokio::test]
 1858         -
    async fn aws_json10_supports_na_n_float_inputs_response() {
 1859         -
        let output = crate::output::SimpleScalarPropertiesOutput {
 1860         -
            float_value: ::std::option::Option::Some(
 1861         -
                <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("NaN")
 1862         -
                    .expect("invalid string for number"),
 1863         -
            ),
 1864         -
            double_value: ::std::option::Option::Some(
 1865         -
                <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("NaN")
 1866         -
                    .expect("invalid string for number"),
 1867         -
            ),
 1868         -
        };
 1869         -
        use ::aws_smithy_http_server::response::IntoResponse;
 1870         -
        let http_response = output.into_response();
 1871         -
        ::pretty_assertions::assert_eq!(
 1872         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
 1873         -
            http_response.status()
 1874         -
        );
 1875         -
        let expected_headers = [("Content-Type", "application/x-amz-json-1.0")];
 1876         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 1877         -
            http_response.headers(),
 1878         -
            expected_headers,
 1879         -
        ));
 1880         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
 1881         -
            .await
 1882         -
            .expect("unable to extract body to bytes");
 1883         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
 1884         -
            &body,
 1885         -
            "{\n    \"floatValue\": \"NaN\",\n    \"doubleValue\": \"NaN\"\n}",
 1886         -
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
 1887         -
        ));
 1888         -
    }
 1889         -
    /// Supports handling Infinity float values.
 1890         -
    /// Test ID: AwsJson10SupportsInfinityFloatInputs
 1891         -
    #[::tokio::test]
 1892         -
    async fn aws_json10_supports_infinity_float_inputs_response() {
 1893         -
        let output = crate::output::SimpleScalarPropertiesOutput {
 1894         -
            float_value: ::std::option::Option::Some(
 1895         -
                <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("Infinity")
 1896         -
                    .expect("invalid string for number"),
 1897         -
            ),
 1898         -
            double_value: ::std::option::Option::Some(
 1899         -
                <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("Infinity")
 1900         -
                    .expect("invalid string for number"),
 1901         -
            ),
 1902         -
        };
 1903         -
        use ::aws_smithy_http_server::response::IntoResponse;
 1904         -
        let http_response = output.into_response();
 1905         -
        ::pretty_assertions::assert_eq!(
 1906         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
 1907         -
            http_response.status()
 1908         -
        );
 1909         -
        let expected_headers = [("Content-Type", "application/x-amz-json-1.0")];
 1910         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 1911         -
            http_response.headers(),
 1912         -
            expected_headers,
 1913         -
        ));
 1914         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
 1915         -
            .await
 1916         -
            .expect("unable to extract body to bytes");
 1917         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
 1918         -
            &body,
 1919         -
            "{\n    \"floatValue\": \"Infinity\",\n    \"doubleValue\": \"Infinity\"\n}",
 1920         -
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
 1921         -
        ));
 1922         -
    }
 1923         -
    /// Supports handling -Infinity float values.
 1924         -
    /// Test ID: AwsJson10SupportsNegativeInfinityFloatInputs
 1925         -
    #[::tokio::test]
 1926         -
    async fn aws_json10_supports_negative_infinity_float_inputs_response() {
 1927         -
        let output = crate::output::SimpleScalarPropertiesOutput {
 1928         -
            float_value: ::std::option::Option::Some(
 1929         -
                <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("-Infinity")
 1930         -
                    .expect("invalid string for number"),
 1931         -
            ),
 1932         -
            double_value: ::std::option::Option::Some(
 1933         -
                <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("-Infinity")
 1934         -
                    .expect("invalid string for number"),
 1935         -
            ),
 1936         -
        };
 1937         -
        use ::aws_smithy_http_server::response::IntoResponse;
 1938         -
        let http_response = output.into_response();
 1939         -
        ::pretty_assertions::assert_eq!(
 1940         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
 1941         -
            http_response.status()
 1942         -
        );
 1943         -
        let expected_headers = [("Content-Type", "application/x-amz-json-1.0")];
 1944         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 1945         -
            http_response.headers(),
 1946         -
            expected_headers,
 1947         -
        ));
 1948         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
 1949         -
            .await
 1950         -
            .expect("unable to extract body to bytes");
 1951         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
 1952         -
            &body,
 1953         -
            "{\n    \"floatValue\": \"-Infinity\",\n    \"doubleValue\": \"-Infinity\"\n}",
 1954         -
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
 1955         -
        ));
        1084  +
            .endpoint_with_host_label_operation(
        1085  +
                move |input: crate::input::EndpointWithHostLabelOperationInput| {
        1086  +
                    let sender = sender.clone();
        1087  +
                    async move {
        1088  +
                        let result = {
        1089  +
                            let expected = crate::input::EndpointWithHostLabelOperationInput {
        1090  +
                                label: "bar".to_owned(),
        1091  +
                            };
        1092  +
                            ::pretty_assertions::assert_eq!(input, expected);
        1093  +
                            let response = crate::output::EndpointWithHostLabelOperationOutput {};
        1094  +
                            Ok(response)
        1095  +
                        };
        1096  +
                        sender.send(()).await.expect("receiver dropped early");
        1097  +
                        result
        1098  +
                    }
        1099  +
                },
        1100  +
            )
        1101  +
            .build_unchecked();
        1102  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
        1103  +
            .await
        1104  +
            .expect("unable to make an HTTP request");
        1105  +
        assert!(
        1106  +
            receiver.recv().await.is_some(),
        1107  +
            "we expected operation handler to be invoked but it was not entered"
        1108  +
        );
 1956   1109   
    }
 1957   1110   
}
 1958   1111   
 1959         -
static CONTENT_TYPE_OPERATIONWITHNESTEDSTRUCTURE: ::once_cell::sync::Lazy<::mime::Mime> =
        1112  +
static CONTENT_TYPE_ENDPOINTOPERATION: ::once_cell::sync::Lazy<::mime::Mime> =
 1960   1113   
    ::once_cell::sync::Lazy::new(|| {
 1961   1114   
        "application/x-amz-json-1.0"
 1962   1115   
            .parse::<::mime::Mime>()
 1963   1116   
            .expect("BUG: MIME parsing failed, content_type is not valid")
 1964   1117   
    });
 1965   1118   
::pin_project_lite::pin_project! {
 1966   1119   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
 1967         -
    /// [`OperationWithNestedStructureInput`](crate::input::OperationWithNestedStructureInput) using modelled bindings.
 1968         -
    pub struct OperationWithNestedStructureInputFuture {
 1969         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::OperationWithNestedStructureInput, ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError>> + Send>>
        1120  +
    /// [`EndpointOperationInput`](crate::input::EndpointOperationInput) using modelled bindings.
        1121  +
    pub struct EndpointOperationInputFuture {
        1122  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::EndpointOperationInput, ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError>> + Send>>
 1970   1123   
    }
 1971   1124   
}
 1972   1125   
 1973         -
impl std::future::Future for OperationWithNestedStructureInputFuture {
        1126  +
impl std::future::Future for EndpointOperationInputFuture {
 1974   1127   
    type Output = Result<
 1975         -
        crate::input::OperationWithNestedStructureInput,
        1128  +
        crate::input::EndpointOperationInput,
 1976   1129   
        ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError,
 1977   1130   
    >;
 1978   1131   
 1979   1132   
    fn poll(
 1980   1133   
        self: std::pin::Pin<&mut Self>,
 1981   1134   
        cx: &mut std::task::Context<'_>,
 1982   1135   
    ) -> std::task::Poll<Self::Output> {
 1983   1136   
        let this = self.project();
 1984   1137   
        this.inner.as_mut().poll(cx)
 1985   1138   
    }
 1986   1139   
}
 1987   1140   
 1988   1141   
impl<B>
 1989   1142   
    ::aws_smithy_http_server::request::FromRequest<
 1990   1143   
        ::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0,
 1991   1144   
        B,
 1992         -
    > for crate::input::OperationWithNestedStructureInput
        1145  +
    > for crate::input::EndpointOperationInput
 1993   1146   
where
 1994   1147   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
 1995   1148   
    B: 'static,
 1996   1149   
 1997   1150   
    B::Data: Send,
 1998   1151   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection:
 1999   1152   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
 2000   1153   
{
 2001   1154   
    type Rejection = ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError;
 2002         -
    type Future = OperationWithNestedStructureInputFuture;
        1155  +
    type Future = EndpointOperationInputFuture;
 2003   1156   
 2004   1157   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
 2005   1158   
        let fut = async move {
 2006   1159   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
 2007   1160   
                request.headers(),
 2008         -
                &CONTENT_TYPE_OPERATIONWITHNESTEDSTRUCTURE,
        1161  +
                &CONTENT_TYPE_ENDPOINTOPERATION,
 2009   1162   
            ) {
 2010   1163   
                return Err(::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection::NotAcceptable);
 2011   1164   
            }
 2012         -
            crate::protocol_serde::shape_operation_with_nested_structure::de_operation_with_nested_structure_http_request(request)
 2013         -
                            .await
 2014         -
                            .map_err(Into::into)
        1165  +
            crate::protocol_serde::shape_endpoint_operation::de_endpoint_operation_http_request(
        1166  +
                request,
        1167  +
            )
        1168  +
            .await
        1169  +
            .map_err(Into::into)
 2015   1170   
        };
 2016   1171   
        use ::futures_util::future::TryFutureExt;
 2017   1172   
        let fut = fut.map_err(
 2018   1173   
            |e: ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection| {
 2019   1174   
                ::tracing::debug!(error = %e, "failed to deserialize request");
 2020   1175   
                ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e)
 2021   1176   
            },
 2022   1177   
        );
 2023         -
        OperationWithNestedStructureInputFuture {
        1178  +
        EndpointOperationInputFuture {
 2024   1179   
            inner: Box::pin(fut),
 2025   1180   
        }
 2026   1181   
    }
 2027   1182   
}
 2028   1183   
impl
 2029   1184   
    ::aws_smithy_http_server::response::IntoResponse<
 2030   1185   
        ::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0,
 2031         -
    > for crate::output::OperationWithNestedStructureOutput
 2032         -
{
 2033         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
 2034         -
        match crate::protocol_serde::shape_operation_with_nested_structure::ser_operation_with_nested_structure_http_response(self) {
 2035         -
                        Ok(response) => response,
 2036         -
                        Err(e) => {
 2037         -
                            ::tracing::error!(error = %e, "failed to serialize response");
 2038         -
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0>::into_response(::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e))
 2039         -
                        }
 2040         -
                    }
 2041         -
    }
 2042         -
}
 2043         -
impl
 2044         -
    ::aws_smithy_http_server::response::IntoResponse<
 2045         -
        ::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0,
 2046         -
    > for crate::error::OperationWithNestedStructureError
        1186  +
    > for crate::output::EndpointOperationOutput
 2047   1187   
{
 2048   1188   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
 2049         -
        match crate::protocol_serde::shape_operation_with_nested_structure::ser_operation_with_nested_structure_http_error(&self) {
 2050         -
            Ok(mut response) => {
 2051         -
                response.extensions_mut().insert(::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()));
 2052         -
                response
 2053         -
            },
        1189  +
        match crate::protocol_serde::shape_endpoint_operation::ser_endpoint_operation_http_response(
        1190  +
            self,
        1191  +
        ) {
        1192  +
            Ok(response) => response,
 2054   1193   
            Err(e) => {
 2055   1194   
                ::tracing::error!(error = %e, "failed to serialize response");
 2056         -
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0>::into_response(::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e))
        1195  +
                ::aws_smithy_http_server::response::IntoResponse::<
        1196  +
                    ::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0,
        1197  +
                >::into_response(
        1198  +
                    ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(
        1199  +
                        e,
        1200  +
                    ),
        1201  +
                )
 2057   1202   
            }
 2058   1203   
        }
 2059   1204   
    }
 2060   1205   
}
 2061   1206   
 2062         -
static CONTENT_TYPE_OPERATIONWITHREQUIREDMEMBERS: ::once_cell::sync::Lazy<::mime::Mime> =
        1207  +
#[allow(unreachable_code, unused_variables)]
        1208  +
#[cfg(test)]
        1209  +
mod endpoint_operation_test {
        1210  +
        1211  +
    /// Operations can prepend to the given host if they define the
        1212  +
    /// endpoint trait.
        1213  +
    /// Test ID: AwsJson10EndpointTrait
        1214  +
    #[::tokio::test]
        1215  +
    #[::tracing_test::traced_test]
        1216  +
    #[should_panic]
        1217  +
    async fn aws_json10_endpoint_trait_request() {
        1218  +
        #[allow(unused_mut)]
        1219  +
        let mut http_request = http::Request::builder()
        1220  +
            .uri("/")
        1221  +
            .method("POST")
        1222  +
            .body(::aws_smithy_http_server::body::Body::from(
        1223  +
                ::bytes::Bytes::from_static("{}".as_bytes()),
        1224  +
            ))
        1225  +
            .unwrap();
        1226  +
        todo!("endpoint trait not supported yet");
        1227  +
        #[allow(unused_mut)]
        1228  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
        1229  +
        let config = crate::service::JsonRpc10Config::builder().build();
        1230  +
        let service = crate::service::JsonRpc10::builder::<::hyper::body::Body, _, _, _>(config)
        1231  +
            .endpoint_operation(move |input: crate::input::EndpointOperationInput| {
        1232  +
                let sender = sender.clone();
        1233  +
                async move {
        1234  +
                    let result = {
        1235  +
                        let expected = crate::input::EndpointOperationInput {};
        1236  +
                        ::pretty_assertions::assert_eq!(input, expected);
        1237  +
                        let response = crate::output::EndpointOperationOutput {};
        1238  +
                        response
        1239  +
                    };
        1240  +
                    sender.send(()).await.expect("receiver dropped early");
        1241  +
                    result
        1242  +
                }
        1243  +
            })
        1244  +
            .build_unchecked();
        1245  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
        1246  +
            .await
        1247  +
            .expect("unable to make an HTTP request");
        1248  +
        assert!(
        1249  +
            receiver.recv().await.is_some(),
        1250  +
            "we expected operation handler to be invoked but it was not entered"
        1251  +
        );
        1252  +
    }
        1253  +
}
        1254  +
        1255  +
static CONTENT_TYPE_JSONUNIONS: ::once_cell::sync::Lazy<::mime::Mime> =
 2063   1256   
    ::once_cell::sync::Lazy::new(|| {
 2064   1257   
        "application/x-amz-json-1.0"
 2065   1258   
            .parse::<::mime::Mime>()
 2066   1259   
            .expect("BUG: MIME parsing failed, content_type is not valid")
 2067   1260   
    });
 2068   1261   
::pin_project_lite::pin_project! {
 2069   1262   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
 2070         -
    /// [`OperationWithRequiredMembersInput`](crate::input::OperationWithRequiredMembersInput) using modelled bindings.
 2071         -
    pub struct OperationWithRequiredMembersInputFuture {
 2072         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::OperationWithRequiredMembersInput, ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError>> + Send>>
        1263  +
    /// [`JsonUnionsInput`](crate::input::JsonUnionsInput) using modelled bindings.
        1264  +
    pub struct JsonUnionsInputFuture {
        1265  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::JsonUnionsInput, ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError>> + Send>>
 2073   1266   
    }
 2074   1267   
}
 2075   1268   
 2076         -
impl std::future::Future for OperationWithRequiredMembersInputFuture {
        1269  +
impl std::future::Future for JsonUnionsInputFuture {
 2077   1270   
    type Output = Result<
 2078         -
        crate::input::OperationWithRequiredMembersInput,
        1271  +
        crate::input::JsonUnionsInput,
 2079   1272   
        ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError,
 2080   1273   
    >;
 2081   1274   
 2082   1275   
    fn poll(
 2083   1276   
        self: std::pin::Pin<&mut Self>,
 2084   1277   
        cx: &mut std::task::Context<'_>,
 2085   1278   
    ) -> std::task::Poll<Self::Output> {
 2086   1279   
        let this = self.project();
 2087   1280   
        this.inner.as_mut().poll(cx)
 2088   1281   
    }
 2089         -
}
 2090         -
 2091         -
impl<B>
 2092         -
    ::aws_smithy_http_server::request::FromRequest<
 2093         -
        ::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0,
 2094         -
        B,
 2095         -
    > for crate::input::OperationWithRequiredMembersInput
 2096         -
where
 2097         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
 2098         -
    B: 'static,
 2099         -
 2100         -
    B::Data: Send,
 2101         -
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection:
 2102         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
 2103         -
{
 2104         -
    type Rejection = ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError;
 2105         -
    type Future = OperationWithRequiredMembersInputFuture;
 2106         -
 2107         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
 2108         -
        let fut = async move {
 2109         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
 2110         -
                request.headers(),
 2111         -
                &CONTENT_TYPE_OPERATIONWITHREQUIREDMEMBERS,
 2112         -
            ) {
 2113         -
                return Err(::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection::NotAcceptable);
 2114         -
            }
 2115         -
            crate::protocol_serde::shape_operation_with_required_members::de_operation_with_required_members_http_request(request)
 2116         -
                            .await
 2117         -
                            .map_err(Into::into)
 2118         -
        };
 2119         -
        use ::futures_util::future::TryFutureExt;
 2120         -
        let fut = fut.map_err(
 2121         -
            |e: ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection| {
 2122         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
 2123         -
                ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e)
 2124         -
            },
        1282  +
}
        1283  +
        1284  +
impl<B>
        1285  +
    ::aws_smithy_http_server::request::FromRequest<
        1286  +
        ::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0,
        1287  +
        B,
        1288  +
    > for crate::input::JsonUnionsInput
        1289  +
where
        1290  +
    B: ::aws_smithy_http_server::body::HttpBody + Send,
        1291  +
    B: 'static,
        1292  +
        1293  +
    B::Data: Send,
        1294  +
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection:
        1295  +
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
        1296  +
{
        1297  +
    type Rejection = ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError;
        1298  +
    type Future = JsonUnionsInputFuture;
        1299  +
        1300  +
    fn from_request(request: ::http::Request<B>) -> Self::Future {
        1301  +
        let fut = async move {
        1302  +
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
        1303  +
                request.headers(),
        1304  +
                &CONTENT_TYPE_JSONUNIONS,
        1305  +
            ) {
        1306  +
                return Err(::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection::NotAcceptable);
        1307  +
            }
        1308  +
            crate::protocol_serde::shape_json_unions::de_json_unions_http_request(request)
        1309  +
                .await
        1310  +
                .map_err(Into::into)
        1311  +
        };
        1312  +
        use ::futures_util::future::TryFutureExt;
        1313  +
        let fut = fut.map_err(
        1314  +
            |e: ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection| {
        1315  +
                ::tracing::debug!(error = %e, "failed to deserialize request");
        1316  +
                ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e)
        1317  +
            },
        1318  +
        );
        1319  +
        JsonUnionsInputFuture {
        1320  +
            inner: Box::pin(fut),
        1321  +
        }
        1322  +
    }
        1323  +
}
        1324  +
impl
        1325  +
    ::aws_smithy_http_server::response::IntoResponse<
        1326  +
        ::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0,
        1327  +
    > for crate::output::JsonUnionsOutput
        1328  +
{
        1329  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
        1330  +
        match crate::protocol_serde::shape_json_unions::ser_json_unions_http_response(self) {
        1331  +
            Ok(response) => response,
        1332  +
            Err(e) => {
        1333  +
                ::tracing::error!(error = %e, "failed to serialize response");
        1334  +
                ::aws_smithy_http_server::response::IntoResponse::<
        1335  +
                    ::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0,
        1336  +
                >::into_response(
        1337  +
                    ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(
        1338  +
                        e,
        1339  +
                    ),
        1340  +
                )
        1341  +
            }
        1342  +
        }
        1343  +
    }
        1344  +
}
        1345  +
impl
        1346  +
    ::aws_smithy_http_server::response::IntoResponse<
        1347  +
        ::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0,
        1348  +
    > for crate::error::JsonUnionsError
        1349  +
{
        1350  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
        1351  +
        match crate::protocol_serde::shape_json_unions::ser_json_unions_http_error(&self) {
        1352  +
            Ok(mut response) => {
        1353  +
                response.extensions_mut().insert(
        1354  +
                    ::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()),
        1355  +
                );
        1356  +
                response
        1357  +
            }
        1358  +
            Err(e) => {
        1359  +
                ::tracing::error!(error = %e, "failed to serialize response");
        1360  +
                ::aws_smithy_http_server::response::IntoResponse::<
        1361  +
                    ::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0,
        1362  +
                >::into_response(
        1363  +
                    ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(
        1364  +
                        e,
        1365  +
                    ),
        1366  +
                )
        1367  +
            }
        1368  +
        }
        1369  +
    }
        1370  +
}
        1371  +
        1372  +
#[allow(unreachable_code, unused_variables)]
        1373  +
#[cfg(test)]
        1374  +
mod json_unions_test {
        1375  +
        1376  +
    /// Serializes a string union value
        1377  +
    /// Test ID: AwsJson10SerializeStringUnionValue
        1378  +
    #[::tokio::test]
        1379  +
    #[::tracing_test::traced_test]
        1380  +
    async fn aws_json10_serialize_string_union_value_request() {
        1381  +
        #[allow(unused_mut)]
        1382  +
        let mut http_request = http::Request::builder()
        1383  +
            .uri("/")
        1384  +
            .method("POST")
        1385  +
            .header("Content-Type", "application/x-amz-json-1.0")
        1386  +
            .header("X-Amz-Target", "JsonRpc10.JsonUnions")
        1387  +
            .body(::aws_smithy_http_server::body::Body::from(
        1388  +
                ::bytes::Bytes::from_static(
        1389  +
                    "{\n    \"contents\": {\n        \"stringValue\": \"foo\"\n    }\n}".as_bytes(),
        1390  +
                ),
        1391  +
            ))
        1392  +
            .unwrap();
        1393  +
        #[allow(unused_mut)]
        1394  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
        1395  +
        let config = crate::service::JsonRpc10Config::builder().build();
        1396  +
        let service = crate::service::JsonRpc10::builder::<::hyper::body::Body, _, _, _>(config)
        1397  +
            .json_unions(move |input: crate::input::JsonUnionsInput| {
        1398  +
                let sender = sender.clone();
        1399  +
                async move {
        1400  +
                    let result = {
        1401  +
                        let expected = crate::input::JsonUnionsInput {
        1402  +
                            contents: ::std::option::Option::Some(
        1403  +
                                crate::model::MyUnion::StringValue("foo".to_owned()),
        1404  +
                            ),
        1405  +
                        };
        1406  +
                        ::pretty_assertions::assert_eq!(input, expected);
        1407  +
                        let response = crate::output::JsonUnionsOutput {
        1408  +
                            contents: ::std::option::Option::None,
        1409  +
                        };
        1410  +
                        Ok(response)
        1411  +
                    };
        1412  +
                    sender.send(()).await.expect("receiver dropped early");
        1413  +
                    result
        1414  +
                }
        1415  +
            })
        1416  +
            .build_unchecked();
        1417  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
        1418  +
            .await
        1419  +
            .expect("unable to make an HTTP request");
        1420  +
        assert!(
        1421  +
            receiver.recv().await.is_some(),
        1422  +
            "we expected operation handler to be invoked but it was not entered"
        1423  +
        );
        1424  +
    }
        1425  +
    /// Serializes a boolean union value
        1426  +
    /// Test ID: AwsJson10SerializeBooleanUnionValue
        1427  +
    #[::tokio::test]
        1428  +
    #[::tracing_test::traced_test]
        1429  +
    async fn aws_json10_serialize_boolean_union_value_request() {
        1430  +
        #[allow(unused_mut)]
        1431  +
        let mut http_request = http::Request::builder()
        1432  +
            .uri("/")
        1433  +
            .method("POST")
        1434  +
            .header("Content-Type", "application/x-amz-json-1.0")
        1435  +
            .header("X-Amz-Target", "JsonRpc10.JsonUnions")
        1436  +
            .body(::aws_smithy_http_server::body::Body::from(
        1437  +
                ::bytes::Bytes::from_static(
        1438  +
                    "{\n    \"contents\": {\n        \"booleanValue\": true\n    }\n}".as_bytes(),
        1439  +
                ),
        1440  +
            ))
        1441  +
            .unwrap();
        1442  +
        #[allow(unused_mut)]
        1443  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
        1444  +
        let config = crate::service::JsonRpc10Config::builder().build();
        1445  +
        let service = crate::service::JsonRpc10::builder::<::hyper::body::Body, _, _, _>(config)
        1446  +
            .json_unions(move |input: crate::input::JsonUnionsInput| {
        1447  +
                let sender = sender.clone();
        1448  +
                async move {
        1449  +
                    let result = {
        1450  +
                        let expected = crate::input::JsonUnionsInput {
        1451  +
                            contents: ::std::option::Option::Some(
        1452  +
                                crate::model::MyUnion::BooleanValue(true),
        1453  +
                            ),
        1454  +
                        };
        1455  +
                        ::pretty_assertions::assert_eq!(input, expected);
        1456  +
                        let response = crate::output::JsonUnionsOutput {
        1457  +
                            contents: ::std::option::Option::None,
        1458  +
                        };
        1459  +
                        Ok(response)
        1460  +
                    };
        1461  +
                    sender.send(()).await.expect("receiver dropped early");
        1462  +
                    result
        1463  +
                }
        1464  +
            })
        1465  +
            .build_unchecked();
        1466  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
        1467  +
            .await
        1468  +
            .expect("unable to make an HTTP request");
        1469  +
        assert!(
        1470  +
            receiver.recv().await.is_some(),
        1471  +
            "we expected operation handler to be invoked but it was not entered"
 2125   1472   
        );
 2126         -
        OperationWithRequiredMembersInputFuture {
 2127         -
            inner: Box::pin(fut),
 2128         -
        }
 2129   1473   
    }
 2130         -
}
 2131         -
impl
 2132         -
    ::aws_smithy_http_server::response::IntoResponse<
 2133         -
        ::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0,
 2134         -
    > for crate::output::OperationWithRequiredMembersOutput
 2135         -
{
 2136         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
 2137         -
        match crate::protocol_serde::shape_operation_with_required_members::ser_operation_with_required_members_http_response(self) {
 2138         -
                        Ok(response) => response,
 2139         -
                        Err(e) => {
 2140         -
                            ::tracing::error!(error = %e, "failed to serialize response");
 2141         -
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0>::into_response(::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e))
 2142         -
                        }
 2143         -
                    }
        1474  +
    /// Serializes a number union value
        1475  +
    /// Test ID: AwsJson10SerializeNumberUnionValue
        1476  +
    #[::tokio::test]
        1477  +
    #[::tracing_test::traced_test]
        1478  +
    async fn aws_json10_serialize_number_union_value_request() {
        1479  +
        #[allow(unused_mut)]
        1480  +
        let mut http_request = http::Request::builder()
        1481  +
            .uri("/")
        1482  +
            .method("POST")
        1483  +
            .header("Content-Type", "application/x-amz-json-1.0")
        1484  +
            .header("X-Amz-Target", "JsonRpc10.JsonUnions")
        1485  +
            .body(::aws_smithy_http_server::body::Body::from(
        1486  +
                ::bytes::Bytes::from_static(
        1487  +
                    "{\n    \"contents\": {\n        \"numberValue\": 1\n    }\n}".as_bytes(),
        1488  +
                ),
        1489  +
            ))
        1490  +
            .unwrap();
        1491  +
        #[allow(unused_mut)]
        1492  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
        1493  +
        let config = crate::service::JsonRpc10Config::builder().build();
        1494  +
        let service = crate::service::JsonRpc10::builder::<::hyper::body::Body, _, _, _>(config)
        1495  +
            .json_unions(move |input: crate::input::JsonUnionsInput| {
        1496  +
                let sender = sender.clone();
        1497  +
                async move {
        1498  +
                    let result = {
        1499  +
                        let expected = crate::input::JsonUnionsInput {
        1500  +
                            contents: ::std::option::Option::Some(
        1501  +
                                crate::model::MyUnion::NumberValue(1),
        1502  +
                            ),
        1503  +
                        };
        1504  +
                        ::pretty_assertions::assert_eq!(input, expected);
        1505  +
                        let response = crate::output::JsonUnionsOutput {
        1506  +
                            contents: ::std::option::Option::None,
        1507  +
                        };
        1508  +
                        Ok(response)
        1509  +
                    };
        1510  +
                    sender.send(()).await.expect("receiver dropped early");
        1511  +
                    result
        1512  +
                }
        1513  +
            })
        1514  +
            .build_unchecked();
        1515  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
        1516  +
            .await
        1517  +
            .expect("unable to make an HTTP request");
        1518  +
        assert!(
        1519  +
            receiver.recv().await.is_some(),
        1520  +
            "we expected operation handler to be invoked but it was not entered"
        1521  +
        );
 2144   1522   
    }
 2145         -
}
 2146         -
 2147         -
static CONTENT_TYPE_OPERATIONWITHDEFAULTS: ::once_cell::sync::Lazy<::mime::Mime> =
 2148         -
    ::once_cell::sync::Lazy::new(|| {
 2149         -
        "application/x-amz-json-1.0"
 2150         -
            .parse::<::mime::Mime>()
 2151         -
            .expect("BUG: MIME parsing failed, content_type is not valid")
 2152         -
    });
 2153         -
::pin_project_lite::pin_project! {
 2154         -
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
 2155         -
    /// [`OperationWithDefaultsInput`](crate::input::OperationWithDefaultsInput) using modelled bindings.
 2156         -
    pub struct OperationWithDefaultsInputFuture {
 2157         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::OperationWithDefaultsInput, ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError>> + Send>>
        1523  +
    /// Serializes a blob union value
        1524  +
    /// Test ID: AwsJson10SerializeBlobUnionValue
        1525  +
    #[::tokio::test]
        1526  +
    #[::tracing_test::traced_test]
        1527  +
    async fn aws_json10_serialize_blob_union_value_request() {
        1528  +
        #[allow(unused_mut)]
        1529  +
        let mut http_request = http::Request::builder()
        1530  +
            .uri("/")
        1531  +
            .method("POST")
        1532  +
            .header("Content-Type", "application/x-amz-json-1.0")
        1533  +
            .header("X-Amz-Target", "JsonRpc10.JsonUnions")
        1534  +
            .body(::aws_smithy_http_server::body::Body::from(
        1535  +
                ::bytes::Bytes::from_static(
        1536  +
                    "{\n    \"contents\": {\n        \"blobValue\": \"Zm9v\"\n    }\n}".as_bytes(),
        1537  +
                ),
        1538  +
            ))
        1539  +
            .unwrap();
        1540  +
        #[allow(unused_mut)]
        1541  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
        1542  +
        let config = crate::service::JsonRpc10Config::builder().build();
        1543  +
        let service = crate::service::JsonRpc10::builder::<::hyper::body::Body, _, _, _>(config)
        1544  +
            .json_unions(move |input: crate::input::JsonUnionsInput| {
        1545  +
                let sender = sender.clone();
        1546  +
                async move {
        1547  +
                    let result = {
        1548  +
                        let expected = crate::input::JsonUnionsInput {
        1549  +
                            contents: ::std::option::Option::Some(
        1550  +
                                crate::model::MyUnion::BlobValue(::aws_smithy_types::Blob::new(
        1551  +
                                    "foo",
        1552  +
                                )),
        1553  +
                            ),
        1554  +
                        };
        1555  +
                        ::pretty_assertions::assert_eq!(input, expected);
        1556  +
                        let response = crate::output::JsonUnionsOutput {
        1557  +
                            contents: ::std::option::Option::None,
        1558  +
                        };
        1559  +
                        Ok(response)
        1560  +
                    };
        1561  +
                    sender.send(()).await.expect("receiver dropped early");
        1562  +
                    result
        1563  +
                }
        1564  +
            })
        1565  +
            .build_unchecked();
        1566  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
        1567  +
            .await
        1568  +
            .expect("unable to make an HTTP request");
        1569  +
        assert!(
        1570  +
            receiver.recv().await.is_some(),
        1571  +
            "we expected operation handler to be invoked but it was not entered"
        1572  +
        );
 2158   1573   
    }
 2159         -
}
 2160         -
 2161         -
impl std::future::Future for OperationWithDefaultsInputFuture {
 2162         -
    type Output = Result<
 2163         -
        crate::input::OperationWithDefaultsInput,
 2164         -
        ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError,
 2165         -
    >;
 2166         -
 2167         -
    fn poll(
 2168         -
        self: std::pin::Pin<&mut Self>,
 2169         -
        cx: &mut std::task::Context<'_>,
 2170         -
    ) -> std::task::Poll<Self::Output> {
 2171         -
        let this = self.project();
 2172         -
        this.inner.as_mut().poll(cx)
        1574  +
    /// Serializes a timestamp union value
        1575  +
    /// Test ID: AwsJson10SerializeTimestampUnionValue
        1576  +
    #[::tokio::test]
        1577  +
    #[::tracing_test::traced_test]
        1578  +
    async fn aws_json10_serialize_timestamp_union_value_request() {
        1579  +
        #[allow(unused_mut)]
        1580  +
        let mut http_request = http::Request::builder()
        1581  +
            .uri("/")
        1582  +
            .method("POST")
        1583  +
            .header("Content-Type", "application/x-amz-json-1.0")
        1584  +
            .header("X-Amz-Target", "JsonRpc10.JsonUnions")
        1585  +
            .body(::aws_smithy_http_server::body::Body::from(
        1586  +
                ::bytes::Bytes::from_static(
        1587  +
                    "{\n    \"contents\": {\n        \"timestampValue\": 1398796238\n    }\n}"
        1588  +
                        .as_bytes(),
        1589  +
                ),
        1590  +
            ))
        1591  +
            .unwrap();
        1592  +
        #[allow(unused_mut)]
        1593  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
        1594  +
        let config = crate::service::JsonRpc10Config::builder().build();
        1595  +
        let service = crate::service::JsonRpc10::builder::<::hyper::body::Body, _, _, _>(config)
        1596  +
            .json_unions(move |input: crate::input::JsonUnionsInput| {
        1597  +
                let sender = sender.clone();
        1598  +
                async move {
        1599  +
                    let result = {
        1600  +
                        let expected = crate::input::JsonUnionsInput {
        1601  +
                            contents: ::std::option::Option::Some(
        1602  +
                                crate::model::MyUnion::TimestampValue(
        1603  +
                                    ::aws_smithy_types::DateTime::from_fractional_secs(
        1604  +
                                        1398796238, 0_f64,
        1605  +
                                    ),
        1606  +
                                ),
        1607  +
                            ),
        1608  +
                        };
        1609  +
                        ::pretty_assertions::assert_eq!(input, expected);
        1610  +
                        let response = crate::output::JsonUnionsOutput {
        1611  +
                            contents: ::std::option::Option::None,
        1612  +
                        };
        1613  +
                        Ok(response)
        1614  +
                    };
        1615  +
                    sender.send(()).await.expect("receiver dropped early");
        1616  +
                    result
        1617  +
                }
        1618  +
            })
        1619  +
            .build_unchecked();
        1620  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
        1621  +
            .await
        1622  +
            .expect("unable to make an HTTP request");
        1623  +
        assert!(
        1624  +
            receiver.recv().await.is_some(),
        1625  +
            "we expected operation handler to be invoked but it was not entered"
        1626  +
        );
 2173   1627   
    }
 2174         -
}
 2175         -
 2176         -
impl<B>
 2177         -
    ::aws_smithy_http_server::request::FromRequest<
 2178         -
        ::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0,
 2179         -
        B,
 2180         -
    > for crate::input::OperationWithDefaultsInput
 2181         -
where
 2182         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
 2183         -
    B: 'static,
 2184         -
 2185         -
    B::Data: Send,
 2186         -
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection:
 2187         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
 2188         -
{
 2189         -
    type Rejection = ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError;
 2190         -
    type Future = OperationWithDefaultsInputFuture;
 2191         -
 2192         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
 2193         -
        let fut = async move {
 2194         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
 2195         -
                request.headers(),
 2196         -
                &CONTENT_TYPE_OPERATIONWITHDEFAULTS,
 2197         -
            ) {
 2198         -
                return Err(::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection::NotAcceptable);
 2199         -
            }
 2200         -
            crate::protocol_serde::shape_operation_with_defaults::de_operation_with_defaults_http_request(request)
 2201         -
                            .await
 2202         -
                            .map_err(Into::into)
 2203         -
        };
 2204         -
        use ::futures_util::future::TryFutureExt;
 2205         -
        let fut = fut.map_err(
 2206         -
            |e: ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection| {
 2207         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
 2208         -
                ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e)
 2209         -
            },
        1628  +
    /// Serializes an enum union value
        1629  +
    /// Test ID: AwsJson10SerializeEnumUnionValue
        1630  +
    #[::tokio::test]
        1631  +
    #[::tracing_test::traced_test]
        1632  +
    async fn aws_json10_serialize_enum_union_value_request() {
        1633  +
        #[allow(unused_mut)]
        1634  +
        let mut http_request = http::Request::builder()
        1635  +
            .uri("/")
        1636  +
            .method("POST")
        1637  +
            .header("Content-Type", "application/x-amz-json-1.0")
        1638  +
            .header("X-Amz-Target", "JsonRpc10.JsonUnions")
        1639  +
            .body(::aws_smithy_http_server::body::Body::from(
        1640  +
                ::bytes::Bytes::from_static(
        1641  +
                    "{\n    \"contents\": {\n        \"enumValue\": \"Foo\"\n    }\n}".as_bytes(),
        1642  +
                ),
        1643  +
            ))
        1644  +
            .unwrap();
        1645  +
        #[allow(unused_mut)]
        1646  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
        1647  +
        let config = crate::service::JsonRpc10Config::builder().build();
        1648  +
        let service = crate::service::JsonRpc10::builder::<::hyper::body::Body, _, _, _>(config)
        1649  +
            .json_unions(move |input: crate::input::JsonUnionsInput| {
        1650  +
                let sender = sender.clone();
        1651  +
                async move {
        1652  +
                    let result = {
        1653  +
                        let expected = crate::input::JsonUnionsInput {
        1654  +
                            contents: ::std::option::Option::Some(
        1655  +
                                crate::model::MyUnion::EnumValue(
        1656  +
                                    "Foo"
        1657  +
                                        .parse::<crate::model::FooEnum>()
        1658  +
                                        .expect("static value validated to member"),
        1659  +
                                ),
        1660  +
                            ),
        1661  +
                        };
        1662  +
                        ::pretty_assertions::assert_eq!(input, expected);
        1663  +
                        let response = crate::output::JsonUnionsOutput {
        1664  +
                            contents: ::std::option::Option::None,
        1665  +
                        };
        1666  +
                        Ok(response)
        1667  +
                    };
        1668  +
                    sender.send(()).await.expect("receiver dropped early");
        1669  +
                    result
        1670  +
                }
        1671  +
            })
        1672  +
            .build_unchecked();
        1673  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
        1674  +
            .await
        1675  +
            .expect("unable to make an HTTP request");
        1676  +
        assert!(
        1677  +
            receiver.recv().await.is_some(),
        1678  +
            "we expected operation handler to be invoked but it was not entered"
 2210   1679   
        );
 2211         -
        OperationWithDefaultsInputFuture {
 2212         -
            inner: Box::pin(fut),
 2213         -
        }
 2214   1680   
    }
 2215         -
}
 2216         -
impl
 2217         -
    ::aws_smithy_http_server::response::IntoResponse<
 2218         -
        ::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0,
 2219         -
    > for crate::output::OperationWithDefaultsOutput
 2220         -
{
 2221         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
 2222         -
        match crate::protocol_serde::shape_operation_with_defaults::ser_operation_with_defaults_http_response(self) {
 2223         -
                        Ok(response) => response,
 2224         -
                        Err(e) => {
 2225         -
                            ::tracing::error!(error = %e, "failed to serialize response");
 2226         -
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0>::into_response(::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e))
 2227         -
                        }
 2228         -
                    }
        1681  +
    /// Serializes an intEnum union value
        1682  +
    /// Test ID: AwsJson10SerializeIntEnumUnionValue
        1683  +
    #[::tokio::test]
        1684  +
    #[::tracing_test::traced_test]
        1685  +
    async fn aws_json10_serialize_int_enum_union_value_request() {
        1686  +
        #[allow(unused_mut)]
        1687  +
        let mut http_request = http::Request::builder()
        1688  +
            .uri("/")
        1689  +
            .method("POST")
        1690  +
            .header("Content-Type", "application/x-amz-json-1.0")
        1691  +
            .header("X-Amz-Target", "JsonRpc10.JsonUnions")
        1692  +
            .body(::aws_smithy_http_server::body::Body::from(
        1693  +
                ::bytes::Bytes::from_static(
        1694  +
                    "{\n    \"contents\": {\n        \"intEnumValue\": 1\n    }\n}".as_bytes(),
        1695  +
                ),
        1696  +
            ))
        1697  +
            .unwrap();
        1698  +
        #[allow(unused_mut)]
        1699  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
        1700  +
        let config = crate::service::JsonRpc10Config::builder().build();
        1701  +
        let service = crate::service::JsonRpc10::builder::<::hyper::body::Body, _, _, _>(config)
        1702  +
            .json_unions(move |input: crate::input::JsonUnionsInput| {
        1703  +
                let sender = sender.clone();
        1704  +
                async move {
        1705  +
                    let result = {
        1706  +
                        let expected = crate::input::JsonUnionsInput {
        1707  +
                            contents: ::std::option::Option::Some(
        1708  +
                                crate::model::MyUnion::IntEnumValue(1),
        1709  +
                            ),
        1710  +
                        };
        1711  +
                        ::pretty_assertions::assert_eq!(input, expected);
        1712  +
                        let response = crate::output::JsonUnionsOutput {
        1713  +
                            contents: ::std::option::Option::None,
        1714  +
                        };
        1715  +
                        Ok(response)
        1716  +
                    };
        1717  +
                    sender.send(()).await.expect("receiver dropped early");
        1718  +
                    result
        1719  +
                }
        1720  +
            })
        1721  +
            .build_unchecked();
        1722  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
        1723  +
            .await
        1724  +
            .expect("unable to make an HTTP request");
        1725  +
        assert!(
        1726  +
            receiver.recv().await.is_some(),
        1727  +
            "we expected operation handler to be invoked but it was not entered"
        1728  +
        );
 2229   1729   
    }
 2230         -
}
 2231         -
impl
 2232         -
    ::aws_smithy_http_server::response::IntoResponse<
 2233         -
        ::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0,
 2234         -
    > for crate::error::OperationWithDefaultsError
 2235         -
{
 2236         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
 2237         -
        match crate::protocol_serde::shape_operation_with_defaults::ser_operation_with_defaults_http_error(&self) {
 2238         -
            Ok(mut response) => {
 2239         -
                response.extensions_mut().insert(::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()));
 2240         -
                response
 2241         -
            },
 2242         -
            Err(e) => {
 2243         -
                ::tracing::error!(error = %e, "failed to serialize response");
 2244         -
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0>::into_response(::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e))
 2245         -
            }
 2246         -
        }
        1730  +
    /// Serializes a list union value
        1731  +
    /// Test ID: AwsJson10SerializeListUnionValue
        1732  +
    #[::tokio::test]
        1733  +
    #[::tracing_test::traced_test]
        1734  +
    async fn aws_json10_serialize_list_union_value_request() {
        1735  +
        #[allow(unused_mut)]
        1736  +
        let mut http_request = http::Request::builder()
        1737  +
            .uri("/")
        1738  +
            .method("POST")
        1739  +
            .header("Content-Type", "application/x-amz-json-1.0")
        1740  +
            .header("X-Amz-Target", "JsonRpc10.JsonUnions")
        1741  +
            .body(::aws_smithy_http_server::body::Body::from(
        1742  +
                ::bytes::Bytes::from_static(
        1743  +
                    "{\n    \"contents\": {\n        \"listValue\": [\"foo\", \"bar\"]\n    }\n}"
        1744  +
                        .as_bytes(),
        1745  +
                ),
        1746  +
            ))
        1747  +
            .unwrap();
        1748  +
        #[allow(unused_mut)]
        1749  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
        1750  +
        let config = crate::service::JsonRpc10Config::builder().build();
        1751  +
        let service = crate::service::JsonRpc10::builder::<::hyper::body::Body, _, _, _>(config)
        1752  +
            .json_unions(move |input: crate::input::JsonUnionsInput| {
        1753  +
                let sender = sender.clone();
        1754  +
                async move {
        1755  +
                    let result = {
        1756  +
                        let expected = crate::input::JsonUnionsInput {
        1757  +
                            contents: ::std::option::Option::Some(
        1758  +
                                crate::model::MyUnion::ListValue(vec![
        1759  +
                                    "foo".to_owned(),
        1760  +
                                    "bar".to_owned(),
        1761  +
                                ]),
        1762  +
                            ),
        1763  +
                        };
        1764  +
                        ::pretty_assertions::assert_eq!(input, expected);
        1765  +
                        let response = crate::output::JsonUnionsOutput {
        1766  +
                            contents: ::std::option::Option::None,
        1767  +
                        };
        1768  +
                        Ok(response)
        1769  +
                    };
        1770  +
                    sender.send(()).await.expect("receiver dropped early");
        1771  +
                    result
        1772  +
                }
        1773  +
            })
        1774  +
            .build_unchecked();
        1775  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
        1776  +
            .await
        1777  +
            .expect("unable to make an HTTP request");
        1778  +
        assert!(
        1779  +
            receiver.recv().await.is_some(),
        1780  +
            "we expected operation handler to be invoked but it was not entered"
        1781  +
        );
 2247   1782   
    }
 2248         -
}
 2249         -
 2250         -
static CONTENT_TYPE_PUTWITHCONTENTENCODING: ::once_cell::sync::Lazy<::mime::Mime> =
 2251         -
    ::once_cell::sync::Lazy::new(|| {
 2252         -
        "application/x-amz-json-1.0"
 2253         -
            .parse::<::mime::Mime>()
 2254         -
            .expect("BUG: MIME parsing failed, content_type is not valid")
 2255         -
    });
 2256         -
::pin_project_lite::pin_project! {
 2257         -
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
 2258         -
    /// [`PutWithContentEncodingInput`](crate::input::PutWithContentEncodingInput) using modelled bindings.
 2259         -
    pub struct PutWithContentEncodingInputFuture {
 2260         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::PutWithContentEncodingInput, ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError>> + Send>>
        1783  +
    /// Serializes a map union value
        1784  +
    /// Test ID: AwsJson10SerializeMapUnionValue
        1785  +
    #[::tokio::test]
        1786  +
    #[::tracing_test::traced_test]
        1787  +
    async fn aws_json10_serialize_map_union_value_request() {
        1788  +
        #[allow(unused_mut)]
        1789  +
                    let mut http_request = http::Request::builder()
        1790  +
                        .uri("/")
        1791  +
                        .method("POST")
        1792  +
        .header("Content-Type", "application/x-amz-json-1.0")
        1793  +
        .header("X-Amz-Target", "JsonRpc10.JsonUnions")
        1794  +
        .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();
        1795  +
        #[allow(unused_mut)]
        1796  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
        1797  +
        let config = crate::service::JsonRpc10Config::builder().build();
        1798  +
        let service = crate::service::JsonRpc10::builder::<::hyper::body::Body, _, _, _>(config)
        1799  +
            .json_unions(move |input: crate::input::JsonUnionsInput| {
        1800  +
                let sender = sender.clone();
        1801  +
                async move {
        1802  +
                    let result = {
        1803  +
                        let expected = crate::input::JsonUnionsInput {
        1804  +
                            contents: ::std::option::Option::Some(crate::model::MyUnion::MapValue(
        1805  +
                                {
        1806  +
                                    let mut ret = ::std::collections::HashMap::new();
        1807  +
                                    ret.insert("foo".to_owned(), "bar".to_owned());
        1808  +
                                    ret.insert("spam".to_owned(), "eggs".to_owned());
        1809  +
                                    ret
        1810  +
                                },
        1811  +
                            )),
        1812  +
                        };
        1813  +
                        ::pretty_assertions::assert_eq!(input, expected);
        1814  +
                        let response = crate::output::JsonUnionsOutput {
        1815  +
                            contents: ::std::option::Option::None,
        1816  +
                        };
        1817  +
                        Ok(response)
        1818  +
                    };
        1819  +
                    sender.send(()).await.expect("receiver dropped early");
        1820  +
                    result
        1821  +
                }
        1822  +
            })
        1823  +
            .build_unchecked();
        1824  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
        1825  +
            .await
        1826  +
            .expect("unable to make an HTTP request");
        1827  +
        assert!(
        1828  +
            receiver.recv().await.is_some(),
        1829  +
            "we expected operation handler to be invoked but it was not entered"
        1830  +
        );
 2261   1831   
    }
 2262         -
}
 2263         -
 2264         -
impl std::future::Future for PutWithContentEncodingInputFuture {
 2265         -
    type Output = Result<
 2266         -
        crate::input::PutWithContentEncodingInput,
 2267         -
        ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError,
 2268         -
    >;
 2269         -
 2270         -
    fn poll(
 2271         -
        self: std::pin::Pin<&mut Self>,
 2272         -
        cx: &mut std::task::Context<'_>,
 2273         -
    ) -> std::task::Poll<Self::Output> {
 2274         -
        let this = self.project();
 2275         -
        this.inner.as_mut().poll(cx)
        1832  +
    /// Serializes a structure union value
        1833  +
    /// Test ID: AwsJson10SerializeStructureUnionValue
        1834  +
    #[::tokio::test]
        1835  +
    #[::tracing_test::traced_test]
        1836  +
    async fn aws_json10_serialize_structure_union_value_request() {
        1837  +
        #[allow(unused_mut)]
        1838  +
                    let mut http_request = http::Request::builder()
        1839  +
                        .uri("/")
        1840  +
                        .method("POST")
        1841  +
        .header("Content-Type", "application/x-amz-json-1.0")
        1842  +
        .header("X-Amz-Target", "JsonRpc10.JsonUnions")
        1843  +
        .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();
        1844  +
        #[allow(unused_mut)]
        1845  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
        1846  +
        let config = crate::service::JsonRpc10Config::builder().build();
        1847  +
        let service = crate::service::JsonRpc10::builder::<::hyper::body::Body, _, _, _>(config)
        1848  +
            .json_unions(move |input: crate::input::JsonUnionsInput| {
        1849  +
                let sender = sender.clone();
        1850  +
                async move {
        1851  +
                    let result = {
        1852  +
                        let expected = crate::input::JsonUnionsInput {
        1853  +
                            contents: ::std::option::Option::Some(
        1854  +
                                crate::model::MyUnion::StructureValue(
        1855  +
                                    crate::model::GreetingStruct {
        1856  +
                                        hi: ::std::option::Option::Some("hello".to_owned()),
        1857  +
                                    },
        1858  +
                                ),
        1859  +
                            ),
        1860  +
                        };
        1861  +
                        ::pretty_assertions::assert_eq!(input, expected);
        1862  +
                        let response = crate::output::JsonUnionsOutput {
        1863  +
                            contents: ::std::option::Option::None,
        1864  +
                        };
        1865  +
                        Ok(response)
        1866  +
                    };
        1867  +
                    sender.send(()).await.expect("receiver dropped early");
        1868  +
                    result
        1869  +
                }
        1870  +
            })
        1871  +
            .build_unchecked();
        1872  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
        1873  +
            .await
        1874  +
            .expect("unable to make an HTTP request");
        1875  +
        assert!(
        1876  +
            receiver.recv().await.is_some(),
        1877  +
            "we expected operation handler to be invoked but it was not entered"
        1878  +
        );
 2276   1879   
    }
 2277         -
}
 2278         -
 2279         -
impl<B>
 2280         -
    ::aws_smithy_http_server::request::FromRequest<
 2281         -
        ::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0,
 2282         -
        B,
 2283         -
    > for crate::input::PutWithContentEncodingInput
 2284         -
where
 2285         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
 2286         -
    B: 'static,
 2287         -
 2288         -
    B::Data: Send,
 2289         -
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection:
 2290         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
 2291         -
{
 2292         -
    type Rejection = ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError;
 2293         -
    type Future = PutWithContentEncodingInputFuture;
 2294         -
 2295         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
 2296         -
        let fut = async move {
 2297         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
 2298         -
                request.headers(),
 2299         -
                &CONTENT_TYPE_PUTWITHCONTENTENCODING,
 2300         -
            ) {
 2301         -
                return Err(::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection::NotAcceptable);
 2302         -
            }
 2303         -
            crate::protocol_serde::shape_put_with_content_encoding::de_put_with_content_encoding_http_request(request)
 2304         -
                            .await
 2305         -
                            .map_err(Into::into)
        1880  +
    /// Deserializes a string union value
        1881  +
    /// Test ID: AwsJson10DeserializeStringUnionValue
        1882  +
    #[::tokio::test]
        1883  +
    #[::tracing_test::traced_test]
        1884  +
    async fn aws_json10_deserialize_string_union_value_response() {
        1885  +
        let output = crate::output::JsonUnionsOutput {
        1886  +
            contents: ::std::option::Option::Some(crate::model::MyUnion::StringValue(
        1887  +
                "foo".to_owned(),
        1888  +
            )),
 2306   1889   
        };
 2307         -
        use ::futures_util::future::TryFutureExt;
 2308         -
        let fut = fut.map_err(
 2309         -
            |e: ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection| {
 2310         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
 2311         -
                ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e)
 2312         -
            },
        1890  +
        use ::aws_smithy_http_server::response::IntoResponse;
        1891  +
        let http_response = output.into_response();
        1892  +
        ::pretty_assertions::assert_eq!(
        1893  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
        1894  +
            http_response.status()
 2313   1895   
        );
 2314         -
        PutWithContentEncodingInputFuture {
 2315         -
            inner: Box::pin(fut),
 2316         -
        }
        1896  +
        let expected_headers = [("Content-Type", "application/x-amz-json-1.0")];
        1897  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
        1898  +
            http_response.headers(),
        1899  +
            expected_headers,
        1900  +
        ));
        1901  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
        1902  +
            .await
        1903  +
            .expect("unable to extract body to bytes");
        1904  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
        1905  +
            &body,
        1906  +
            "{\n    \"contents\": {\n        \"stringValue\": \"foo\"\n    }\n}",
        1907  +
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
        1908  +
        ));
 2317   1909   
    }
 2318         -
}
 2319         -
impl
 2320         -
    ::aws_smithy_http_server::response::IntoResponse<
 2321         -
        ::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0,
 2322         -
    > for crate::output::PutWithContentEncodingOutput
 2323         -
{
 2324         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
 2325         -
        match crate::protocol_serde::shape_put_with_content_encoding::ser_put_with_content_encoding_http_response(self) {
 2326         -
                        Ok(response) => response,
 2327         -
                        Err(e) => {
 2328         -
                            ::tracing::error!(error = %e, "failed to serialize response");
 2329         -
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0>::into_response(::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e))
 2330         -
                        }
 2331         -
                    }
        1910  +
    /// Deserializes a boolean union value
        1911  +
    /// Test ID: AwsJson10DeserializeBooleanUnionValue
        1912  +
    #[::tokio::test]
        1913  +
    #[::tracing_test::traced_test]
        1914  +
    async fn aws_json10_deserialize_boolean_union_value_response() {
        1915  +
        let output = crate::output::JsonUnionsOutput {
        1916  +
            contents: ::std::option::Option::Some(crate::model::MyUnion::BooleanValue(true)),
        1917  +
        };
        1918  +
        use ::aws_smithy_http_server::response::IntoResponse;
        1919  +
        let http_response = output.into_response();
        1920  +
        ::pretty_assertions::assert_eq!(
        1921  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
        1922  +
            http_response.status()
        1923  +
        );
        1924  +
        let expected_headers = [("Content-Type", "application/x-amz-json-1.0")];
        1925  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
        1926  +
            http_response.headers(),
        1927  +
            expected_headers,
        1928  +
        ));
        1929  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
        1930  +
            .await
        1931  +
            .expect("unable to extract body to bytes");
        1932  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
        1933  +
            &body,
        1934  +
            "{\n    \"contents\": {\n        \"booleanValue\": true\n    }\n}",
        1935  +
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
        1936  +
        ));
 2332   1937   
    }
 2333         -
}
 2334         -
 2335         -
static CONTENT_TYPE_HOSTWITHPATHOPERATION: ::once_cell::sync::Lazy<::mime::Mime> =
 2336         -
    ::once_cell::sync::Lazy::new(|| {
 2337         -
        "application/x-amz-json-1.0"
 2338         -
            .parse::<::mime::Mime>()
 2339         -
            .expect("BUG: MIME parsing failed, content_type is not valid")
 2340         -
    });
 2341         -
::pin_project_lite::pin_project! {
 2342         -
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
 2343         -
    /// [`HostWithPathOperationInput`](crate::input::HostWithPathOperationInput) using modelled bindings.
 2344         -
    pub struct HostWithPathOperationInputFuture {
 2345         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::HostWithPathOperationInput, ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError>> + Send>>
        1938  +
    /// Deserializes a number union value
        1939  +
    /// Test ID: AwsJson10DeserializeNumberUnionValue
        1940  +
    #[::tokio::test]
        1941  +
    #[::tracing_test::traced_test]
        1942  +
    async fn aws_json10_deserialize_number_union_value_response() {
        1943  +
        let output = crate::output::JsonUnionsOutput {
        1944  +
            contents: ::std::option::Option::Some(crate::model::MyUnion::NumberValue(1)),
        1945  +
        };
        1946  +
        use ::aws_smithy_http_server::response::IntoResponse;
        1947  +
        let http_response = output.into_response();
        1948  +
        ::pretty_assertions::assert_eq!(
        1949  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
        1950  +
            http_response.status()
        1951  +
        );
        1952  +
        let expected_headers = [("Content-Type", "application/x-amz-json-1.0")];
        1953  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
        1954  +
            http_response.headers(),
        1955  +
            expected_headers,
        1956  +
        ));
        1957  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
        1958  +
            .await
        1959  +
            .expect("unable to extract body to bytes");
        1960  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
        1961  +
            &body,
        1962  +
            "{\n    \"contents\": {\n        \"numberValue\": 1\n    }\n}",
        1963  +
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
        1964  +
        ));
 2346   1965   
    }
 2347         -
}
 2348         -
 2349         -
impl std::future::Future for HostWithPathOperationInputFuture {
 2350         -
    type Output = Result<
 2351         -
        crate::input::HostWithPathOperationInput,
 2352         -
        ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError,
 2353         -
    >;
 2354         -
 2355         -
    fn poll(
 2356         -
        self: std::pin::Pin<&mut Self>,
 2357         -
        cx: &mut std::task::Context<'_>,
 2358         -
    ) -> std::task::Poll<Self::Output> {
 2359         -
        let this = self.project();
 2360         -
        this.inner.as_mut().poll(cx)
        1966  +
    /// Deserializes a blob union value
        1967  +
    /// Test ID: AwsJson10DeserializeBlobUnionValue
        1968  +
    #[::tokio::test]
        1969  +
    #[::tracing_test::traced_test]
        1970  +
    async fn aws_json10_deserialize_blob_union_value_response() {
        1971  +
        let output = crate::output::JsonUnionsOutput {
        1972  +
            contents: ::std::option::Option::Some(crate::model::MyUnion::BlobValue(
        1973  +
                ::aws_smithy_types::Blob::new("foo"),
        1974  +
            )),
        1975  +
        };
        1976  +
        use ::aws_smithy_http_server::response::IntoResponse;
        1977  +
        let http_response = output.into_response();
        1978  +
        ::pretty_assertions::assert_eq!(
        1979  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
        1980  +
            http_response.status()
        1981  +
        );
        1982  +
        let expected_headers = [("Content-Type", "application/x-amz-json-1.0")];
        1983  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
        1984  +
            http_response.headers(),
        1985  +
            expected_headers,
        1986  +
        ));
        1987  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
        1988  +
            .await
        1989  +
            .expect("unable to extract body to bytes");
        1990  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
        1991  +
            &body,
        1992  +
            "{\n    \"contents\": {\n        \"blobValue\": \"Zm9v\"\n    }\n}",
        1993  +
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
        1994  +
        ));
 2361   1995   
    }
 2362         -
}
 2363         -
 2364         -
impl<B>
 2365         -
    ::aws_smithy_http_server::request::FromRequest<
 2366         -
        ::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0,
 2367         -
        B,
 2368         -
    > for crate::input::HostWithPathOperationInput
 2369         -
where
 2370         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
 2371         -
    B: 'static,
 2372         -
 2373         -
    B::Data: Send,
 2374         -
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection:
 2375         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
 2376         -
{
 2377         -
    type Rejection = ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError;
 2378         -
    type Future = HostWithPathOperationInputFuture;
 2379         -
 2380         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
 2381         -
        let fut = async move {
 2382         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
 2383         -
                request.headers(),
 2384         -
                &CONTENT_TYPE_HOSTWITHPATHOPERATION,
 2385         -
            ) {
 2386         -
                return Err(::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection::NotAcceptable);
 2387         -
            }
 2388         -
            crate::protocol_serde::shape_host_with_path_operation::de_host_with_path_operation_http_request(request)
 2389         -
                            .await
 2390         -
                            .map_err(Into::into)
        1996  +
    /// Deserializes a timestamp union value
        1997  +
    /// Test ID: AwsJson10DeserializeTimestampUnionValue
        1998  +
    #[::tokio::test]
        1999  +
    #[::tracing_test::traced_test]
        2000  +
    async fn aws_json10_deserialize_timestamp_union_value_response() {
        2001  +
        let output = crate::output::JsonUnionsOutput {
        2002  +
            contents: ::std::option::Option::Some(crate::model::MyUnion::TimestampValue(
        2003  +
                ::aws_smithy_types::DateTime::from_fractional_secs(1398796238, 0_f64),
        2004  +
            )),
 2391   2005   
        };
 2392         -
        use ::futures_util::future::TryFutureExt;
 2393         -
        let fut = fut.map_err(
 2394         -
            |e: ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection| {
 2395         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
 2396         -
                ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e)
 2397         -
            },
        2006  +
        use ::aws_smithy_http_server::response::IntoResponse;
        2007  +
        let http_response = output.into_response();
        2008  +
        ::pretty_assertions::assert_eq!(
        2009  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
        2010  +
            http_response.status()
 2398   2011   
        );
 2399         -
        HostWithPathOperationInputFuture {
 2400         -
            inner: Box::pin(fut),
 2401         -
        }
        2012  +
        let expected_headers = [("Content-Type", "application/x-amz-json-1.0")];
        2013  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
        2014  +
            http_response.headers(),
        2015  +
            expected_headers,
        2016  +
        ));
        2017  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
        2018  +
            .await
        2019  +
            .expect("unable to extract body to bytes");
        2020  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
        2021  +
            &body,
        2022  +
            "{\n    \"contents\": {\n        \"timestampValue\": 1398796238\n    }\n}",
        2023  +
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
        2024  +
        ));
 2402   2025   
    }
 2403         -
}
 2404         -
impl
 2405         -
    ::aws_smithy_http_server::response::IntoResponse<
 2406         -
        ::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0,
 2407         -
    > for crate::output::HostWithPathOperationOutput
 2408         -
{
 2409         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
 2410         -
        match crate::protocol_serde::shape_host_with_path_operation::ser_host_with_path_operation_http_response(self) {
 2411         -
                        Ok(response) => response,
 2412         -
                        Err(e) => {
 2413         -
                            ::tracing::error!(error = %e, "failed to serialize response");
 2414         -
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0>::into_response(::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e))
 2415         -
                        }
 2416         -
                    }
        2026  +
    /// Deserializes an enum union value
        2027  +
    /// Test ID: AwsJson10DeserializeEnumUnionValue
        2028  +
    #[::tokio::test]
        2029  +
    #[::tracing_test::traced_test]
        2030  +
    async fn aws_json10_deserialize_enum_union_value_response() {
        2031  +
        let output = crate::output::JsonUnionsOutput {
        2032  +
            contents: ::std::option::Option::Some(crate::model::MyUnion::EnumValue(
        2033  +
                "Foo"
        2034  +
                    .parse::<crate::model::FooEnum>()
        2035  +
                    .expect("static value validated to member"),
        2036  +
            )),
        2037  +
        };
        2038  +
        use ::aws_smithy_http_server::response::IntoResponse;
        2039  +
        let http_response = output.into_response();
        2040  +
        ::pretty_assertions::assert_eq!(
        2041  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
        2042  +
            http_response.status()
        2043  +
        );
        2044  +
        let expected_headers = [("Content-Type", "application/x-amz-json-1.0")];
        2045  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
        2046  +
            http_response.headers(),
        2047  +
            expected_headers,
        2048  +
        ));
        2049  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
        2050  +
            .await
        2051  +
            .expect("unable to extract body to bytes");
        2052  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
        2053  +
            &body,
        2054  +
            "{\n    \"contents\": {\n        \"enumValue\": \"Foo\"\n    }\n}",
        2055  +
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
        2056  +
        ));
 2417   2057   
    }
 2418         -
}
 2419         -
 2420         -
static CONTENT_TYPE_ENDPOINTWITHHOSTLABELOPERATION: ::once_cell::sync::Lazy<::mime::Mime> =
 2421         -
    ::once_cell::sync::Lazy::new(|| {
 2422         -
        "application/x-amz-json-1.0"
 2423         -
            .parse::<::mime::Mime>()
 2424         -
            .expect("BUG: MIME parsing failed, content_type is not valid")
 2425         -
    });
 2426         -
::pin_project_lite::pin_project! {
 2427         -
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
 2428         -
    /// [`EndpointWithHostLabelOperationInput`](crate::input::EndpointWithHostLabelOperationInput) using modelled bindings.
 2429         -
    pub struct EndpointWithHostLabelOperationInputFuture {
 2430         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::EndpointWithHostLabelOperationInput, ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError>> + Send>>
        2058  +
    /// Deserializes an intEnum union value
        2059  +
    /// Test ID: AwsJson10DeserializeIntEnumUnionValue
        2060  +
    #[::tokio::test]
        2061  +
    #[::tracing_test::traced_test]
        2062  +
    async fn aws_json10_deserialize_int_enum_union_value_response() {
        2063  +
        let output = crate::output::JsonUnionsOutput {
        2064  +
            contents: ::std::option::Option::Some(crate::model::MyUnion::IntEnumValue(1)),
        2065  +
        };
        2066  +
        use ::aws_smithy_http_server::response::IntoResponse;
        2067  +
        let http_response = output.into_response();
        2068  +
        ::pretty_assertions::assert_eq!(
        2069  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
        2070  +
            http_response.status()
        2071  +
        );
        2072  +
        let expected_headers = [("Content-Type", "application/x-amz-json-1.0")];
        2073  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
        2074  +
            http_response.headers(),
        2075  +
            expected_headers,
        2076  +
        ));
        2077  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
        2078  +
            .await
        2079  +
            .expect("unable to extract body to bytes");
        2080  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
        2081  +
            &body,
        2082  +
            "{\n    \"contents\": {\n        \"intEnumValue\": 1\n    }\n}",
        2083  +
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
        2084  +
        ));
 2431   2085   
    }
 2432         -
}
 2433         -
 2434         -
impl std::future::Future for EndpointWithHostLabelOperationInputFuture {
 2435         -
    type Output = Result<
 2436         -
        crate::input::EndpointWithHostLabelOperationInput,
 2437         -
        ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError,
 2438         -
    >;
 2439         -
 2440         -
    fn poll(
 2441         -
        self: std::pin::Pin<&mut Self>,
 2442         -
        cx: &mut std::task::Context<'_>,
 2443         -
    ) -> std::task::Poll<Self::Output> {
 2444         -
        let this = self.project();
 2445         -
        this.inner.as_mut().poll(cx)
        2086  +
    /// Deserializes a list union value
        2087  +
    /// Test ID: AwsJson10DeserializeListUnionValue
        2088  +
    #[::tokio::test]
        2089  +
    #[::tracing_test::traced_test]
        2090  +
    async fn aws_json10_deserialize_list_union_value_response() {
        2091  +
        let output = crate::output::JsonUnionsOutput {
        2092  +
            contents: ::std::option::Option::Some(crate::model::MyUnion::ListValue(vec![
        2093  +
                "foo".to_owned(),
        2094  +
                "bar".to_owned(),
        2095  +
            ])),
        2096  +
        };
        2097  +
        use ::aws_smithy_http_server::response::IntoResponse;
        2098  +
        let http_response = output.into_response();
        2099  +
        ::pretty_assertions::assert_eq!(
        2100  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
        2101  +
            http_response.status()
        2102  +
        );
        2103  +
        let expected_headers = [("Content-Type", "application/x-amz-json-1.0")];
        2104  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
        2105  +
            http_response.headers(),
        2106  +
            expected_headers,
        2107  +
        ));
        2108  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
        2109  +
            .await
        2110  +
            .expect("unable to extract body to bytes");
        2111  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
        2112  +
            &body,
        2113  +
            "{\n    \"contents\": {\n        \"listValue\": [\"foo\", \"bar\"]\n    }\n}",
        2114  +
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
        2115  +
        ));
 2446   2116   
    }
 2447         -
}
 2448         -
 2449         -
impl<B>
 2450         -
    ::aws_smithy_http_server::request::FromRequest<
 2451         -
        ::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0,
 2452         -
        B,
 2453         -
    > for crate::input::EndpointWithHostLabelOperationInput
 2454         -
where
 2455         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
 2456         -
    B: 'static,
 2457         -
 2458         -
    B::Data: Send,
 2459         -
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection:
 2460         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
 2461         -
{
 2462         -
    type Rejection = ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError;
 2463         -
    type Future = EndpointWithHostLabelOperationInputFuture;
 2464         -
 2465         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
 2466         -
        let fut = async move {
 2467         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
 2468         -
                request.headers(),
 2469         -
                &CONTENT_TYPE_ENDPOINTWITHHOSTLABELOPERATION,
 2470         -
            ) {
 2471         -
                return Err(::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection::NotAcceptable);
 2472         -
            }
 2473         -
            crate::protocol_serde::shape_endpoint_with_host_label_operation::de_endpoint_with_host_label_operation_http_request(request)
 2474         -
                            .await
 2475         -
                            .map_err(Into::into)
        2117  +
    /// Deserializes a map union value
        2118  +
    /// Test ID: AwsJson10DeserializeMapUnionValue
        2119  +
    #[::tokio::test]
        2120  +
    #[::tracing_test::traced_test]
        2121  +
    async fn aws_json10_deserialize_map_union_value_response() {
        2122  +
        let output = crate::output::JsonUnionsOutput {
        2123  +
            contents: ::std::option::Option::Some(crate::model::MyUnion::MapValue({
        2124  +
                let mut ret = ::std::collections::HashMap::new();
        2125  +
                ret.insert("foo".to_owned(), "bar".to_owned());
        2126  +
                ret.insert("spam".to_owned(), "eggs".to_owned());
        2127  +
                ret
        2128  +
            })),
 2476   2129   
        };
 2477         -
        use ::futures_util::future::TryFutureExt;
 2478         -
        let fut = fut.map_err(
 2479         -
            |e: ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection| {
 2480         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
 2481         -
                ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e)
 2482         -
            },
        2130  +
        use ::aws_smithy_http_server::response::IntoResponse;
        2131  +
        let http_response = output.into_response();
        2132  +
        ::pretty_assertions::assert_eq!(
        2133  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
        2134  +
            http_response.status()
        2135  +
        );
        2136  +
        let expected_headers = [("Content-Type", "application/x-amz-json-1.0")];
        2137  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
        2138  +
            http_response.headers(),
        2139  +
            expected_headers,
        2140  +
        ));
        2141  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
        2142  +
            .await
        2143  +
            .expect("unable to extract body to bytes");
        2144  +
        ::aws_smithy_protocol_test::assert_ok(
        2145  +
        ::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"))
 2483   2146   
        );
 2484         -
        EndpointWithHostLabelOperationInputFuture {
 2485         -
            inner: Box::pin(fut),
 2486         -
        }
 2487         -
    }
 2488         -
}
 2489         -
impl
 2490         -
    ::aws_smithy_http_server::response::IntoResponse<
 2491         -
        ::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0,
 2492         -
    > for crate::output::EndpointWithHostLabelOperationOutput
 2493         -
{
 2494         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
 2495         -
        match crate::protocol_serde::shape_endpoint_with_host_label_operation::ser_endpoint_with_host_label_operation_http_response(self) {
 2496         -
                        Ok(response) => response,
 2497         -
                        Err(e) => {
 2498         -
                            ::tracing::error!(error = %e, "failed to serialize response");
 2499         -
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0>::into_response(::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e))
 2500         -
                        }
 2501         -
                    }
 2502   2147   
    }
 2503         -
}
 2504         -
impl
 2505         -
    ::aws_smithy_http_server::response::IntoResponse<
 2506         -
        ::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0,
 2507         -
    > for crate::error::EndpointWithHostLabelOperationError
 2508         -
{
 2509         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
 2510         -
        match crate::protocol_serde::shape_endpoint_with_host_label_operation::ser_endpoint_with_host_label_operation_http_error(&self) {
 2511         -
            Ok(mut response) => {
 2512         -
                response.extensions_mut().insert(::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()));
 2513         -
                response
 2514         -
            },
 2515         -
            Err(e) => {
 2516         -
                ::tracing::error!(error = %e, "failed to serialize response");
 2517         -
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0>::into_response(::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e))
 2518         -
            }
 2519         -
        }
        2148  +
    /// Deserializes a structure union value
        2149  +
    /// Test ID: AwsJson10DeserializeStructureUnionValue
        2150  +
    #[::tokio::test]
        2151  +
    #[::tracing_test::traced_test]
        2152  +
    async fn aws_json10_deserialize_structure_union_value_response() {
        2153  +
        let output = crate::output::JsonUnionsOutput {
        2154  +
            contents: ::std::option::Option::Some(crate::model::MyUnion::StructureValue(
        2155  +
                crate::model::GreetingStruct {
        2156  +
                    hi: ::std::option::Option::Some("hello".to_owned()),
        2157  +
                },
        2158  +
            )),
        2159  +
        };
        2160  +
        use ::aws_smithy_http_server::response::IntoResponse;
        2161  +
        let http_response = output.into_response();
        2162  +
        ::pretty_assertions::assert_eq!(
        2163  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
        2164  +
            http_response.status()
        2165  +
        );
        2166  +
        let expected_headers = [("Content-Type", "application/x-amz-json-1.0")];
        2167  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
        2168  +
            http_response.headers(),
        2169  +
            expected_headers,
        2170  +
        ));
        2171  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
        2172  +
            .await
        2173  +
            .expect("unable to extract body to bytes");
        2174  +
        ::aws_smithy_protocol_test::assert_ok(
        2175  +
        ::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"))
        2176  +
        );
 2520   2177   
    }
 2521   2178   
}
 2522   2179   
 2523         -
static CONTENT_TYPE_ENDPOINTOPERATION: ::once_cell::sync::Lazy<::mime::Mime> =
        2180  +
static CONTENT_TYPE_GREETINGWITHERRORS: ::once_cell::sync::Lazy<::mime::Mime> =
 2524   2181   
    ::once_cell::sync::Lazy::new(|| {
 2525   2182   
        "application/x-amz-json-1.0"
 2526   2183   
            .parse::<::mime::Mime>()
 2527   2184   
            .expect("BUG: MIME parsing failed, content_type is not valid")
 2528   2185   
    });
 2529   2186   
::pin_project_lite::pin_project! {
 2530   2187   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
 2531         -
    /// [`EndpointOperationInput`](crate::input::EndpointOperationInput) using modelled bindings.
 2532         -
    pub struct EndpointOperationInputFuture {
 2533         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::EndpointOperationInput, ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError>> + Send>>
        2188  +
    /// [`GreetingWithErrorsInput`](crate::input::GreetingWithErrorsInput) using modelled bindings.
        2189  +
    pub struct GreetingWithErrorsInputFuture {
        2190  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::GreetingWithErrorsInput, ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError>> + Send>>
 2534   2191   
    }
 2535   2192   
}
 2536   2193   
 2537         -
impl std::future::Future for EndpointOperationInputFuture {
        2194  +
impl std::future::Future for GreetingWithErrorsInputFuture {
 2538   2195   
    type Output = Result<
 2539         -
        crate::input::EndpointOperationInput,
        2196  +
        crate::input::GreetingWithErrorsInput,
 2540   2197   
        ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError,
 2541   2198   
    >;
 2542   2199   
 2543   2200   
    fn poll(
 2544   2201   
        self: std::pin::Pin<&mut Self>,
 2545   2202   
        cx: &mut std::task::Context<'_>,
 2546   2203   
    ) -> std::task::Poll<Self::Output> {
 2547   2204   
        let this = self.project();
 2548   2205   
        this.inner.as_mut().poll(cx)
 2549   2206   
    }
 2550   2207   
}
 2551   2208   
 2552   2209   
impl<B>
 2553   2210   
    ::aws_smithy_http_server::request::FromRequest<
 2554   2211   
        ::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0,
 2555   2212   
        B,
 2556         -
    > for crate::input::EndpointOperationInput
        2213  +
    > for crate::input::GreetingWithErrorsInput
 2557   2214   
where
 2558   2215   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
 2559   2216   
    B: 'static,
 2560   2217   
 2561   2218   
    B::Data: Send,
 2562   2219   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection:
 2563   2220   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
 2564   2221   
{
 2565   2222   
    type Rejection = ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError;
 2566         -
    type Future = EndpointOperationInputFuture;
        2223  +
    type Future = GreetingWithErrorsInputFuture;
 2567   2224   
 2568   2225   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
 2569   2226   
        let fut = async move {
 2570   2227   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
 2571   2228   
                request.headers(),
 2572         -
                &CONTENT_TYPE_ENDPOINTOPERATION,
        2229  +
                &CONTENT_TYPE_GREETINGWITHERRORS,
 2573   2230   
            ) {
 2574   2231   
                return Err(::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection::NotAcceptable);
 2575   2232   
            }
 2576         -
            crate::protocol_serde::shape_endpoint_operation::de_endpoint_operation_http_request(
        2233  +
            crate::protocol_serde::shape_greeting_with_errors::de_greeting_with_errors_http_request(
 2577   2234   
                request,
 2578   2235   
            )
 2579   2236   
            .await
 2580   2237   
            .map_err(Into::into)
 2581   2238   
        };
 2582   2239   
        use ::futures_util::future::TryFutureExt;
 2583   2240   
        let fut = fut.map_err(
 2584   2241   
            |e: ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection| {
 2585   2242   
                ::tracing::debug!(error = %e, "failed to deserialize request");
 2586   2243   
                ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e)
 2587   2244   
            },
 2588   2245   
        );
 2589         -
        EndpointOperationInputFuture {
 2590         -
            inner: Box::pin(fut),
 2591         -
        }
 2592         -
    }
 2593         -
}
 2594         -
impl
 2595         -
    ::aws_smithy_http_server::response::IntoResponse<
 2596         -
        ::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0,
 2597         -
    > for crate::output::EndpointOperationOutput
 2598         -
{
 2599         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
 2600         -
        match crate::protocol_serde::shape_endpoint_operation::ser_endpoint_operation_http_response(
 2601         -
            self,
 2602         -
        ) {
 2603         -
            Ok(response) => response,
 2604         -
            Err(e) => {
 2605         -
                ::tracing::error!(error = %e, "failed to serialize response");
 2606         -
                ::aws_smithy_http_server::response::IntoResponse::<
 2607         -
                    ::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0,
 2608         -
                >::into_response(
 2609         -
                    ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(
 2610         -
                        e,
 2611         -
                    ),
 2612         -
                )
 2613         -
            }
 2614         -
        }
 2615         -
    }
 2616         -
}
 2617         -
 2618         -
static CONTENT_TYPE_JSONUNIONS: ::once_cell::sync::Lazy<::mime::Mime> =
 2619         -
    ::once_cell::sync::Lazy::new(|| {
 2620         -
        "application/x-amz-json-1.0"
 2621         -
            .parse::<::mime::Mime>()
 2622         -
            .expect("BUG: MIME parsing failed, content_type is not valid")
 2623         -
    });
 2624         -
::pin_project_lite::pin_project! {
 2625         -
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
 2626         -
    /// [`JsonUnionsInput`](crate::input::JsonUnionsInput) using modelled bindings.
 2627         -
    pub struct JsonUnionsInputFuture {
 2628         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::JsonUnionsInput, ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError>> + Send>>
 2629         -
    }
 2630         -
}
 2631         -
 2632         -
impl std::future::Future for JsonUnionsInputFuture {
 2633         -
    type Output = Result<
 2634         -
        crate::input::JsonUnionsInput,
 2635         -
        ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError,
 2636         -
    >;
 2637         -
 2638         -
    fn poll(
 2639         -
        self: std::pin::Pin<&mut Self>,
 2640         -
        cx: &mut std::task::Context<'_>,
 2641         -
    ) -> std::task::Poll<Self::Output> {
 2642         -
        let this = self.project();
 2643         -
        this.inner.as_mut().poll(cx)
 2644         -
    }
 2645         -
}
 2646         -
 2647         -
impl<B>
 2648         -
    ::aws_smithy_http_server::request::FromRequest<
 2649         -
        ::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0,
 2650         -
        B,
 2651         -
    > for crate::input::JsonUnionsInput
 2652         -
where
 2653         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
 2654         -
    B: 'static,
 2655         -
 2656         -
    B::Data: Send,
 2657         -
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection:
 2658         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
 2659         -
{
 2660         -
    type Rejection = ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError;
 2661         -
    type Future = JsonUnionsInputFuture;
 2662         -
 2663         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
 2664         -
        let fut = async move {
 2665         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
 2666         -
                request.headers(),
 2667         -
                &CONTENT_TYPE_JSONUNIONS,
 2668         -
            ) {
 2669         -
                return Err(::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection::NotAcceptable);
 2670         -
            }
 2671         -
            crate::protocol_serde::shape_json_unions::de_json_unions_http_request(request)
 2672         -
                .await
 2673         -
                .map_err(Into::into)
 2674         -
        };
 2675         -
        use ::futures_util::future::TryFutureExt;
 2676         -
        let fut = fut.map_err(
 2677         -
            |e: ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection| {
 2678         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
 2679         -
                ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e)
 2680         -
            },
 2681         -
        );
 2682         -
        JsonUnionsInputFuture {
        2246  +
        GreetingWithErrorsInputFuture {
 2683   2247   
            inner: Box::pin(fut),
 2684   2248   
        }
 2685   2249   
    }
 2686   2250   
}
 2687   2251   
impl
 2688   2252   
    ::aws_smithy_http_server::response::IntoResponse<
 2689   2253   
        ::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0,
 2690         -
    > for crate::output::JsonUnionsOutput
        2254  +
    > for crate::output::GreetingWithErrorsOutput
 2691   2255   
{
 2692   2256   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
 2693         -
        match crate::protocol_serde::shape_json_unions::ser_json_unions_http_response(self) {
 2694         -
            Ok(response) => response,
 2695         -
            Err(e) => {
 2696         -
                ::tracing::error!(error = %e, "failed to serialize response");
 2697         -
                ::aws_smithy_http_server::response::IntoResponse::<
 2698         -
                    ::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0,
 2699         -
                >::into_response(
 2700         -
                    ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(
 2701         -
                        e,
 2702         -
                    ),
 2703         -
                )
 2704         -
            }
 2705         -
        }
        2257  +
        match crate::protocol_serde::shape_greeting_with_errors::ser_greeting_with_errors_http_response(self) {
        2258  +
                        Ok(response) => response,
        2259  +
                        Err(e) => {
        2260  +
                            ::tracing::error!(error = %e, "failed to serialize response");
        2261  +
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0>::into_response(::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e))
        2262  +
                        }
        2263  +
                    }
 2706   2264   
    }
 2707   2265   
}
 2708   2266   
impl
 2709   2267   
    ::aws_smithy_http_server::response::IntoResponse<
 2710   2268   
        ::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0,
 2711         -
    > for crate::error::JsonUnionsError
        2269  +
    > for crate::error::GreetingWithErrorsError
 2712   2270   
{
 2713   2271   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
 2714         -
        match crate::protocol_serde::shape_json_unions::ser_json_unions_http_error(&self) {
        2272  +
        match crate::protocol_serde::shape_greeting_with_errors::ser_greeting_with_errors_http_error(
        2273  +
            &self,
        2274  +
        ) {
 2715   2275   
            Ok(mut response) => {
 2716   2276   
                response.extensions_mut().insert(
 2717   2277   
                    ::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()),
 2718   2278   
                );
 2719   2279   
                response
 2720   2280   
            }
 2721   2281   
            Err(e) => {
 2722   2282   
                ::tracing::error!(error = %e, "failed to serialize response");
 2723   2283   
                ::aws_smithy_http_server::response::IntoResponse::<
 2724   2284   
                    ::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0,
 2725   2285   
                >::into_response(
 2726   2286   
                    ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(
 2727   2287   
                        e,
 2728   2288   
                    ),
 2729   2289   
                )
 2730   2290   
            }
 2731   2291   
        }
 2732   2292   
    }
 2733   2293   
}
 2734   2294   
 2735         -
static CONTENT_TYPE_GREETINGWITHERRORS: ::once_cell::sync::Lazy<::mime::Mime> =
        2295  +
#[allow(unreachable_code, unused_variables)]
        2296  +
#[cfg(test)]
        2297  +
mod greeting_with_errors_test {
        2298  +
        2299  +
    /// Parses simple JSON errors
        2300  +
    /// Test ID: AwsJson10InvalidGreetingError
        2301  +
    #[::tokio::test]
        2302  +
    #[::tracing_test::traced_test]
        2303  +
    async fn aws_json10_invalid_greeting_error_response() {
        2304  +
        let output = crate::error::InvalidGreeting {
        2305  +
            message: ::std::option::Option::Some("Hi".to_owned()),
        2306  +
        };
        2307  +
        let output = crate::error::GreetingWithErrorsError::InvalidGreeting(output);
        2308  +
        use ::aws_smithy_http_server::response::IntoResponse;
        2309  +
        let http_response = output.into_response();
        2310  +
        ::pretty_assertions::assert_eq!(
        2311  +
            http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
        2312  +
            http_response.status()
        2313  +
        );
        2314  +
        let expected_headers = [("Content-Type", "application/x-amz-json-1.0")];
        2315  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
        2316  +
            http_response.headers(),
        2317  +
            expected_headers,
        2318  +
        ));
        2319  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
        2320  +
            .await
        2321  +
            .expect("unable to extract body to bytes");
        2322  +
        ::aws_smithy_protocol_test::assert_ok(
        2323  +
        ::aws_smithy_protocol_test::validate_body(&body, "{\n    \"__type\": \"aws.protocoltests.json10#InvalidGreeting\",\n    \"Message\": \"Hi\"\n}", ::aws_smithy_protocol_test::MediaType::from("application/json"))
        2324  +
        );
        2325  +
    }
        2326  +
    /// Parses a complex error with no message member
        2327  +
    /// Test ID: AwsJson10ComplexError
        2328  +
    #[::tokio::test]
        2329  +
    #[::tracing_test::traced_test]
        2330  +
    async fn aws_json10_complex_error_response() {
        2331  +
        let output = crate::error::ComplexError {
        2332  +
            top_level: ::std::option::Option::Some("Top level".to_owned()),
        2333  +
            nested: ::std::option::Option::Some(crate::model::ComplexNestedErrorData {
        2334  +
                foo: ::std::option::Option::Some("bar".to_owned()),
        2335  +
            }),
        2336  +
        };
        2337  +
        let output = crate::error::GreetingWithErrorsError::ComplexError(output);
        2338  +
        use ::aws_smithy_http_server::response::IntoResponse;
        2339  +
        let http_response = output.into_response();
        2340  +
        ::pretty_assertions::assert_eq!(
        2341  +
            http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
        2342  +
            http_response.status()
        2343  +
        );
        2344  +
        let expected_headers = [("Content-Type", "application/x-amz-json-1.0")];
        2345  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
        2346  +
            http_response.headers(),
        2347  +
            expected_headers,
        2348  +
        ));
        2349  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
        2350  +
            .await
        2351  +
            .expect("unable to extract body to bytes");
        2352  +
        ::aws_smithy_protocol_test::assert_ok(
        2353  +
        ::aws_smithy_protocol_test::validate_body(&body, "{\n    \"__type\": \"aws.protocoltests.json10#ComplexError\",\n    \"TopLevel\": \"Top level\",\n    \"Nested\": {\n        \"Foo\": \"bar\"\n    }\n}", ::aws_smithy_protocol_test::MediaType::from("application/json"))
        2354  +
        );
        2355  +
    }
        2356  +
    /// Parses a complex error with an empty body
        2357  +
    /// Test ID: AwsJson10EmptyComplexError
        2358  +
    #[::tokio::test]
        2359  +
    #[::tracing_test::traced_test]
        2360  +
    async fn aws_json10_empty_complex_error_response() {
        2361  +
        let output = crate::error::ComplexError {
        2362  +
            top_level: ::std::option::Option::None,
        2363  +
            nested: ::std::option::Option::None,
        2364  +
        };
        2365  +
        let output = crate::error::GreetingWithErrorsError::ComplexError(output);
        2366  +
        use ::aws_smithy_http_server::response::IntoResponse;
        2367  +
        let http_response = output.into_response();
        2368  +
        ::pretty_assertions::assert_eq!(
        2369  +
            http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
        2370  +
            http_response.status()
        2371  +
        );
        2372  +
        let expected_headers = [("Content-Type", "application/x-amz-json-1.0")];
        2373  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
        2374  +
            http_response.headers(),
        2375  +
            expected_headers,
        2376  +
        ));
        2377  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
        2378  +
            .await
        2379  +
            .expect("unable to extract body to bytes");
        2380  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
        2381  +
            &body,
        2382  +
            "{\n    \"__type\": \"aws.protocoltests.json10#ComplexError\"\n}",
        2383  +
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
        2384  +
        ));
        2385  +
    }
        2386  +
}
        2387  +
        2388  +
static CONTENT_TYPE_SIMPLESCALARPROPERTIES: ::once_cell::sync::Lazy<::mime::Mime> =
 2736   2389   
    ::once_cell::sync::Lazy::new(|| {
 2737   2390   
        "application/x-amz-json-1.0"
 2738   2391   
            .parse::<::mime::Mime>()
 2739   2392   
            .expect("BUG: MIME parsing failed, content_type is not valid")
 2740   2393   
    });
 2741   2394   
::pin_project_lite::pin_project! {
 2742   2395   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
 2743         -
    /// [`GreetingWithErrorsInput`](crate::input::GreetingWithErrorsInput) using modelled bindings.
 2744         -
    pub struct GreetingWithErrorsInputFuture {
 2745         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::GreetingWithErrorsInput, ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError>> + Send>>
        2396  +
    /// [`SimpleScalarPropertiesInput`](crate::input::SimpleScalarPropertiesInput) using modelled bindings.
        2397  +
    pub struct SimpleScalarPropertiesInputFuture {
        2398  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::SimpleScalarPropertiesInput, ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError>> + Send>>
 2746   2399   
    }
 2747   2400   
}
 2748   2401   
 2749         -
impl std::future::Future for GreetingWithErrorsInputFuture {
        2402  +
impl std::future::Future for SimpleScalarPropertiesInputFuture {
 2750   2403   
    type Output = Result<
 2751         -
        crate::input::GreetingWithErrorsInput,
        2404  +
        crate::input::SimpleScalarPropertiesInput,
 2752   2405   
        ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError,
 2753   2406   
    >;
 2754   2407   
 2755   2408   
    fn poll(
 2756   2409   
        self: std::pin::Pin<&mut Self>,
 2757   2410   
        cx: &mut std::task::Context<'_>,
 2758   2411   
    ) -> std::task::Poll<Self::Output> {
 2759   2412   
        let this = self.project();
 2760   2413   
        this.inner.as_mut().poll(cx)
 2761   2414   
    }
 2762   2415   
}
 2763   2416   
 2764   2417   
impl<B>
 2765   2418   
    ::aws_smithy_http_server::request::FromRequest<
 2766   2419   
        ::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0,
 2767   2420   
        B,
 2768         -
    > for crate::input::GreetingWithErrorsInput
        2421  +
    > for crate::input::SimpleScalarPropertiesInput
 2769   2422   
where
 2770   2423   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
 2771   2424   
    B: 'static,
 2772   2425   
 2773   2426   
    B::Data: Send,
 2774   2427   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection:
 2775   2428   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
 2776   2429   
{
 2777   2430   
    type Rejection = ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError;
 2778         -
    type Future = GreetingWithErrorsInputFuture;
        2431  +
    type Future = SimpleScalarPropertiesInputFuture;
 2779   2432   
 2780   2433   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
 2781   2434   
        let fut = async move {
 2782   2435   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
 2783   2436   
                request.headers(),
 2784         -
                &CONTENT_TYPE_GREETINGWITHERRORS,
        2437  +
                &CONTENT_TYPE_SIMPLESCALARPROPERTIES,
 2785   2438   
            ) {
 2786   2439   
                return Err(::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection::NotAcceptable);
 2787   2440   
            }
 2788         -
            crate::protocol_serde::shape_greeting_with_errors::de_greeting_with_errors_http_request(
 2789         -
                request,
 2790         -
            )
        2441  +
            crate::protocol_serde::shape_simple_scalar_properties::de_simple_scalar_properties_http_request(request)
        2442  +
                            .await
        2443  +
                            .map_err(Into::into)
        2444  +
        };
        2445  +
        use ::futures_util::future::TryFutureExt;
        2446  +
        let fut = fut.map_err(
        2447  +
            |e: ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection| {
        2448  +
                ::tracing::debug!(error = %e, "failed to deserialize request");
        2449  +
                ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e)
        2450  +
            },
        2451  +
        );
        2452  +
        SimpleScalarPropertiesInputFuture {
        2453  +
            inner: Box::pin(fut),
        2454  +
        }
        2455  +
    }
        2456  +
}
        2457  +
impl
        2458  +
    ::aws_smithy_http_server::response::IntoResponse<
        2459  +
        ::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0,
        2460  +
    > for crate::output::SimpleScalarPropertiesOutput
        2461  +
{
        2462  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
        2463  +
        match crate::protocol_serde::shape_simple_scalar_properties::ser_simple_scalar_properties_http_response(self) {
        2464  +
                        Ok(response) => response,
        2465  +
                        Err(e) => {
        2466  +
                            ::tracing::error!(error = %e, "failed to serialize response");
        2467  +
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0>::into_response(::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e))
        2468  +
                        }
        2469  +
                    }
        2470  +
    }
        2471  +
}
        2472  +
        2473  +
#[allow(unreachable_code, unused_variables)]
        2474  +
#[cfg(test)]
        2475  +
mod simple_scalar_properties_test {
        2476  +
        2477  +
    /// Supports handling NaN float values.
        2478  +
    /// Test ID: AwsJson10SupportsNaNFloatInputs
        2479  +
    #[::tokio::test]
        2480  +
    #[::tracing_test::traced_test]
        2481  +
    async fn aws_json10_supports_na_n_float_inputs_request() {
        2482  +
        #[allow(unused_mut)]
        2483  +
        let mut http_request = http::Request::builder()
        2484  +
            .uri("/")
        2485  +
            .method("POST")
        2486  +
            .header("Content-Type", "application/x-amz-json-1.0")
        2487  +
            .header("X-Amz-Target", "JsonRpc10.SimpleScalarProperties")
        2488  +
            .body(::aws_smithy_http_server::body::Body::from(
        2489  +
                ::bytes::Bytes::from_static(
        2490  +
                    "{\n    \"floatValue\": \"NaN\",\n    \"doubleValue\": \"NaN\"\n}".as_bytes(),
        2491  +
                ),
        2492  +
            ))
        2493  +
            .unwrap();
        2494  +
        #[allow(unused_mut)]
        2495  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
        2496  +
        let config = crate::service::JsonRpc10Config::builder().build();
        2497  +
        let service = crate::service::JsonRpc10::builder::<::hyper::body::Body, _, _, _>(config)
        2498  +
                        .simple_scalar_properties(move |input: crate::input::SimpleScalarPropertiesInput| {
        2499  +
                            let sender = sender.clone();
        2500  +
                            async move {
        2501  +
                                let result = { use ::aws_smithy_protocol_test::FloatEquals;
        2502  +
        let expected =
        2503  +
            crate::input::SimpleScalarPropertiesInput {
        2504  +
                float_value:
        2505  +
                    ::std::option::Option::Some(
        2506  +
                        <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("NaN").expect("invalid string for number")
        2507  +
                    )
        2508  +
                ,
        2509  +
                double_value:
        2510  +
                    ::std::option::Option::Some(
        2511  +
                        <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("NaN").expect("invalid string for number")
        2512  +
                    )
        2513  +
                ,
        2514  +
            }
        2515  +
        ;
        2516  +
        assert!(input.float_value.float_equals(&expected.float_value),
        2517  +
                                            "Unexpected value for `float_value` {:?} vs. {:?}", expected.float_value, input.float_value);
        2518  +
        assert!(input.double_value.float_equals(&expected.double_value),
        2519  +
                                            "Unexpected value for `double_value` {:?} vs. {:?}", expected.double_value, input.double_value);
        2520  +
        let response =
        2521  +
            crate::output::SimpleScalarPropertiesOutput {
        2522  +
                float_value:
        2523  +
                    ::std::option::Option::None
        2524  +
                ,
        2525  +
                double_value:
        2526  +
                    ::std::option::Option::None
        2527  +
                ,
        2528  +
            }
        2529  +
        ;
        2530  +
        response };
        2531  +
                                sender.send(()).await.expect("receiver dropped early");
        2532  +
                                result
        2533  +
                            }
        2534  +
                        })
        2535  +
                        .build_unchecked();
        2536  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
        2537  +
            .await
        2538  +
            .expect("unable to make an HTTP request");
        2539  +
        assert!(
        2540  +
            receiver.recv().await.is_some(),
        2541  +
            "we expected operation handler to be invoked but it was not entered"
        2542  +
        );
        2543  +
    }
        2544  +
    /// Supports handling Infinity float values.
        2545  +
    /// Test ID: AwsJson10SupportsInfinityFloatInputs
        2546  +
    #[::tokio::test]
        2547  +
    #[::tracing_test::traced_test]
        2548  +
    async fn aws_json10_supports_infinity_float_inputs_request() {
        2549  +
        #[allow(unused_mut)]
        2550  +
        let mut http_request = http::Request::builder()
        2551  +
            .uri("/")
        2552  +
            .method("POST")
        2553  +
            .header("Content-Type", "application/x-amz-json-1.0")
        2554  +
            .header("X-Amz-Target", "JsonRpc10.SimpleScalarProperties")
        2555  +
            .body(::aws_smithy_http_server::body::Body::from(
        2556  +
                ::bytes::Bytes::from_static(
        2557  +
                    "{\n    \"floatValue\": \"Infinity\",\n    \"doubleValue\": \"Infinity\"\n}"
        2558  +
                        .as_bytes(),
        2559  +
                ),
        2560  +
            ))
        2561  +
            .unwrap();
        2562  +
        #[allow(unused_mut)]
        2563  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
        2564  +
        let config = crate::service::JsonRpc10Config::builder().build();
        2565  +
        let service = crate::service::JsonRpc10::builder::<::hyper::body::Body, _, _, _>(config)
        2566  +
                        .simple_scalar_properties(move |input: crate::input::SimpleScalarPropertiesInput| {
        2567  +
                            let sender = sender.clone();
        2568  +
                            async move {
        2569  +
                                let result = { use ::aws_smithy_protocol_test::FloatEquals;
        2570  +
        let expected =
        2571  +
            crate::input::SimpleScalarPropertiesInput {
        2572  +
                float_value:
        2573  +
                    ::std::option::Option::Some(
        2574  +
                        <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("Infinity").expect("invalid string for number")
        2575  +
                    )
        2576  +
                ,
        2577  +
                double_value:
        2578  +
                    ::std::option::Option::Some(
        2579  +
                        <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("Infinity").expect("invalid string for number")
        2580  +
                    )
        2581  +
                ,
        2582  +
            }
        2583  +
        ;
        2584  +
        assert!(input.float_value.float_equals(&expected.float_value),
        2585  +
                                            "Unexpected value for `float_value` {:?} vs. {:?}", expected.float_value, input.float_value);
        2586  +
        assert!(input.double_value.float_equals(&expected.double_value),
        2587  +
                                            "Unexpected value for `double_value` {:?} vs. {:?}", expected.double_value, input.double_value);
        2588  +
        let response =
        2589  +
            crate::output::SimpleScalarPropertiesOutput {
        2590  +
                float_value:
        2591  +
                    ::std::option::Option::None
        2592  +
                ,
        2593  +
                double_value:
        2594  +
                    ::std::option::Option::None
        2595  +
                ,
        2596  +
            }
        2597  +
        ;
        2598  +
        response };
        2599  +
                                sender.send(()).await.expect("receiver dropped early");
        2600  +
                                result
        2601  +
                            }
        2602  +
                        })
        2603  +
                        .build_unchecked();
        2604  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
        2605  +
            .await
        2606  +
            .expect("unable to make an HTTP request");
        2607  +
        assert!(
        2608  +
            receiver.recv().await.is_some(),
        2609  +
            "we expected operation handler to be invoked but it was not entered"
        2610  +
        );
        2611  +
    }
        2612  +
    /// Supports handling -Infinity float values.
        2613  +
    /// Test ID: AwsJson10SupportsNegativeInfinityFloatInputs
        2614  +
    #[::tokio::test]
        2615  +
    #[::tracing_test::traced_test]
        2616  +
    async fn aws_json10_supports_negative_infinity_float_inputs_request() {
        2617  +
        #[allow(unused_mut)]
        2618  +
        let mut http_request = http::Request::builder()
        2619  +
            .uri("/")
        2620  +
            .method("POST")
        2621  +
            .header("Content-Type", "application/x-amz-json-1.0")
        2622  +
            .header("X-Amz-Target", "JsonRpc10.SimpleScalarProperties")
        2623  +
            .body(::aws_smithy_http_server::body::Body::from(
        2624  +
                ::bytes::Bytes::from_static(
        2625  +
                    "{\n    \"floatValue\": \"-Infinity\",\n    \"doubleValue\": \"-Infinity\"\n}"
        2626  +
                        .as_bytes(),
        2627  +
                ),
        2628  +
            ))
        2629  +
            .unwrap();
        2630  +
        #[allow(unused_mut)]
        2631  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
        2632  +
        let config = crate::service::JsonRpc10Config::builder().build();
        2633  +
        let service = crate::service::JsonRpc10::builder::<::hyper::body::Body, _, _, _>(config)
        2634  +
                        .simple_scalar_properties(move |input: crate::input::SimpleScalarPropertiesInput| {
        2635  +
                            let sender = sender.clone();
        2636  +
                            async move {
        2637  +
                                let result = { use ::aws_smithy_protocol_test::FloatEquals;
        2638  +
        let expected =
        2639  +
            crate::input::SimpleScalarPropertiesInput {
        2640  +
                float_value:
        2641  +
                    ::std::option::Option::Some(
        2642  +
                        <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("-Infinity").expect("invalid string for number")
        2643  +
                    )
        2644  +
                ,
        2645  +
                double_value:
        2646  +
                    ::std::option::Option::Some(
        2647  +
                        <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("-Infinity").expect("invalid string for number")
        2648  +
                    )
        2649  +
                ,
        2650  +
            }
        2651  +
        ;
        2652  +
        assert!(input.float_value.float_equals(&expected.float_value),
        2653  +
                                            "Unexpected value for `float_value` {:?} vs. {:?}", expected.float_value, input.float_value);
        2654  +
        assert!(input.double_value.float_equals(&expected.double_value),
        2655  +
                                            "Unexpected value for `double_value` {:?} vs. {:?}", expected.double_value, input.double_value);
        2656  +
        let response =
        2657  +
            crate::output::SimpleScalarPropertiesOutput {
        2658  +
                float_value:
        2659  +
                    ::std::option::Option::None
        2660  +
                ,
        2661  +
                double_value:
        2662  +
                    ::std::option::Option::None
        2663  +
                ,
        2664  +
            }
        2665  +
        ;
        2666  +
        response };
        2667  +
                                sender.send(()).await.expect("receiver dropped early");
        2668  +
                                result
        2669  +
                            }
        2670  +
                        })
        2671  +
                        .build_unchecked();
        2672  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 2791   2673   
            .await
 2792         -
            .map_err(Into::into)
 2793         -
        };
 2794         -
        use ::futures_util::future::TryFutureExt;
 2795         -
        let fut = fut.map_err(
 2796         -
            |e: ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection| {
 2797         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
 2798         -
                ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e)
 2799         -
            },
        2674  +
            .expect("unable to make an HTTP request");
        2675  +
        assert!(
        2676  +
            receiver.recv().await.is_some(),
        2677  +
            "we expected operation handler to be invoked but it was not entered"
 2800   2678   
        );
 2801         -
        GreetingWithErrorsInputFuture {
 2802         -
            inner: Box::pin(fut),
 2803         -
        }
 2804         -
    }
 2805         -
}
 2806         -
impl
 2807         -
    ::aws_smithy_http_server::response::IntoResponse<
 2808         -
        ::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0,
 2809         -
    > for crate::output::GreetingWithErrorsOutput
 2810         -
{
 2811         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
 2812         -
        match crate::protocol_serde::shape_greeting_with_errors::ser_greeting_with_errors_http_response(self) {
 2813         -
                        Ok(response) => response,
 2814         -
                        Err(e) => {
 2815         -
                            ::tracing::error!(error = %e, "failed to serialize response");
 2816         -
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0>::into_response(::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e))
 2817         -
                        }
 2818         -
                    }
 2819         -
    }
 2820         -
}
 2821         -
impl
 2822         -
    ::aws_smithy_http_server::response::IntoResponse<
 2823         -
        ::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0,
 2824         -
    > for crate::error::GreetingWithErrorsError
 2825         -
{
 2826         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
 2827         -
        match crate::protocol_serde::shape_greeting_with_errors::ser_greeting_with_errors_http_error(
 2828         -
            &self,
 2829         -
        ) {
 2830         -
            Ok(mut response) => {
 2831         -
                response.extensions_mut().insert(
 2832         -
                    ::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()),
 2833         -
                );
 2834         -
                response
 2835         -
            }
 2836         -
            Err(e) => {
 2837         -
                ::tracing::error!(error = %e, "failed to serialize response");
 2838         -
                ::aws_smithy_http_server::response::IntoResponse::<
 2839         -
                    ::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0,
 2840         -
                >::into_response(
 2841         -
                    ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(
 2842         -
                        e,
 2843         -
                    ),
 2844         -
                )
 2845         -
            }
 2846         -
        }
 2847         -
    }
 2848         -
}
 2849         -
 2850         -
static CONTENT_TYPE_SIMPLESCALARPROPERTIES: ::once_cell::sync::Lazy<::mime::Mime> =
 2851         -
    ::once_cell::sync::Lazy::new(|| {
 2852         -
        "application/x-amz-json-1.0"
 2853         -
            .parse::<::mime::Mime>()
 2854         -
            .expect("BUG: MIME parsing failed, content_type is not valid")
 2855         -
    });
 2856         -
::pin_project_lite::pin_project! {
 2857         -
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
 2858         -
    /// [`SimpleScalarPropertiesInput`](crate::input::SimpleScalarPropertiesInput) using modelled bindings.
 2859         -
    pub struct SimpleScalarPropertiesInputFuture {
 2860         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::SimpleScalarPropertiesInput, ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError>> + Send>>
 2861   2679   
    }
 2862         -
}
 2863         -
 2864         -
impl std::future::Future for SimpleScalarPropertiesInputFuture {
 2865         -
    type Output = Result<
 2866         -
        crate::input::SimpleScalarPropertiesInput,
 2867         -
        ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError,
 2868         -
    >;
 2869         -
 2870         -
    fn poll(
 2871         -
        self: std::pin::Pin<&mut Self>,
 2872         -
        cx: &mut std::task::Context<'_>,
 2873         -
    ) -> std::task::Poll<Self::Output> {
 2874         -
        let this = self.project();
 2875         -
        this.inner.as_mut().poll(cx)
        2680  +
    /// Supports handling NaN float values.
        2681  +
    /// Test ID: AwsJson10SupportsNaNFloatInputs
        2682  +
    #[::tokio::test]
        2683  +
    #[::tracing_test::traced_test]
        2684  +
    async fn aws_json10_supports_na_n_float_inputs_response() {
        2685  +
        let output = crate::output::SimpleScalarPropertiesOutput {
        2686  +
            float_value: ::std::option::Option::Some(
        2687  +
                <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("NaN")
        2688  +
                    .expect("invalid string for number"),
        2689  +
            ),
        2690  +
            double_value: ::std::option::Option::Some(
        2691  +
                <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("NaN")
        2692  +
                    .expect("invalid string for number"),
        2693  +
            ),
        2694  +
        };
        2695  +
        use ::aws_smithy_http_server::response::IntoResponse;
        2696  +
        let http_response = output.into_response();
        2697  +
        ::pretty_assertions::assert_eq!(
        2698  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
        2699  +
            http_response.status()
        2700  +
        );
        2701  +
        let expected_headers = [("Content-Type", "application/x-amz-json-1.0")];
        2702  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
        2703  +
            http_response.headers(),
        2704  +
            expected_headers,
        2705  +
        ));
        2706  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
        2707  +
            .await
        2708  +
            .expect("unable to extract body to bytes");
        2709  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
        2710  +
            &body,
        2711  +
            "{\n    \"floatValue\": \"NaN\",\n    \"doubleValue\": \"NaN\"\n}",
        2712  +
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
        2713  +
        ));
 2876   2714   
    }
 2877         -
}
 2878         -
 2879         -
impl<B>
 2880         -
    ::aws_smithy_http_server::request::FromRequest<
 2881         -
        ::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0,
 2882         -
        B,
 2883         -
    > for crate::input::SimpleScalarPropertiesInput
 2884         -
where
 2885         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
 2886         -
    B: 'static,
 2887         -
 2888         -
    B::Data: Send,
 2889         -
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection:
 2890         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
 2891         -
{
 2892         -
    type Rejection = ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError;
 2893         -
    type Future = SimpleScalarPropertiesInputFuture;
 2894         -
 2895         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
 2896         -
        let fut = async move {
 2897         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
 2898         -
                request.headers(),
 2899         -
                &CONTENT_TYPE_SIMPLESCALARPROPERTIES,
 2900         -
            ) {
 2901         -
                return Err(::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection::NotAcceptable);
 2902         -
            }
 2903         -
            crate::protocol_serde::shape_simple_scalar_properties::de_simple_scalar_properties_http_request(request)
 2904         -
                            .await
 2905         -
                            .map_err(Into::into)
        2715  +
    /// Supports handling Infinity float values.
        2716  +
    /// Test ID: AwsJson10SupportsInfinityFloatInputs
        2717  +
    #[::tokio::test]
        2718  +
    #[::tracing_test::traced_test]
        2719  +
    async fn aws_json10_supports_infinity_float_inputs_response() {
        2720  +
        let output = crate::output::SimpleScalarPropertiesOutput {
        2721  +
            float_value: ::std::option::Option::Some(
        2722  +
                <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("Infinity")
        2723  +
                    .expect("invalid string for number"),
        2724  +
            ),
        2725  +
            double_value: ::std::option::Option::Some(
        2726  +
                <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("Infinity")
        2727  +
                    .expect("invalid string for number"),
        2728  +
            ),
 2906   2729   
        };
 2907         -
        use ::futures_util::future::TryFutureExt;
 2908         -
        let fut = fut.map_err(
 2909         -
            |e: ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection| {
 2910         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
 2911         -
                ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e)
 2912         -
            },
        2730  +
        use ::aws_smithy_http_server::response::IntoResponse;
        2731  +
        let http_response = output.into_response();
        2732  +
        ::pretty_assertions::assert_eq!(
        2733  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
        2734  +
            http_response.status()
 2913   2735   
        );
 2914         -
        SimpleScalarPropertiesInputFuture {
 2915         -
            inner: Box::pin(fut),
 2916         -
        }
        2736  +
        let expected_headers = [("Content-Type", "application/x-amz-json-1.0")];
        2737  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
        2738  +
            http_response.headers(),
        2739  +
            expected_headers,
        2740  +
        ));
        2741  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
        2742  +
            .await
        2743  +
            .expect("unable to extract body to bytes");
        2744  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
        2745  +
            &body,
        2746  +
            "{\n    \"floatValue\": \"Infinity\",\n    \"doubleValue\": \"Infinity\"\n}",
        2747  +
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
        2748  +
        ));
 2917   2749   
    }
 2918         -
}
 2919         -
impl
 2920         -
    ::aws_smithy_http_server::response::IntoResponse<
 2921         -
        ::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0,
 2922         -
    > for crate::output::SimpleScalarPropertiesOutput
 2923         -
{
 2924         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
 2925         -
        match crate::protocol_serde::shape_simple_scalar_properties::ser_simple_scalar_properties_http_response(self) {
 2926         -
                        Ok(response) => response,
 2927         -
                        Err(e) => {
 2928         -
                            ::tracing::error!(error = %e, "failed to serialize response");
 2929         -
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0>::into_response(::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e))
 2930         -
                        }
 2931         -
                    }
        2750  +
    /// Supports handling -Infinity float values.
        2751  +
    /// Test ID: AwsJson10SupportsNegativeInfinityFloatInputs
        2752  +
    #[::tokio::test]
        2753  +
    #[::tracing_test::traced_test]
        2754  +
    async fn aws_json10_supports_negative_infinity_float_inputs_response() {
        2755  +
        let output = crate::output::SimpleScalarPropertiesOutput {
        2756  +
            float_value: ::std::option::Option::Some(
        2757  +
                <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("-Infinity")
        2758  +
                    .expect("invalid string for number"),
        2759  +
            ),
        2760  +
            double_value: ::std::option::Option::Some(
        2761  +
                <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("-Infinity")
        2762  +
                    .expect("invalid string for number"),
        2763  +
            ),
        2764  +
        };
        2765  +
        use ::aws_smithy_http_server::response::IntoResponse;
        2766  +
        let http_response = output.into_response();
        2767  +
        ::pretty_assertions::assert_eq!(
        2768  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
        2769  +
            http_response.status()
        2770  +
        );
        2771  +
        let expected_headers = [("Content-Type", "application/x-amz-json-1.0")];
        2772  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
        2773  +
            http_response.headers(),
        2774  +
            expected_headers,
        2775  +
        ));
        2776  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
        2777  +
            .await
        2778  +
            .expect("unable to extract body to bytes");
        2779  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
        2780  +
            &body,
        2781  +
            "{\n    \"floatValue\": \"-Infinity\",\n    \"doubleValue\": \"-Infinity\"\n}",
        2782  +
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
        2783  +
        ));
 2932   2784   
    }
 2933   2785   
}
 2934   2786   
 2935   2787   
static CONTENT_TYPE_EMPTYINPUTANDEMPTYOUTPUT: ::once_cell::sync::Lazy<::mime::Mime> =
 2936   2788   
    ::once_cell::sync::Lazy::new(|| {
 2937   2789   
        "application/x-amz-json-1.0"
 2938   2790   
            .parse::<::mime::Mime>()
 2939   2791   
            .expect("BUG: MIME parsing failed, content_type is not valid")
 2940   2792   
    });
 2941   2793   
::pin_project_lite::pin_project! {
@@ -2990,2842 +3049,2976 @@
 3010   2862   
        match crate::protocol_serde::shape_empty_input_and_empty_output::ser_empty_input_and_empty_output_http_response(self) {
 3011   2863   
                        Ok(response) => response,
 3012   2864   
                        Err(e) => {
 3013   2865   
                            ::tracing::error!(error = %e, "failed to serialize response");
 3014   2866   
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0>::into_response(::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e))
 3015   2867   
                        }
 3016   2868   
                    }
 3017   2869   
    }
 3018   2870   
}
 3019   2871   
        2872  +
#[allow(unreachable_code, unused_variables)]
        2873  +
#[cfg(test)]
        2874  +
mod empty_input_and_empty_output_test {
        2875  +
        2876  +
    /// Clients must always send an empty object if input is modeled.
        2877  +
    /// Test ID: AwsJson10EmptyInputAndEmptyOutput
        2878  +
    #[::tokio::test]
        2879  +
    #[::tracing_test::traced_test]
        2880  +
    async fn aws_json10_empty_input_and_empty_output_request() {
        2881  +
        #[allow(unused_mut)]
        2882  +
        let mut http_request = http::Request::builder()
        2883  +
            .uri("/")
        2884  +
            .method("POST")
        2885  +
            .header("Content-Type", "application/x-amz-json-1.0")
        2886  +
            .header("X-Amz-Target", "JsonRpc10.EmptyInputAndEmptyOutput")
        2887  +
            .body(::aws_smithy_http_server::body::Body::from(
        2888  +
                ::bytes::Bytes::from_static("{}".as_bytes()),
        2889  +
            ))
        2890  +
            .unwrap();
        2891  +
        #[allow(unused_mut)]
        2892  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
        2893  +
        let config = crate::service::JsonRpc10Config::builder().build();
        2894  +
        let service = crate::service::JsonRpc10::builder::<::hyper::body::Body, _, _, _>(config)
        2895  +
            .empty_input_and_empty_output(
        2896  +
                move |input: crate::input::EmptyInputAndEmptyOutputInput| {
        2897  +
                    let sender = sender.clone();
        2898  +
                    async move {
        2899  +
                        let result = {
        2900  +
                            let expected = crate::input::EmptyInputAndEmptyOutputInput {};
        2901  +
                            ::pretty_assertions::assert_eq!(input, expected);
        2902  +
                            let response = crate::output::EmptyInputAndEmptyOutputOutput {};
        2903  +
                            response
        2904  +
                        };
        2905  +
                        sender.send(()).await.expect("receiver dropped early");
        2906  +
                        result
        2907  +
                    }
        2908  +
                },
        2909  +
            )
        2910  +
            .build_unchecked();
        2911  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
        2912  +
            .await
        2913  +
            .expect("unable to make an HTTP request");
        2914  +
        assert!(
        2915  +
            receiver.recv().await.is_some(),
        2916  +
            "we expected operation handler to be invoked but it was not entered"
        2917  +
        );
        2918  +
    }
        2919  +
    /// A service will always return a JSON object for operations with modeled output.
        2920  +
    /// Test ID: AwsJson10EmptyInputAndEmptyOutputSendJsonObject
        2921  +
    #[::tokio::test]
        2922  +
    #[::tracing_test::traced_test]
        2923  +
    async fn aws_json10_empty_input_and_empty_output_send_json_object_response() {
        2924  +
        let output = crate::output::EmptyInputAndEmptyOutputOutput {};
        2925  +
        use ::aws_smithy_http_server::response::IntoResponse;
        2926  +
        let http_response = output.into_response();
        2927  +
        ::pretty_assertions::assert_eq!(
        2928  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
        2929  +
            http_response.status()
        2930  +
        );
        2931  +
        let expected_headers = [("Content-Type", "application/x-amz-json-1.0")];
        2932  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
        2933  +
            http_response.headers(),
        2934  +
            expected_headers,
        2935  +
        ));
        2936  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
        2937  +
            .await
        2938  +
            .expect("unable to extract body to bytes");
        2939  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
        2940  +
            &body,
        2941  +
            "{}",
        2942  +
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
        2943  +
        ));
        2944  +
    }
        2945  +
}
        2946  +
 3020   2947   
static CONTENT_TYPE_NOINPUTANDOUTPUT: ::once_cell::sync::Lazy<::mime::Mime> =
 3021   2948   
    ::once_cell::sync::Lazy::new(|| {
 3022   2949   
        "application/x-amz-json-1.0"
 3023   2950   
            .parse::<::mime::Mime>()
 3024   2951   
            .expect("BUG: MIME parsing failed, content_type is not valid")
 3025   2952   
    });
 3026   2953   
::pin_project_lite::pin_project! {
 3027   2954   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
 3028   2955   
    /// [`NoInputAndOutputInput`](crate::input::NoInputAndOutputInput) using modelled bindings.
 3029   2956   
    pub struct NoInputAndOutputInputFuture {
@@ -3077,3004 +3136,3136 @@
 3097   3024   
        match crate::protocol_serde::shape_no_input_and_output::ser_no_input_and_output_http_response(self) {
 3098   3025   
                        Ok(response) => response,
 3099   3026   
                        Err(e) => {
 3100   3027   
                            ::tracing::error!(error = %e, "failed to serialize response");
 3101   3028   
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0>::into_response(::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e))
 3102   3029   
                        }
 3103   3030   
                    }
 3104   3031   
    }
 3105   3032   
}
 3106   3033   
        3034  +
#[allow(unreachable_code, unused_variables)]
        3035  +
#[cfg(test)]
        3036  +
mod no_input_and_output_test {
        3037  +
        3038  +
    /// A client should always send and empty JSON object payload.
        3039  +
    /// Test ID: AwsJson10NoInputAndOutput
        3040  +
    #[::tokio::test]
        3041  +
    #[::tracing_test::traced_test]
        3042  +
    async fn aws_json10_no_input_and_output_request() {
        3043  +
        #[allow(unused_mut)]
        3044  +
        let mut http_request = http::Request::builder()
        3045  +
            .uri("/")
        3046  +
            .method("POST")
        3047  +
            .header("Content-Type", "application/x-amz-json-1.0")
        3048  +
            .header("X-Amz-Target", "JsonRpc10.NoInputAndOutput")
        3049  +
            .body(::aws_smithy_http_server::body::Body::from(
        3050  +
                ::bytes::Bytes::from_static("{}".as_bytes()),
        3051  +
            ))
        3052  +
            .unwrap();
        3053  +
        #[allow(unused_mut)]
        3054  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
        3055  +
        let config = crate::service::JsonRpc10Config::builder().build();
        3056  +
        let service = crate::service::JsonRpc10::builder::<::hyper::body::Body, _, _, _>(config)
        3057  +
            .no_input_and_output(move |input: crate::input::NoInputAndOutputInput| {
        3058  +
                let sender = sender.clone();
        3059  +
                async move {
        3060  +
                    let result = {
        3061  +
                        let expected = crate::input::NoInputAndOutputInput {};
        3062  +
                        ::pretty_assertions::assert_eq!(input, expected);
        3063  +
                        let response = crate::output::NoInputAndOutputOutput {};
        3064  +
                        response
        3065  +
                    };
        3066  +
                    sender.send(()).await.expect("receiver dropped early");
        3067  +
                    result
        3068  +
                }
        3069  +
            })
        3070  +
            .build_unchecked();
        3071  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
        3072  +
            .await
        3073  +
            .expect("unable to make an HTTP request");
        3074  +
        assert!(
        3075  +
            receiver.recv().await.is_some(),
        3076  +
            "we expected operation handler to be invoked but it was not entered"
        3077  +
        );
        3078  +
    }
        3079  +
    /// Empty output always serializes an empty object payload.
        3080  +
    /// Test ID: AwsJson10NoInputAndOutput
        3081  +
    #[::tokio::test]
        3082  +
    #[::tracing_test::traced_test]
        3083  +
    async fn aws_json10_no_input_and_output_response() {
        3084  +
        let output = crate::output::NoInputAndOutputOutput {};
        3085  +
        use ::aws_smithy_http_server::response::IntoResponse;
        3086  +
        let http_response = output.into_response();
        3087  +
        ::pretty_assertions::assert_eq!(
        3088  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
        3089  +
            http_response.status()
        3090  +
        );
        3091  +
        let expected_headers = [("Content-Type", "application/x-amz-json-1.0")];
        3092  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
        3093  +
            http_response.headers(),
        3094  +
            expected_headers,
        3095  +
        ));
        3096  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
        3097  +
            .await
        3098  +
            .expect("unable to extract body to bytes");
        3099  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
        3100  +
            &body,
        3101  +
            "{}",
        3102  +
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
        3103  +
        ));
        3104  +
    }
        3105  +
}
        3106  +
 3107   3107   
static CONTENT_TYPE_NOINPUTANDNOOUTPUT: ::once_cell::sync::Lazy<::mime::Mime> =
 3108   3108   
    ::once_cell::sync::Lazy::new(|| {
 3109   3109   
        "application/x-amz-json-1.0"
 3110   3110   
            .parse::<::mime::Mime>()
 3111   3111   
            .expect("BUG: MIME parsing failed, content_type is not valid")
 3112   3112   
    });
 3113   3113   
::pin_project_lite::pin_project! {
 3114   3114   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
 3115   3115   
    /// [`NoInputAndNoOutputInput`](crate::input::NoInputAndNoOutputInput) using modelled bindings.
 3116   3116   
    pub struct NoInputAndNoOutputInputFuture {
@@ -3161,3161 +0,3314 @@
 3181   3181   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
 3182   3182   
        match crate::protocol_serde::shape_no_input_and_no_output::ser_no_input_and_no_output_http_response(self) {
 3183   3183   
                        Ok(response) => response,
 3184   3184   
                        Err(e) => {
 3185   3185   
                            ::tracing::error!(error = %e, "failed to serialize response");
 3186   3186   
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0>::into_response(::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e))
 3187   3187   
                        }
 3188   3188   
                    }
 3189   3189   
    }
 3190   3190   
}
        3191  +
        3192  +
#[allow(unreachable_code, unused_variables)]
        3193  +
#[cfg(test)]
        3194  +
mod no_input_and_no_output_test {
        3195  +
        3196  +
    /// Clients must always send an empty JSON object payload for
        3197  +
    /// operations with no input (that is, `{}`). While AWS service
        3198  +
    /// implementations support requests with no payload or requests
        3199  +
    /// that send `{}`, always sending `{}` from the client is
        3200  +
    /// preferred for forward compatibility in case input is ever
        3201  +
    /// added to an operation.
        3202  +
    /// Test ID: AwsJson10MustAlwaysSendEmptyJsonPayload
        3203  +
    #[::tokio::test]
        3204  +
    #[::tracing_test::traced_test]
        3205  +
    async fn aws_json10_must_always_send_empty_json_payload_request() {
        3206  +
        #[allow(unused_mut)]
        3207  +
        let mut http_request = http::Request::builder()
        3208  +
            .uri("/")
        3209  +
            .method("POST")
        3210  +
            .header("Content-Type", "application/x-amz-json-1.0")
        3211  +
            .header("X-Amz-Target", "JsonRpc10.NoInputAndNoOutput")
        3212  +
            .body(::aws_smithy_http_server::body::Body::from(
        3213  +
                ::bytes::Bytes::from_static("{}".as_bytes()),
        3214  +
            ))
        3215  +
            .unwrap();
        3216  +
        #[allow(unused_mut)]
        3217  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
        3218  +
        let config = crate::service::JsonRpc10Config::builder().build();
        3219  +
        let service = crate::service::JsonRpc10::builder::<::hyper::body::Body, _, _, _>(config)
        3220  +
            .no_input_and_no_output(move |input: crate::input::NoInputAndNoOutputInput| {
        3221  +
                let sender = sender.clone();
        3222  +
                async move {
        3223  +
                    let result = {
        3224  +
                        let expected = crate::input::NoInputAndNoOutputInput {};
        3225  +
                        ::pretty_assertions::assert_eq!(input, expected);
        3226  +
                        let response = crate::output::NoInputAndNoOutputOutput {};
        3227  +
                        response
        3228  +
                    };
        3229  +
                    sender.send(()).await.expect("receiver dropped early");
        3230  +
                    result
        3231  +
                }
        3232  +
            })
        3233  +
            .build_unchecked();
        3234  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
        3235  +
            .await
        3236  +
            .expect("unable to make an HTTP request");
        3237  +
        assert!(
        3238  +
            receiver.recv().await.is_some(),
        3239  +
            "we expected operation handler to be invoked but it was not entered"
        3240  +
        );
        3241  +
    }
        3242  +
    /// Service implementations must support no payload or an empty
        3243  +
    /// object payload for operations that define no input. However,
        3244  +
    /// despite the lack of a payload, a Content-Type header is still
        3245  +
    /// required in order for the service to properly detect the
        3246  +
    /// protocol.
        3247  +
    /// Test ID: AwsJson10ServiceSupportsNoPayloadForNoInput
        3248  +
    #[::tokio::test]
        3249  +
    #[::tracing_test::traced_test]
        3250  +
    async fn aws_json10_service_supports_no_payload_for_no_input_request() {
        3251  +
        #[allow(unused_mut)]
        3252  +
        let mut http_request = http::Request::builder()
        3253  +
            .uri("/")
        3254  +
            .method("POST")
        3255  +
            .header("Content-Type", "application/x-amz-json-1.0")
        3256  +
            .header("X-Amz-Target", "JsonRpc10.NoInputAndNoOutput")
        3257  +
            .body(::aws_smithy_http_server::body::Body::from(
        3258  +
                ::bytes::Bytes::from_static("".as_bytes()),
        3259  +
            ))
        3260  +
            .unwrap();
        3261  +
        #[allow(unused_mut)]
        3262  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
        3263  +
        let config = crate::service::JsonRpc10Config::builder().build();
        3264  +
        let service = crate::service::JsonRpc10::builder::<::hyper::body::Body, _, _, _>(config)
        3265  +
            .no_input_and_no_output(move |input: crate::input::NoInputAndNoOutputInput| {
        3266  +
                let sender = sender.clone();
        3267  +
                async move {
        3268  +
                    let result = {
        3269  +
                        let expected = crate::input::NoInputAndNoOutputInput {};
        3270  +
                        ::pretty_assertions::assert_eq!(input, expected);
        3271  +
                        let response = crate::output::NoInputAndNoOutputOutput {};
        3272  +
                        response
        3273  +
                    };
        3274  +
                    sender.send(()).await.expect("receiver dropped early");
        3275  +
                    result
        3276  +
                }
        3277  +
            })
        3278  +
            .build_unchecked();
        3279  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
        3280  +
            .await
        3281  +
            .expect("unable to make an HTTP request");
        3282  +
        assert!(
        3283  +
            receiver.recv().await.is_some(),
        3284  +
            "we expected operation handler to be invoked but it was not entered"
        3285  +
        );
        3286  +
    }
        3287  +
    /// When no output is defined, the service is expected to return
        3288  +
    /// an empty payload. Despite the lack of a payload, the service
        3289  +
    /// is expected to always send a Content-Type header. Clients must
        3290  +
    /// handle cases where a service returns a JSON object and where
        3291  +
    /// a service returns no JSON at all.
        3292  +
    /// Test ID: AwsJson10ServiceRespondsWithNoPayload
        3293  +
    #[::tokio::test]
        3294  +
    #[::tracing_test::traced_test]
        3295  +
    async fn aws_json10_service_responds_with_no_payload_response() {
        3296  +
        let output = crate::output::NoInputAndNoOutputOutput {};
        3297  +
        use ::aws_smithy_http_server::response::IntoResponse;
        3298  +
        let http_response = output.into_response();
        3299  +
        ::pretty_assertions::assert_eq!(
        3300  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
        3301  +
            http_response.status()
        3302  +
        );
        3303  +
        let expected_headers = [("Content-Type", "application/x-amz-json-1.0")];
        3304  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
        3305  +
            http_response.headers(),
        3306  +
            expected_headers,
        3307  +
        ));
        3308  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
        3309  +
            .await
        3310  +
            .expect("unable to extract body to bytes");
        3311  +
        // No body.
        3312  +
        ::pretty_assertions::assert_eq!(std::str::from_utf8(&body).unwrap(), "");
        3313  +
    }
        3314  +
}