Client Test

Client Test

rev. 26e0a1e8aaec58e3c7fd18a79449d71bcadaf391

Files changed:

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

@@ -245,245 +305,307 @@
  265    265   
mod http_request_with_greedy_label_in_path_test {
  266    266   
  267    267   
    /// Serializes greedy labels and normal labels
  268    268   
    /// Test ID: RestJsonHttpRequestWithGreedyLabelInPath
  269    269   
    #[::tokio::test]
  270    270   
    #[::tracing_test::traced_test]
  271    271   
    async fn rest_json_http_request_with_greedy_label_in_path_request() {
  272    272   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  273    273   
        let config_builder = crate::config::Config::builder()
  274    274   
            .with_test_defaults()
  275         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         275  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         276  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         277  +
            .allow_no_auth()
  276    278   
            .endpoint_url("https://example.com");
  277    279   
  278    280   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  279    281   
        let result = client
  280    282   
            .http_request_with_greedy_label_in_path()
  281    283   
            .set_foo(::std::option::Option::Some("hello/escape".to_owned()))
  282    284   
            .set_baz(::std::option::Option::Some("there/guy".to_owned()))
  283    285   
            .send()
  284    286   
            .await;
  285    287   
        let _ = dbg!(result);

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

@@ -324,324 +424,428 @@
  344    344   
mod http_request_with_labels_test {
  345    345   
  346    346   
    /// Sends a GET request that uses URI label bindings
  347    347   
    /// Test ID: RestJsonInputWithHeadersAndAllParams
  348    348   
    #[::tokio::test]
  349    349   
    #[::tracing_test::traced_test]
  350    350   
    async fn rest_json_input_with_headers_and_all_params_request() {
  351    351   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  352    352   
        let config_builder = crate::config::Config::builder()
  353    353   
            .with_test_defaults()
  354         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         354  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         355  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         356  +
            .allow_no_auth()
  355    357   
            .endpoint_url("https://example.com");
  356    358   
  357    359   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  358    360   
        let result = client
  359    361   
            .http_request_with_labels()
  360    362   
            .set_string(::std::option::Option::Some("string".to_owned()))
  361    363   
            .set_short(::std::option::Option::Some(1))
  362    364   
            .set_integer(::std::option::Option::Some(2))
  363    365   
            .set_long(::std::option::Option::Some(3))
  364    366   
            .set_float(::std::option::Option::Some(4.1_f32))
  365    367   
            .set_double(::std::option::Option::Some(5.1_f64))
  366    368   
            .set_boolean(::std::option::Option::Some(true))
  367    369   
            .set_timestamp(::std::option::Option::Some(::aws_smithy_types::DateTime::from_fractional_secs(
  368    370   
                1576540098, 0_f64,
  369    371   
            )))
  370    372   
            .send()
  371    373   
            .await;
  372    374   
        let _ = dbg!(result);
  373    375   
        let http_request = request_receiver.expect_request();
  374    376   
        let body = http_request.body().bytes().expect("body should be strict");
  375    377   
        // No body.
  376    378   
        ::pretty_assertions::assert_eq!(&body, &::bytes::Bytes::new());
  377    379   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  378    380   
        ::pretty_assertions::assert_eq!(http_request.method(), "GET", "method was incorrect");
  379    381   
        ::pretty_assertions::assert_eq!(
  380    382   
            uri.path(),
  381    383   
            "/HttpRequestWithLabels/string/1/2/3/4.1/5.1/true/2019-12-16T23%3A48%3A18Z",
  382    384   
            "path was incorrect"
  383    385   
        );
  384    386   
    }
  385    387   
  386    388   
    /// Sends a GET request that uses URI label bindings
  387    389   
    /// Test ID: RestJsonHttpRequestLabelEscaping
  388    390   
    #[::tokio::test]
  389    391   
    #[::tracing_test::traced_test]
  390    392   
    async fn rest_json_http_request_label_escaping_request() {
  391    393   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  392    394   
        let config_builder = crate::config::Config::builder()
  393    395   
            .with_test_defaults()
  394         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         396  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         397  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         398  +
            .allow_no_auth()
  395    399   
            .endpoint_url("https://example.com");
  396    400   
  397    401   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  398    402   
        let result = client
  399    403   
            .http_request_with_labels()
  400    404   
            .set_string(::std::option::Option::Some(" %:/?#[]@!$&'()*+,;=😹".to_owned()))
  401    405   
            .set_short(::std::option::Option::Some(1))
  402    406   
            .set_integer(::std::option::Option::Some(2))
  403    407   
            .set_long(::std::option::Option::Some(3))
  404    408   
            .set_float(::std::option::Option::Some(4.1_f32))

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

@@ -299,299 +359,361 @@
  319    319   
mod http_request_with_labels_and_timestamp_format_test {
  320    320   
  321    321   
    /// Serializes different timestamp formats in URI labels
  322    322   
    /// Test ID: RestJsonHttpRequestWithLabelsAndTimestampFormat
  323    323   
    #[::tokio::test]
  324    324   
    #[::tracing_test::traced_test]
  325    325   
    async fn rest_json_http_request_with_labels_and_timestamp_format_request() {
  326    326   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  327    327   
        let config_builder = crate::config::Config::builder()
  328    328   
            .with_test_defaults()
  329         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         329  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         330  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         331  +
            .allow_no_auth()
  330    332   
            .endpoint_url("https://example.com");
  331    333   
  332    334   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  333    335   
        let result = client
  334    336   
            .http_request_with_labels_and_timestamp_format()
  335    337   
            .set_member_epoch_seconds(::std::option::Option::Some(::aws_smithy_types::DateTime::from_fractional_secs(
  336    338   
                1576540098, 0_f64,
  337    339   
            )))
  338    340   
            .set_member_http_date(::std::option::Option::Some(::aws_smithy_types::DateTime::from_fractional_secs(
  339    341   
                1576540098, 0_f64,

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

@@ -229,229 +289,291 @@
  249    249   
mod http_request_with_regex_literal_test {
  250    250   
  251    251   
    /// Path matching is not broken by regex expressions in literal segments
  252    252   
    /// Test ID: RestJsonToleratesRegexCharsInSegments
  253    253   
    #[::tokio::test]
  254    254   
    #[::tracing_test::traced_test]
  255    255   
    async fn rest_json_tolerates_regex_chars_in_segments_request() {
  256    256   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  257    257   
        let config_builder = crate::config::Config::builder()
  258    258   
            .with_test_defaults()
  259         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         259  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         260  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         261  +
            .allow_no_auth()
  260    262   
            .endpoint_url("https://example.com");
  261    263   
  262    264   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  263    265   
        let result = client
  264    266   
            .http_request_with_regex_literal()
  265    267   
            .set_str(::std::option::Option::Some("abc".to_owned()))
  266    268   
            .send()
  267    269   
            .await;
  268    270   
        let _ = dbg!(result);
  269    271   
        let http_request = request_receiver.expect_request();

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

@@ -223,223 +283,285 @@
  243    243   
#[cfg(test)]
  244    244   
mod http_string_payload_test {
  245    245   
  246    246   
    /// Test ID: RestJsonStringPayloadRequest
  247    247   
    #[::tokio::test]
  248    248   
    #[::tracing_test::traced_test]
  249    249   
    async fn rest_json_string_payload_request_request() {
  250    250   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  251    251   
        let config_builder = crate::config::Config::builder()
  252    252   
            .with_test_defaults()
  253         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         253  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         254  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         255  +
            .allow_no_auth()
  254    256   
            .endpoint_url("https://example.com");
  255    257   
  256    258   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  257    259   
        let result = client
  258    260   
            .http_string_payload()
  259    261   
            .set_payload(::std::option::Option::Some("rawstring".to_owned()))
  260    262   
            .send()
  261    263   
            .await;
  262    264   
        let _ = dbg!(result);
  263    265   
        let http_request = request_receiver.expect_request();

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

@@ -220,220 +580,600 @@
  240    240   
    use ::aws_smithy_protocol_test::FloatEquals;
  241    241   
  242    242   
    /// Tests requests with string header bindings
  243    243   
    /// Test ID: RestJsonInputAndOutputWithStringHeaders
  244    244   
    #[::tokio::test]
  245    245   
    #[::tracing_test::traced_test]
  246    246   
    async fn rest_json_input_and_output_with_string_headers_request() {
  247    247   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  248    248   
        let config_builder = crate::config::Config::builder()
  249    249   
            .with_test_defaults()
  250         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         250  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         251  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         252  +
            .allow_no_auth()
  251    253   
            .endpoint_url("https://example.com");
  252    254   
  253    255   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  254    256   
        let result = client
  255    257   
            .input_and_output_with_headers()
  256    258   
            .set_header_string(::std::option::Option::Some("Hello".to_owned()))
  257    259   
            .set_header_string_list(::std::option::Option::Some(vec!["a".to_owned(), "b".to_owned(), "c".to_owned()]))
  258    260   
            .set_header_string_set(::std::option::Option::Some(vec!["a".to_owned(), "b".to_owned(), "c".to_owned()]))
  259    261   
            .send()
  260    262   
            .await;
  261    263   
        let _ = dbg!(result);
  262    264   
        let http_request = request_receiver.expect_request();
  263    265   
        let expected_headers = [("X-String", "Hello"), ("X-StringList", "a, b, c"), ("X-StringSet", "a, b, c")];
  264    266   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
  265    267   
        let body = http_request.body().bytes().expect("body should be strict");
  266    268   
        // No body.
  267    269   
        ::pretty_assertions::assert_eq!(&body, &::bytes::Bytes::new());
  268    270   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  269    271   
        ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
  270    272   
        ::pretty_assertions::assert_eq!(uri.path(), "/InputAndOutputWithHeaders", "path was incorrect");
  271    273   
    }
  272    274   
  273    275   
    /// Tests requests with string list header bindings that require quoting
  274    276   
    /// Test ID: RestJsonInputAndOutputWithQuotedStringHeaders
  275    277   
    #[::tokio::test]
  276    278   
    #[::tracing_test::traced_test]
  277    279   
    async fn rest_json_input_and_output_with_quoted_string_headers_request() {
  278    280   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  279    281   
        let config_builder = crate::config::Config::builder()
  280    282   
            .with_test_defaults()
  281         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         283  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         284  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         285  +
            .allow_no_auth()
  282    286   
            .endpoint_url("https://example.com");
  283    287   
  284    288   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  285    289   
        let result = client
  286    290   
            .input_and_output_with_headers()
  287    291   
            .set_header_string_list(::std::option::Option::Some(vec!["b,c".to_owned(), "\"def\"".to_owned(), "a".to_owned()]))
  288    292   
            .send()
  289    293   
            .await;
  290    294   
        let _ = dbg!(result);
  291    295   
        let http_request = request_receiver.expect_request();
  292    296   
        let expected_headers = [("X-StringList", "\"b,c\", \"\\\"def\\\"\", a")];
  293    297   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
  294    298   
        let body = http_request.body().bytes().expect("body should be strict");
  295    299   
        // No body.
  296    300   
        ::pretty_assertions::assert_eq!(&body, &::bytes::Bytes::new());
  297    301   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  298    302   
        ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
  299    303   
        ::pretty_assertions::assert_eq!(uri.path(), "/InputAndOutputWithHeaders", "path was incorrect");
  300    304   
    }
  301    305   
  302    306   
    /// Tests requests with numeric header bindings
  303    307   
    /// Test ID: RestJsonInputAndOutputWithNumericHeaders
  304    308   
    #[::tokio::test]
  305    309   
    #[::tracing_test::traced_test]
  306    310   
    async fn rest_json_input_and_output_with_numeric_headers_request() {
  307    311   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  308    312   
        let config_builder = crate::config::Config::builder()
  309    313   
            .with_test_defaults()
  310         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         314  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         315  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         316  +
            .allow_no_auth()
  311    317   
            .endpoint_url("https://example.com");
  312    318   
  313    319   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  314    320   
        let result = client
  315    321   
            .input_and_output_with_headers()
  316    322   
            .set_header_byte(::std::option::Option::Some(1))
  317    323   
            .set_header_short(::std::option::Option::Some(123))
  318    324   
            .set_header_integer(::std::option::Option::Some(123))
  319    325   
            .set_header_long(::std::option::Option::Some(123))
  320    326   
            .set_header_float(::std::option::Option::Some(1.1_f32))
  321    327   
            .set_header_double(::std::option::Option::Some(1.1_f64))
  322    328   
            .set_header_integer_list(::std::option::Option::Some(vec![1, 2, 3]))
  323    329   
            .send()
  324    330   
            .await;
  325    331   
        let _ = dbg!(result);
  326    332   
        let http_request = request_receiver.expect_request();
  327    333   
        let expected_headers = [
  328    334   
            ("X-Byte", "1"),
  329    335   
            ("X-Double", "1.1"),
  330    336   
            ("X-Float", "1.1"),
  331    337   
            ("X-Integer", "123"),
  332    338   
            ("X-IntegerList", "1, 2, 3"),
  333    339   
            ("X-Long", "123"),
  334    340   
            ("X-Short", "123"),
  335    341   
        ];
  336    342   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
  337    343   
        let body = http_request.body().bytes().expect("body should be strict");
  338    344   
        // No body.
  339    345   
        ::pretty_assertions::assert_eq!(&body, &::bytes::Bytes::new());
  340    346   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  341    347   
        ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
  342    348   
        ::pretty_assertions::assert_eq!(uri.path(), "/InputAndOutputWithHeaders", "path was incorrect");
  343    349   
    }
  344    350   
  345    351   
    /// Tests requests with boolean header bindings
  346    352   
    /// Test ID: RestJsonInputAndOutputWithBooleanHeaders
  347    353   
    #[::tokio::test]
  348    354   
    #[::tracing_test::traced_test]
  349    355   
    async fn rest_json_input_and_output_with_boolean_headers_request() {
  350    356   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  351    357   
        let config_builder = crate::config::Config::builder()
  352    358   
            .with_test_defaults()
  353         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         359  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         360  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         361  +
            .allow_no_auth()
  354    362   
            .endpoint_url("https://example.com");
  355    363   
  356    364   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  357    365   
        let result = client
  358    366   
            .input_and_output_with_headers()
  359    367   
            .set_header_true_bool(::std::option::Option::Some(true))
  360    368   
            .set_header_false_bool(::std::option::Option::Some(false))
  361    369   
            .set_header_boolean_list(::std::option::Option::Some(vec![true, false, true]))
  362    370   
            .send()
  363    371   
            .await;
  364    372   
        let _ = dbg!(result);
  365    373   
        let http_request = request_receiver.expect_request();
  366    374   
        let expected_headers = [("X-Boolean1", "true"), ("X-Boolean2", "false"), ("X-BooleanList", "true, false, true")];
  367    375   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
  368    376   
        let body = http_request.body().bytes().expect("body should be strict");
  369    377   
        // No body.
  370    378   
        ::pretty_assertions::assert_eq!(&body, &::bytes::Bytes::new());
  371    379   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  372    380   
        ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
  373    381   
        ::pretty_assertions::assert_eq!(uri.path(), "/InputAndOutputWithHeaders", "path was incorrect");
  374    382   
    }
  375    383   
  376    384   
    /// Tests requests with timestamp header bindings
  377    385   
    /// Test ID: RestJsonInputAndOutputWithTimestampHeaders
  378    386   
    #[::tokio::test]
  379    387   
    #[::tracing_test::traced_test]
  380    388   
    async fn rest_json_input_and_output_with_timestamp_headers_request() {
  381    389   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  382    390   
        let config_builder = crate::config::Config::builder()
  383    391   
            .with_test_defaults()
  384         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         392  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         393  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         394  +
            .allow_no_auth()
  385    395   
            .endpoint_url("https://example.com");
  386    396   
  387    397   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  388    398   
        let result = client
  389    399   
            .input_and_output_with_headers()
  390    400   
            .set_header_timestamp_list(::std::option::Option::Some(vec![
  391    401   
                ::aws_smithy_types::DateTime::from_fractional_secs(1576540098, 0_f64),
  392    402   
                ::aws_smithy_types::DateTime::from_fractional_secs(1576540098, 0_f64),
  393    403   
            ]))
  394    404   
            .send()
  395    405   
            .await;
  396    406   
        let _ = dbg!(result);
  397    407   
        let http_request = request_receiver.expect_request();
  398    408   
        let expected_headers = [("X-TimestampList", "Mon, 16 Dec 2019 23:48:18 GMT, Mon, 16 Dec 2019 23:48:18 GMT")];
  399    409   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
  400    410   
        let body = http_request.body().bytes().expect("body should be strict");
  401    411   
        // No body.
  402    412   
        ::pretty_assertions::assert_eq!(&body, &::bytes::Bytes::new());
  403    413   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  404    414   
        ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
  405    415   
        ::pretty_assertions::assert_eq!(uri.path(), "/InputAndOutputWithHeaders", "path was incorrect");
  406    416   
    }
  407    417   
  408    418   
    /// Tests requests with enum header bindings
  409    419   
    /// Test ID: RestJsonInputAndOutputWithEnumHeaders
  410    420   
    #[::tokio::test]
  411    421   
    #[::tracing_test::traced_test]
  412    422   
    async fn rest_json_input_and_output_with_enum_headers_request() {
  413    423   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  414    424   
        let config_builder = crate::config::Config::builder()
  415    425   
            .with_test_defaults()
  416         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         426  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         427  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         428  +
            .allow_no_auth()
  417    429   
            .endpoint_url("https://example.com");
  418    430   
  419    431   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  420    432   
        let result = client
  421    433   
            .input_and_output_with_headers()
  422    434   
            .set_header_enum(::std::option::Option::Some(
  423    435   
                "Foo".parse::<crate::types::FooEnum>().expect("static value validated to member"),
  424    436   
            ))
  425    437   
            .set_header_enum_list(::std::option::Option::Some(vec![
  426    438   
                "Foo".parse::<crate::types::FooEnum>().expect("static value validated to member"),
  427    439   
                "Bar".parse::<crate::types::FooEnum>().expect("static value validated to member"),
  428    440   
                "Baz".parse::<crate::types::FooEnum>().expect("static value validated to member"),
  429    441   
            ]))
  430    442   
            .send()
  431    443   
            .await;
  432    444   
        let _ = dbg!(result);
  433    445   
        let http_request = request_receiver.expect_request();
  434    446   
        let expected_headers = [("X-Enum", "Foo"), ("X-EnumList", "Foo, Bar, Baz")];
  435    447   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
  436    448   
        let body = http_request.body().bytes().expect("body should be strict");
  437    449   
        // No body.
  438    450   
        ::pretty_assertions::assert_eq!(&body, &::bytes::Bytes::new());
  439    451   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  440    452   
        ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
  441    453   
        ::pretty_assertions::assert_eq!(uri.path(), "/InputAndOutputWithHeaders", "path was incorrect");
  442    454   
    }
  443    455   
  444    456   
    /// Tests requests with intEnum header bindings
  445    457   
    /// Test ID: RestJsonInputAndOutputWithIntEnumHeaders
  446    458   
    #[::tokio::test]
  447    459   
    #[::tracing_test::traced_test]
  448    460   
    async fn rest_json_input_and_output_with_int_enum_headers_request() {
  449    461   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  450    462   
        let config_builder = crate::config::Config::builder()
  451    463   
            .with_test_defaults()
  452         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         464  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         465  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         466  +
            .allow_no_auth()
  453    467   
            .endpoint_url("https://example.com");
  454    468   
  455    469   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  456    470   
        let result = client
  457    471   
            .input_and_output_with_headers()
  458    472   
            .set_header_integer_enum(::std::option::Option::Some(1))
  459    473   
            .set_header_integer_enum_list(::std::option::Option::Some(vec![1, 2, 3]))
  460    474   
            .send()
  461    475   
            .await;
  462    476   
        let _ = dbg!(result);
  463    477   
        let http_request = request_receiver.expect_request();
  464    478   
        let expected_headers = [("X-IntegerEnum", "1"), ("X-IntegerEnumList", "1, 2, 3")];
  465    479   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
  466    480   
        let body = http_request.body().bytes().expect("body should be strict");
  467    481   
        // No body.
  468    482   
        ::pretty_assertions::assert_eq!(&body, &::bytes::Bytes::new());
  469    483   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  470    484   
        ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
  471    485   
        ::pretty_assertions::assert_eq!(uri.path(), "/InputAndOutputWithHeaders", "path was incorrect");
  472    486   
    }
  473    487   
  474    488   
    /// Supports handling NaN float header values.
  475    489   
    /// Test ID: RestJsonSupportsNaNFloatHeaderInputs
  476    490   
    #[::tokio::test]
  477    491   
    #[::tracing_test::traced_test]
  478    492   
    async fn rest_json_supports_na_n_float_header_inputs_request() {
  479    493   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  480    494   
        let config_builder = crate::config::Config::builder()
  481    495   
            .with_test_defaults()
  482         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         496  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         497  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         498  +
            .allow_no_auth()
  483    499   
            .endpoint_url("https://example.com");
  484    500   
  485    501   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  486    502   
        let result = client
  487    503   
            .input_and_output_with_headers()
  488    504   
            .set_header_float(::std::option::Option::Some(
  489    505   
                <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("NaN").expect("invalid string for number"),
  490    506   
            ))
  491    507   
            .set_header_double(::std::option::Option::Some(
  492    508   
                <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("NaN").expect("invalid string for number"),
  493    509   
            ))
  494    510   
            .send()
  495    511   
            .await;
  496    512   
        let _ = dbg!(result);
  497    513   
        let http_request = request_receiver.expect_request();
  498    514   
        let expected_headers = [("X-Double", "NaN"), ("X-Float", "NaN")];
  499    515   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
  500    516   
        let body = http_request.body().bytes().expect("body should be strict");
  501    517   
        // No body.
  502    518   
        ::pretty_assertions::assert_eq!(&body, &::bytes::Bytes::new());
  503    519   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  504    520   
        ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
  505    521   
        ::pretty_assertions::assert_eq!(uri.path(), "/InputAndOutputWithHeaders", "path was incorrect");
  506    522   
    }
  507    523   
  508    524   
    /// Supports handling Infinity float header values.
  509    525   
    /// Test ID: RestJsonSupportsInfinityFloatHeaderInputs
  510    526   
    #[::tokio::test]
  511    527   
    #[::tracing_test::traced_test]
  512    528   
    async fn rest_json_supports_infinity_float_header_inputs_request() {
  513    529   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  514    530   
        let config_builder = crate::config::Config::builder()
  515    531   
            .with_test_defaults()
  516         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         532  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         533  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         534  +
            .allow_no_auth()
  517    535   
            .endpoint_url("https://example.com");
  518    536   
  519    537   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  520    538   
        let result = client
  521    539   
            .input_and_output_with_headers()
  522    540   
            .set_header_float(::std::option::Option::Some(
  523    541   
                <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("Infinity").expect("invalid string for number"),
  524    542   
            ))
  525    543   
            .set_header_double(::std::option::Option::Some(
  526    544   
                <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("Infinity").expect("invalid string for number"),
  527    545   
            ))
  528    546   
            .send()
  529    547   
            .await;
  530    548   
        let _ = dbg!(result);
  531    549   
        let http_request = request_receiver.expect_request();
  532    550   
        let expected_headers = [("X-Double", "Infinity"), ("X-Float", "Infinity")];
  533    551   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
  534    552   
        let body = http_request.body().bytes().expect("body should be strict");
  535    553   
        // No body.
  536    554   
        ::pretty_assertions::assert_eq!(&body, &::bytes::Bytes::new());
  537    555   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  538    556   
        ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
  539    557   
        ::pretty_assertions::assert_eq!(uri.path(), "/InputAndOutputWithHeaders", "path was incorrect");
  540    558   
    }
  541    559   
  542    560   
    /// Supports handling -Infinity float header values.
  543    561   
    /// Test ID: RestJsonSupportsNegativeInfinityFloatHeaderInputs
  544    562   
    #[::tokio::test]
  545    563   
    #[::tracing_test::traced_test]
  546    564   
    async fn rest_json_supports_negative_infinity_float_header_inputs_request() {
  547    565   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  548    566   
        let config_builder = crate::config::Config::builder()
  549    567   
            .with_test_defaults()
  550         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         568  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         569  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         570  +
            .allow_no_auth()
  551    571   
            .endpoint_url("https://example.com");
  552    572   
  553    573   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  554    574   
        let result = client
  555    575   
            .input_and_output_with_headers()
  556    576   
            .set_header_float(::std::option::Option::Some(
  557    577   
                <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("-Infinity").expect("invalid string for number"),
  558    578   
            ))
  559    579   
            .set_header_double(::std::option::Option::Some(
  560    580   
                <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("-Infinity").expect("invalid string for number"),

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

@@ -214,214 +274,276 @@
  234    234   
mod json_blobs_test {
  235    235   
  236    236   
    /// Blobs are base64 encoded
  237    237   
    /// Test ID: RestJsonJsonBlobs
  238    238   
    #[::tokio::test]
  239    239   
    #[::tracing_test::traced_test]
  240    240   
    async fn rest_json_json_blobs_request() {
  241    241   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  242    242   
        let config_builder = crate::config::Config::builder()
  243    243   
            .with_test_defaults()
  244         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         244  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         245  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         246  +
            .allow_no_auth()
  245    247   
            .endpoint_url("https://example.com");
  246    248   
  247    249   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  248    250   
        let result = client
  249    251   
            .json_blobs()
  250    252   
            .set_data(::std::option::Option::Some(::aws_smithy_types::Blob::new("value")))
  251    253   
            .send()
  252    254   
            .await;
  253    255   
        let _ = dbg!(result);
  254    256   
        let http_request = request_receiver.expect_request();

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

@@ -214,214 +274,276 @@
  234    234   
mod json_enums_test {
  235    235   
  236    236   
    /// Serializes simple scalar properties
  237    237   
    /// Test ID: RestJsonJsonEnums
  238    238   
    #[::tokio::test]
  239    239   
    #[::tracing_test::traced_test]
  240    240   
    async fn rest_json_json_enums_request() {
  241    241   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  242    242   
        let config_builder = crate::config::Config::builder()
  243    243   
            .with_test_defaults()
  244         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         244  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         245  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         246  +
            .allow_no_auth()
  245    247   
            .endpoint_url("https://example.com");
  246    248   
  247    249   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  248    250   
        let result = client
  249    251   
            .json_enums()
  250    252   
            .set_foo_enum1(::std::option::Option::Some(
  251    253   
                "Foo".parse::<crate::types::FooEnum>().expect("static value validated to member"),
  252    254   
            ))
  253    255   
            .set_foo_enum2(::std::option::Option::Some(
  254    256   
                "0".parse::<crate::types::FooEnum>().expect("static value validated to member"),

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

@@ -216,216 +276,278 @@
  236    236   
mod json_int_enums_test {
  237    237   
  238    238   
    /// Serializes intEnums as integers
  239    239   
    /// Test ID: RestJsonJsonIntEnums
  240    240   
    #[::tokio::test]
  241    241   
    #[::tracing_test::traced_test]
  242    242   
    async fn rest_json_json_int_enums_request() {
  243    243   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  244    244   
        let config_builder = crate::config::Config::builder()
  245    245   
            .with_test_defaults()
  246         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         246  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         247  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         248  +
            .allow_no_auth()
  247    249   
            .endpoint_url("https://example.com");
  248    250   
  249    251   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  250    252   
        let result = client
  251    253   
            .json_int_enums()
  252    254   
            .set_integer_enum1(::std::option::Option::Some(1))
  253    255   
            .set_integer_enum2(::std::option::Option::Some(2))
  254    256   
            .set_integer_enum3(::std::option::Option::Some(3))
  255    257   
            .set_integer_enum_list(::std::option::Option::Some(vec![1, 2, 3]))
  256    258   
            .set_integer_enum_set(::std::option::Option::Some(vec![1, 2]))

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

@@ -214,214 +330,334 @@
  234    234   
mod json_lists_test {
  235    235   
  236    236   
    /// Serializes JSON lists
  237    237   
    /// Test ID: RestJsonLists
  238    238   
    #[::tokio::test]
  239    239   
    #[::tracing_test::traced_test]
  240    240   
    async fn rest_json_lists_request() {
  241    241   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  242    242   
        let config_builder = crate::config::Config::builder()
  243    243   
            .with_test_defaults()
  244         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         244  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         245  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         246  +
            .allow_no_auth()
  245    247   
            .endpoint_url("https://example.com");
  246    248   
  247    249   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  248    250   
        let result = client
  249    251   
            .json_lists()
  250    252   
            .set_string_list(::std::option::Option::Some(vec!["foo".to_owned(), "bar".to_owned()]))
  251    253   
            .set_string_set(::std::option::Option::Some(vec!["foo".to_owned(), "bar".to_owned()]))
  252    254   
            .set_integer_list(::std::option::Option::Some(vec![1, 2]))
  253    255   
            .set_boolean_list(::std::option::Option::Some(vec![true, false]))
  254    256   
            .set_timestamp_list(::std::option::Option::Some(vec![
  255    257   
                ::aws_smithy_types::DateTime::from_fractional_secs(1398796238, 0_f64),
  256    258   
                ::aws_smithy_types::DateTime::from_fractional_secs(1398796238, 0_f64),
  257    259   
            ]))
  258    260   
            .set_enum_list(::std::option::Option::Some(vec![
  259    261   
                "Foo".parse::<crate::types::FooEnum>().expect("static value validated to member"),
  260    262   
                "0".parse::<crate::types::FooEnum>().expect("static value validated to member"),
  261    263   
            ]))
  262    264   
            .set_int_enum_list(::std::option::Option::Some(vec![1, 2]))
  263    265   
            .set_nested_string_list(::std::option::Option::Some(vec![
  264    266   
                vec!["foo".to_owned(), "bar".to_owned()],
  265    267   
                vec!["baz".to_owned(), "qux".to_owned()],
  266    268   
            ]))
  267    269   
            .set_structure_list(::std::option::Option::Some(vec![
  268    270   
                crate::types::StructureListMember::builder()
  269    271   
                    .set_a(::std::option::Option::Some("1".to_owned()))
  270    272   
                    .set_b(::std::option::Option::Some("2".to_owned()))
  271    273   
                    .build(),
  272    274   
                crate::types::StructureListMember::builder()
  273    275   
                    .set_a(::std::option::Option::Some("3".to_owned()))
  274    276   
                    .set_b(::std::option::Option::Some("4".to_owned()))
  275    277   
                    .build(),
  276    278   
            ]))
  277    279   
            .send()
  278    280   
            .await;
  279    281   
        let _ = dbg!(result);
  280    282   
        let http_request = request_receiver.expect_request();
  281    283   
        let expected_headers = [("Content-Type", "application/json")];
  282    284   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
  283    285   
        let body = http_request.body().bytes().expect("body should be strict");
  284    286   
        ::aws_smithy_protocol_test::assert_ok(
  285    287   
        ::aws_smithy_protocol_test::validate_body(body, "{\n    \"stringList\": [\n        \"foo\",\n        \"bar\"\n    ],\n    \"stringSet\": [\n        \"foo\",\n        \"bar\"\n    ],\n    \"integerList\": [\n        1,\n        2\n    ],\n    \"booleanList\": [\n        true,\n        false\n    ],\n    \"timestampList\": [\n        1398796238,\n        1398796238\n    ],\n    \"enumList\": [\n        \"Foo\",\n        \"0\"\n    ],\n    \"intEnumList\": [\n        1,\n        2\n    ],\n    \"nestedStringList\": [\n        [\n            \"foo\",\n            \"bar\"\n        ],\n        [\n            \"baz\",\n            \"qux\"\n        ]\n    ],\n    \"myStructureList\": [\n        {\n            \"value\": \"1\",\n            \"other\": \"2\"\n        },\n        {\n            \"value\": \"3\",\n            \"other\": \"4\"\n        }\n    ]\n}", ::aws_smithy_protocol_test::MediaType::from("application/json"))
  286    288   
        );
  287    289   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  288    290   
        ::pretty_assertions::assert_eq!(http_request.method(), "PUT", "method was incorrect");
  289    291   
        ::pretty_assertions::assert_eq!(uri.path(), "/JsonLists", "path was incorrect");
  290    292   
    }
  291    293   
  292    294   
    /// Serializes empty JSON lists
  293    295   
    /// Test ID: RestJsonListsEmpty
  294    296   
    #[::tokio::test]
  295    297   
    #[::tracing_test::traced_test]
  296    298   
    async fn rest_json_lists_empty_request() {
  297    299   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  298    300   
        let config_builder = crate::config::Config::builder()
  299    301   
            .with_test_defaults()
  300         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         302  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         303  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         304  +
            .allow_no_auth()
  301    305   
            .endpoint_url("https://example.com");
  302    306   
  303    307   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  304    308   
        let result = client.json_lists().set_string_list(::std::option::Option::Some(vec![])).send().await;
  305    309   
        let _ = dbg!(result);
  306    310   
        let http_request = request_receiver.expect_request();
  307    311   
        let expected_headers = [("Content-Type", "application/json")];
  308    312   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
  309    313   
        let body = http_request.body().bytes().expect("body should be strict");
  310    314   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(

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

@@ -210,210 +356,362 @@
  230    230   
mod json_maps_test {
  231    231   
  232    232   
    /// Serializes JSON maps
  233    233   
    /// Test ID: RestJsonJsonMaps
  234    234   
    #[::tokio::test]
  235    235   
    #[::tracing_test::traced_test]
  236    236   
    async fn rest_json_json_maps_request() {
  237    237   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  238    238   
        let config_builder = crate::config::Config::builder()
  239    239   
            .with_test_defaults()
  240         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         240  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         241  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         242  +
            .allow_no_auth()
  241    243   
            .endpoint_url("https://example.com");
  242    244   
  243    245   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  244    246   
        let result = client
  245    247   
            .json_maps()
  246    248   
            .set_dense_struct_map(::std::option::Option::Some({
  247    249   
                let mut ret = ::std::collections::HashMap::new();
  248    250   
                ret.insert(
  249    251   
                    "foo".to_owned(),
  250    252   
                    crate::types::GreetingStruct::builder()
  251    253   
                        .set_hi(::std::option::Option::Some("there".to_owned()))
  252    254   
                        .build(),
  253    255   
                );
  254    256   
                ret.insert(
  255    257   
                    "baz".to_owned(),
  256    258   
                    crate::types::GreetingStruct::builder()
  257    259   
                        .set_hi(::std::option::Option::Some("bye".to_owned()))
  258    260   
                        .build(),
  259    261   
                );
  260    262   
                ret
  261    263   
            }))
  262    264   
            .send()
  263    265   
            .await;
  264    266   
        let _ = dbg!(result);
  265    267   
        let http_request = request_receiver.expect_request();
  266    268   
        let expected_headers = [("Content-Type", "application/json")];
  267    269   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
  268    270   
        let body = http_request.body().bytes().expect("body should be strict");
  269    271   
        ::aws_smithy_protocol_test::assert_ok(
  270    272   
        ::aws_smithy_protocol_test::validate_body(body, "{\n    \"denseStructMap\": {\n        \"foo\": {\n            \"hi\": \"there\"\n        },\n        \"baz\": {\n            \"hi\": \"bye\"\n        }\n    }\n}", ::aws_smithy_protocol_test::MediaType::from("application/json"))
  271    273   
        );
  272    274   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  273    275   
        ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
  274    276   
        ::pretty_assertions::assert_eq!(uri.path(), "/JsonMaps", "path was incorrect");
  275    277   
    }
  276    278   
  277    279   
    /// Ensure that 0 and false are sent over the wire in all maps and lists
  278    280   
    /// Test ID: RestJsonSerializesZeroValuesInMaps
  279    281   
    #[::tokio::test]
  280    282   
    #[::tracing_test::traced_test]
  281    283   
    async fn rest_json_serializes_zero_values_in_maps_request() {
  282    284   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  283    285   
        let config_builder = crate::config::Config::builder()
  284    286   
            .with_test_defaults()
  285         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         287  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         288  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         289  +
            .allow_no_auth()
  286    290   
            .endpoint_url("https://example.com");
  287    291   
  288    292   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  289    293   
        let result = client
  290    294   
            .json_maps()
  291    295   
            .set_dense_number_map(::std::option::Option::Some({
  292    296   
                let mut ret = ::std::collections::HashMap::new();
  293    297   
                ret.insert("x".to_owned(), 0);
  294    298   
                ret
  295    299   
            }))
  296    300   
            .set_dense_boolean_map(::std::option::Option::Some({
  297    301   
                let mut ret = ::std::collections::HashMap::new();
  298    302   
                ret.insert("x".to_owned(), false);
  299    303   
                ret
  300    304   
            }))
  301    305   
            .send()
  302    306   
            .await;
  303    307   
        let _ = dbg!(result);
  304    308   
        let http_request = request_receiver.expect_request();
  305    309   
        let expected_headers = [("Content-Type", "application/json")];
  306    310   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
  307    311   
        let body = http_request.body().bytes().expect("body should be strict");
  308    312   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
  309    313   
            body,
  310    314   
            "{\n    \"denseNumberMap\": {\n        \"x\": 0\n    },\n    \"denseBooleanMap\": {\n        \"x\": false\n    }\n}",
  311    315   
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
  312    316   
        ));
  313    317   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  314    318   
        ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
  315    319   
        ::pretty_assertions::assert_eq!(uri.path(), "/JsonMaps", "path was incorrect");
  316    320   
    }
  317    321   
  318    322   
    /// A request that contains a dense map of sets.
  319    323   
    /// Test ID: RestJsonSerializesDenseSetMap
  320    324   
    #[::tokio::test]
  321    325   
    #[::tracing_test::traced_test]
  322    326   
    async fn rest_json_serializes_dense_set_map_request() {
  323    327   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  324    328   
        let config_builder = crate::config::Config::builder()
  325    329   
            .with_test_defaults()
  326         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         330  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         331  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         332  +
            .allow_no_auth()
  327    333   
            .endpoint_url("https://example.com");
  328    334   
  329    335   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  330    336   
        let result = client
  331    337   
            .json_maps()
  332    338   
            .set_dense_set_map(::std::option::Option::Some({
  333    339   
                let mut ret = ::std::collections::HashMap::new();
  334    340   
                ret.insert("x".to_owned(), vec![]);
  335    341   
                ret.insert("y".to_owned(), vec!["a".to_owned(), "b".to_owned()]);
  336    342   
                ret

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

@@ -216,216 +480,494 @@
  236    236   
mod json_timestamps_test {
  237    237   
  238    238   
    /// Tests how normal timestamps are serialized
  239    239   
    /// Test ID: RestJsonJsonTimestamps
  240    240   
    #[::tokio::test]
  241    241   
    #[::tracing_test::traced_test]
  242    242   
    async fn rest_json_json_timestamps_request() {
  243    243   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  244    244   
        let config_builder = crate::config::Config::builder()
  245    245   
            .with_test_defaults()
  246         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         246  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         247  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         248  +
            .allow_no_auth()
  247    249   
            .endpoint_url("https://example.com");
  248    250   
  249    251   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  250    252   
        let result = client
  251    253   
            .json_timestamps()
  252    254   
            .set_normal(::std::option::Option::Some(::aws_smithy_types::DateTime::from_fractional_secs(
  253    255   
                1398796238, 0_f64,
  254    256   
            )))
  255    257   
            .send()
  256    258   
            .await;
  257    259   
        let _ = dbg!(result);
  258    260   
        let http_request = request_receiver.expect_request();
  259    261   
        let expected_headers = [("Content-Type", "application/json")];
  260    262   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
  261    263   
        let body = http_request.body().bytes().expect("body should be strict");
  262    264   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
  263    265   
            body,
  264    266   
            "{\n    \"normal\": 1398796238\n}",
  265    267   
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
  266    268   
        ));
  267    269   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  268    270   
        ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
  269    271   
        ::pretty_assertions::assert_eq!(uri.path(), "/JsonTimestamps", "path was incorrect");
  270    272   
    }
  271    273   
  272    274   
    /// Ensures that the timestampFormat of date-time works like normal timestamps
  273    275   
    /// Test ID: RestJsonJsonTimestampsWithDateTimeFormat
  274    276   
    #[::tokio::test]
  275    277   
    #[::tracing_test::traced_test]
  276    278   
    async fn rest_json_json_timestamps_with_date_time_format_request() {
  277    279   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  278    280   
        let config_builder = crate::config::Config::builder()
  279    281   
            .with_test_defaults()
  280         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         282  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         283  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         284  +
            .allow_no_auth()
  281    285   
            .endpoint_url("https://example.com");
  282    286   
  283    287   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  284    288   
        let result = client
  285    289   
            .json_timestamps()
  286    290   
            .set_date_time(::std::option::Option::Some(::aws_smithy_types::DateTime::from_fractional_secs(
  287    291   
                1398796238, 0_f64,
  288    292   
            )))
  289    293   
            .send()
  290    294   
            .await;
  291    295   
        let _ = dbg!(result);
  292    296   
        let http_request = request_receiver.expect_request();
  293    297   
        let expected_headers = [("Content-Type", "application/json")];
  294    298   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
  295    299   
        let body = http_request.body().bytes().expect("body should be strict");
  296    300   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
  297    301   
            body,
  298    302   
            "{\n    \"dateTime\": \"2014-04-29T18:30:38Z\"\n}",
  299    303   
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
  300    304   
        ));
  301    305   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  302    306   
        ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
  303    307   
        ::pretty_assertions::assert_eq!(uri.path(), "/JsonTimestamps", "path was incorrect");
  304    308   
    }
  305    309   
  306    310   
    /// Ensures that the timestampFormat of date-time on the target shape works like normal timestamps
  307    311   
    /// Test ID: RestJsonJsonTimestampsWithDateTimeOnTargetFormat
  308    312   
    #[::tokio::test]
  309    313   
    #[::tracing_test::traced_test]
  310    314   
    async fn rest_json_json_timestamps_with_date_time_on_target_format_request() {
  311    315   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  312    316   
        let config_builder = crate::config::Config::builder()
  313    317   
            .with_test_defaults()
  314         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         318  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         319  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         320  +
            .allow_no_auth()
  315    321   
            .endpoint_url("https://example.com");
  316    322   
  317    323   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  318    324   
        let result = client
  319    325   
            .json_timestamps()
  320    326   
            .set_date_time_on_target(::std::option::Option::Some(::aws_smithy_types::DateTime::from_fractional_secs(
  321    327   
                1398796238, 0_f64,
  322    328   
            )))
  323    329   
            .send()
  324    330   
            .await;
  325    331   
        let _ = dbg!(result);
  326    332   
        let http_request = request_receiver.expect_request();
  327    333   
        let expected_headers = [("Content-Type", "application/json")];
  328    334   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
  329    335   
        let body = http_request.body().bytes().expect("body should be strict");
  330    336   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
  331    337   
            body,
  332    338   
            "{\n    \"dateTimeOnTarget\": \"2014-04-29T18:30:38Z\"\n}",
  333    339   
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
  334    340   
        ));
  335    341   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  336    342   
        ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
  337    343   
        ::pretty_assertions::assert_eq!(uri.path(), "/JsonTimestamps", "path was incorrect");
  338    344   
    }
  339    345   
  340    346   
    /// Ensures that the timestampFormat of epoch-seconds works
  341    347   
    /// Test ID: RestJsonJsonTimestampsWithEpochSecondsFormat
  342    348   
    #[::tokio::test]
  343    349   
    #[::tracing_test::traced_test]
  344    350   
    async fn rest_json_json_timestamps_with_epoch_seconds_format_request() {
  345    351   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  346    352   
        let config_builder = crate::config::Config::builder()
  347    353   
            .with_test_defaults()
  348         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         354  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         355  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         356  +
            .allow_no_auth()
  349    357   
            .endpoint_url("https://example.com");
  350    358   
  351    359   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  352    360   
        let result = client
  353    361   
            .json_timestamps()
  354    362   
            .set_epoch_seconds(::std::option::Option::Some(::aws_smithy_types::DateTime::from_fractional_secs(
  355    363   
                1398796238, 0_f64,
  356    364   
            )))
  357    365   
            .send()
  358    366   
            .await;
  359    367   
        let _ = dbg!(result);
  360    368   
        let http_request = request_receiver.expect_request();
  361    369   
        let expected_headers = [("Content-Type", "application/json")];
  362    370   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
  363    371   
        let body = http_request.body().bytes().expect("body should be strict");
  364    372   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
  365    373   
            body,
  366    374   
            "{\n    \"epochSeconds\": 1398796238\n}",
  367    375   
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
  368    376   
        ));
  369    377   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  370    378   
        ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
  371    379   
        ::pretty_assertions::assert_eq!(uri.path(), "/JsonTimestamps", "path was incorrect");
  372    380   
    }
  373    381   
  374    382   
    /// Ensures that the timestampFormat of epoch-seconds on the target shape works
  375    383   
    /// Test ID: RestJsonJsonTimestampsWithEpochSecondsOnTargetFormat
  376    384   
    #[::tokio::test]
  377    385   
    #[::tracing_test::traced_test]
  378    386   
    async fn rest_json_json_timestamps_with_epoch_seconds_on_target_format_request() {
  379    387   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  380    388   
        let config_builder = crate::config::Config::builder()
  381    389   
            .with_test_defaults()
  382         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         390  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         391  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         392  +
            .allow_no_auth()
  383    393   
            .endpoint_url("https://example.com");
  384    394   
  385    395   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  386    396   
        let result = client
  387    397   
            .json_timestamps()
  388    398   
            .set_epoch_seconds_on_target(::std::option::Option::Some(::aws_smithy_types::DateTime::from_fractional_secs(
  389    399   
                1398796238, 0_f64,
  390    400   
            )))
  391    401   
            .send()
  392    402   
            .await;
  393    403   
        let _ = dbg!(result);
  394    404   
        let http_request = request_receiver.expect_request();
  395    405   
        let expected_headers = [("Content-Type", "application/json")];
  396    406   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
  397    407   
        let body = http_request.body().bytes().expect("body should be strict");
  398    408   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
  399    409   
            body,
  400    410   
            "{\n    \"epochSecondsOnTarget\": 1398796238\n}",
  401    411   
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
  402    412   
        ));
  403    413   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  404    414   
        ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
  405    415   
        ::pretty_assertions::assert_eq!(uri.path(), "/JsonTimestamps", "path was incorrect");
  406    416   
    }
  407    417   
  408    418   
    /// Ensures that the timestampFormat of http-date works
  409    419   
    /// Test ID: RestJsonJsonTimestampsWithHttpDateFormat
  410    420   
    #[::tokio::test]
  411    421   
    #[::tracing_test::traced_test]
  412    422   
    async fn rest_json_json_timestamps_with_http_date_format_request() {
  413    423   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  414    424   
        let config_builder = crate::config::Config::builder()
  415    425   
            .with_test_defaults()
  416         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         426  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         427  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         428  +
            .allow_no_auth()
  417    429   
            .endpoint_url("https://example.com");
  418    430   
  419    431   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  420    432   
        let result = client
  421    433   
            .json_timestamps()
  422    434   
            .set_http_date(::std::option::Option::Some(::aws_smithy_types::DateTime::from_fractional_secs(
  423    435   
                1398796238, 0_f64,
  424    436   
            )))
  425    437   
            .send()
  426    438   
            .await;
  427    439   
        let _ = dbg!(result);
  428    440   
        let http_request = request_receiver.expect_request();
  429    441   
        let expected_headers = [("Content-Type", "application/json")];
  430    442   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
  431    443   
        let body = http_request.body().bytes().expect("body should be strict");
  432    444   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
  433    445   
            body,
  434    446   
            "{\n    \"httpDate\": \"Tue, 29 Apr 2014 18:30:38 GMT\"\n}",
  435    447   
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
  436    448   
        ));
  437    449   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  438    450   
        ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
  439    451   
        ::pretty_assertions::assert_eq!(uri.path(), "/JsonTimestamps", "path was incorrect");
  440    452   
    }
  441    453   
  442    454   
    /// Ensures that the timestampFormat of http-date on the target shape works
  443    455   
    /// Test ID: RestJsonJsonTimestampsWithHttpDateOnTargetFormat
  444    456   
    #[::tokio::test]
  445    457   
    #[::tracing_test::traced_test]
  446    458   
    async fn rest_json_json_timestamps_with_http_date_on_target_format_request() {
  447    459   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  448    460   
        let config_builder = crate::config::Config::builder()
  449    461   
            .with_test_defaults()
  450         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         462  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         463  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         464  +
            .allow_no_auth()
  451    465   
            .endpoint_url("https://example.com");
  452    466   
  453    467   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  454    468   
        let result = client
  455    469   
            .json_timestamps()
  456    470   
            .set_http_date_on_target(::std::option::Option::Some(::aws_smithy_types::DateTime::from_fractional_secs(
  457    471   
                1398796238, 0_f64,
  458    472   
            )))
  459    473   
            .send()
  460    474   
            .await;

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

@@ -214,214 +580,600 @@
  234    234   
mod json_unions_test {
  235    235   
  236    236   
    /// Serializes a string union value
  237    237   
    /// Test ID: RestJsonSerializeStringUnionValue
  238    238   
    #[::tokio::test]
  239    239   
    #[::tracing_test::traced_test]
  240    240   
    async fn rest_json_serialize_string_union_value_request() {
  241    241   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  242    242   
        let config_builder = crate::config::Config::builder()
  243    243   
            .with_test_defaults()
  244         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         244  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         245  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         246  +
            .allow_no_auth()
  245    247   
            .endpoint_url("https://example.com");
  246    248   
  247    249   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  248    250   
        let result = client
  249    251   
            .json_unions()
  250    252   
            .set_contents(::std::option::Option::Some(crate::types::MyUnion::StringValue("foo".to_owned())))
  251    253   
            .send()
  252    254   
            .await;
  253    255   
        let _ = dbg!(result);
  254    256   
        let http_request = request_receiver.expect_request();
  255    257   
        let expected_headers = [("Content-Type", "application/json")];
  256    258   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
  257    259   
        let body = http_request.body().bytes().expect("body should be strict");
  258    260   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
  259    261   
            body,
  260    262   
            "{\n    \"contents\": {\n        \"stringValue\": \"foo\"\n    }\n}",
  261    263   
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
  262    264   
        ));
  263    265   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  264    266   
        ::pretty_assertions::assert_eq!(http_request.method(), "PUT", "method was incorrect");
  265    267   
        ::pretty_assertions::assert_eq!(uri.path(), "/JsonUnions", "path was incorrect");
  266    268   
    }
  267    269   
  268    270   
    /// Serializes a boolean union value
  269    271   
    /// Test ID: RestJsonSerializeBooleanUnionValue
  270    272   
    #[::tokio::test]
  271    273   
    #[::tracing_test::traced_test]
  272    274   
    async fn rest_json_serialize_boolean_union_value_request() {
  273    275   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  274    276   
        let config_builder = crate::config::Config::builder()
  275    277   
            .with_test_defaults()
  276         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         278  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         279  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         280  +
            .allow_no_auth()
  277    281   
            .endpoint_url("https://example.com");
  278    282   
  279    283   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  280    284   
        let result = client
  281    285   
            .json_unions()
  282    286   
            .set_contents(::std::option::Option::Some(crate::types::MyUnion::BooleanValue(true)))
  283    287   
            .send()
  284    288   
            .await;
  285    289   
        let _ = dbg!(result);
  286    290   
        let http_request = request_receiver.expect_request();
  287    291   
        let expected_headers = [("Content-Type", "application/json")];
  288    292   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
  289    293   
        let body = http_request.body().bytes().expect("body should be strict");
  290    294   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
  291    295   
            body,
  292    296   
            "{\n    \"contents\": {\n        \"booleanValue\": true\n    }\n}",
  293    297   
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
  294    298   
        ));
  295    299   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  296    300   
        ::pretty_assertions::assert_eq!(http_request.method(), "PUT", "method was incorrect");
  297    301   
        ::pretty_assertions::assert_eq!(uri.path(), "/JsonUnions", "path was incorrect");
  298    302   
    }
  299    303   
  300    304   
    /// Serializes a number union value
  301    305   
    /// Test ID: RestJsonSerializeNumberUnionValue
  302    306   
    #[::tokio::test]
  303    307   
    #[::tracing_test::traced_test]
  304    308   
    async fn rest_json_serialize_number_union_value_request() {
  305    309   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  306    310   
        let config_builder = crate::config::Config::builder()
  307    311   
            .with_test_defaults()
  308         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         312  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         313  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         314  +
            .allow_no_auth()
  309    315   
            .endpoint_url("https://example.com");
  310    316   
  311    317   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  312    318   
        let result = client
  313    319   
            .json_unions()
  314    320   
            .set_contents(::std::option::Option::Some(crate::types::MyUnion::NumberValue(1)))
  315    321   
            .send()
  316    322   
            .await;
  317    323   
        let _ = dbg!(result);
  318    324   
        let http_request = request_receiver.expect_request();
  319    325   
        let expected_headers = [("Content-Type", "application/json")];
  320    326   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
  321    327   
        let body = http_request.body().bytes().expect("body should be strict");
  322    328   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
  323    329   
            body,
  324    330   
            "{\n    \"contents\": {\n        \"numberValue\": 1\n    }\n}",
  325    331   
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
  326    332   
        ));
  327    333   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  328    334   
        ::pretty_assertions::assert_eq!(http_request.method(), "PUT", "method was incorrect");
  329    335   
        ::pretty_assertions::assert_eq!(uri.path(), "/JsonUnions", "path was incorrect");
  330    336   
    }
  331    337   
  332    338   
    /// Serializes a blob union value
  333    339   
    /// Test ID: RestJsonSerializeBlobUnionValue
  334    340   
    #[::tokio::test]
  335    341   
    #[::tracing_test::traced_test]
  336    342   
    async fn rest_json_serialize_blob_union_value_request() {
  337    343   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  338    344   
        let config_builder = crate::config::Config::builder()
  339    345   
            .with_test_defaults()
  340         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         346  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         347  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         348  +
            .allow_no_auth()
  341    349   
            .endpoint_url("https://example.com");
  342    350   
  343    351   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  344    352   
        let result = client
  345    353   
            .json_unions()
  346    354   
            .set_contents(::std::option::Option::Some(crate::types::MyUnion::BlobValue(
  347    355   
                ::aws_smithy_types::Blob::new("foo"),
  348    356   
            )))
  349    357   
            .send()
  350    358   
            .await;
  351    359   
        let _ = dbg!(result);
  352    360   
        let http_request = request_receiver.expect_request();
  353    361   
        let expected_headers = [("Content-Type", "application/json")];
  354    362   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
  355    363   
        let body = http_request.body().bytes().expect("body should be strict");
  356    364   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
  357    365   
            body,
  358    366   
            "{\n    \"contents\": {\n        \"blobValue\": \"Zm9v\"\n    }\n}",
  359    367   
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
  360    368   
        ));
  361    369   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  362    370   
        ::pretty_assertions::assert_eq!(http_request.method(), "PUT", "method was incorrect");
  363    371   
        ::pretty_assertions::assert_eq!(uri.path(), "/JsonUnions", "path was incorrect");
  364    372   
    }
  365    373   
  366    374   
    /// Serializes a timestamp union value
  367    375   
    /// Test ID: RestJsonSerializeTimestampUnionValue
  368    376   
    #[::tokio::test]
  369    377   
    #[::tracing_test::traced_test]
  370    378   
    async fn rest_json_serialize_timestamp_union_value_request() {
  371    379   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  372    380   
        let config_builder = crate::config::Config::builder()
  373    381   
            .with_test_defaults()
  374         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         382  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         383  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         384  +
            .allow_no_auth()
  375    385   
            .endpoint_url("https://example.com");
  376    386   
  377    387   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  378    388   
        let result = client
  379    389   
            .json_unions()
  380    390   
            .set_contents(::std::option::Option::Some(crate::types::MyUnion::TimestampValue(
  381    391   
                ::aws_smithy_types::DateTime::from_fractional_secs(1398796238, 0_f64),
  382    392   
            )))
  383    393   
            .send()
  384    394   
            .await;
  385    395   
        let _ = dbg!(result);
  386    396   
        let http_request = request_receiver.expect_request();
  387    397   
        let expected_headers = [("Content-Type", "application/json")];
  388    398   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
  389    399   
        let body = http_request.body().bytes().expect("body should be strict");
  390    400   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
  391    401   
            body,
  392    402   
            "{\n    \"contents\": {\n        \"timestampValue\": 1398796238\n    }\n}",
  393    403   
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
  394    404   
        ));
  395    405   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  396    406   
        ::pretty_assertions::assert_eq!(http_request.method(), "PUT", "method was incorrect");
  397    407   
        ::pretty_assertions::assert_eq!(uri.path(), "/JsonUnions", "path was incorrect");
  398    408   
    }
  399    409   
  400    410   
    /// Serializes an enum union value
  401    411   
    /// Test ID: RestJsonSerializeEnumUnionValue
  402    412   
    #[::tokio::test]
  403    413   
    #[::tracing_test::traced_test]
  404    414   
    async fn rest_json_serialize_enum_union_value_request() {
  405    415   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  406    416   
        let config_builder = crate::config::Config::builder()
  407    417   
            .with_test_defaults()
  408         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         418  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         419  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         420  +
            .allow_no_auth()
  409    421   
            .endpoint_url("https://example.com");
  410    422   
  411    423   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  412    424   
        let result = client
  413    425   
            .json_unions()
  414    426   
            .set_contents(::std::option::Option::Some(crate::types::MyUnion::EnumValue(
  415    427   
                "Foo".parse::<crate::types::FooEnum>().expect("static value validated to member"),
  416    428   
            )))
  417    429   
            .send()
  418    430   
            .await;
  419    431   
        let _ = dbg!(result);
  420    432   
        let http_request = request_receiver.expect_request();
  421    433   
        let expected_headers = [("Content-Type", "application/json")];
  422    434   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
  423    435   
        let body = http_request.body().bytes().expect("body should be strict");
  424    436   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
  425    437   
            body,
  426    438   
            "{\n    \"contents\": {\n        \"enumValue\": \"Foo\"\n    }\n}",
  427    439   
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
  428    440   
        ));
  429    441   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  430    442   
        ::pretty_assertions::assert_eq!(http_request.method(), "PUT", "method was incorrect");
  431    443   
        ::pretty_assertions::assert_eq!(uri.path(), "/JsonUnions", "path was incorrect");
  432    444   
    }
  433    445   
  434    446   
    /// Serializes a list union value
  435    447   
    /// Test ID: RestJsonSerializeListUnionValue
  436    448   
    #[::tokio::test]
  437    449   
    #[::tracing_test::traced_test]
  438    450   
    async fn rest_json_serialize_list_union_value_request() {
  439    451   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  440    452   
        let config_builder = crate::config::Config::builder()
  441    453   
            .with_test_defaults()
  442         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         454  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         455  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         456  +
            .allow_no_auth()
  443    457   
            .endpoint_url("https://example.com");
  444    458   
  445    459   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  446    460   
        let result = client
  447    461   
            .json_unions()
  448    462   
            .set_contents(::std::option::Option::Some(crate::types::MyUnion::ListValue(vec![
  449    463   
                "foo".to_owned(),
  450    464   
                "bar".to_owned(),
  451    465   
            ])))
  452    466   
            .send()
  453    467   
            .await;
  454    468   
        let _ = dbg!(result);
  455    469   
        let http_request = request_receiver.expect_request();
  456    470   
        let expected_headers = [("Content-Type", "application/json")];
  457    471   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
  458    472   
        let body = http_request.body().bytes().expect("body should be strict");
  459    473   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
  460    474   
            body,
  461    475   
            "{\n    \"contents\": {\n        \"listValue\": [\"foo\", \"bar\"]\n    }\n}",
  462    476   
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
  463    477   
        ));
  464    478   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  465    479   
        ::pretty_assertions::assert_eq!(http_request.method(), "PUT", "method was incorrect");
  466    480   
        ::pretty_assertions::assert_eq!(uri.path(), "/JsonUnions", "path was incorrect");
  467    481   
    }
  468    482   
  469    483   
    /// Serializes a map union value
  470    484   
    /// Test ID: RestJsonSerializeMapUnionValue
  471    485   
    #[::tokio::test]
  472    486   
    #[::tracing_test::traced_test]
  473    487   
    async fn rest_json_serialize_map_union_value_request() {
  474    488   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  475    489   
        let config_builder = crate::config::Config::builder()
  476    490   
            .with_test_defaults()
  477         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         491  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         492  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         493  +
            .allow_no_auth()
  478    494   
            .endpoint_url("https://example.com");
  479    495   
  480    496   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  481    497   
        let result = client
  482    498   
            .json_unions()
  483    499   
            .set_contents(::std::option::Option::Some(crate::types::MyUnion::MapValue({
  484    500   
                let mut ret = ::std::collections::HashMap::new();
  485    501   
                ret.insert("foo".to_owned(), "bar".to_owned());
  486    502   
                ret.insert("spam".to_owned(), "eggs".to_owned());
  487    503   
                ret
  488    504   
            })))
  489    505   
            .send()
  490    506   
            .await;
  491    507   
        let _ = dbg!(result);
  492    508   
        let http_request = request_receiver.expect_request();
  493    509   
        let expected_headers = [("Content-Type", "application/json")];
  494    510   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
  495    511   
        let body = http_request.body().bytes().expect("body should be strict");
  496    512   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
  497    513   
            body,
  498    514   
            "{\n    \"contents\": {\n        \"mapValue\": {\n            \"foo\": \"bar\",\n            \"spam\": \"eggs\"\n        }\n    }\n}",
  499    515   
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
  500    516   
        ));
  501    517   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  502    518   
        ::pretty_assertions::assert_eq!(http_request.method(), "PUT", "method was incorrect");
  503    519   
        ::pretty_assertions::assert_eq!(uri.path(), "/JsonUnions", "path was incorrect");
  504    520   
    }
  505    521   
  506    522   
    /// Serializes a structure union value
  507    523   
    /// Test ID: RestJsonSerializeStructureUnionValue
  508    524   
    #[::tokio::test]
  509    525   
    #[::tracing_test::traced_test]
  510    526   
    async fn rest_json_serialize_structure_union_value_request() {
  511    527   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  512    528   
        let config_builder = crate::config::Config::builder()
  513    529   
            .with_test_defaults()
  514         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         530  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         531  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         532  +
            .allow_no_auth()
  515    533   
            .endpoint_url("https://example.com");
  516    534   
  517    535   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  518    536   
        let result = client
  519    537   
            .json_unions()
  520    538   
            .set_contents(::std::option::Option::Some(crate::types::MyUnion::StructureValue(
  521    539   
                crate::types::GreetingStruct::builder()
  522    540   
                    .set_hi(::std::option::Option::Some("hello".to_owned()))
  523    541   
                    .build(),
  524    542   
            )))
  525    543   
            .send()
  526    544   
            .await;
  527    545   
        let _ = dbg!(result);
  528    546   
        let http_request = request_receiver.expect_request();
  529    547   
        let expected_headers = [("Content-Type", "application/json")];
  530    548   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
  531    549   
        let body = http_request.body().bytes().expect("body should be strict");
  532    550   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
  533    551   
            body,
  534    552   
            "{\n    \"contents\": {\n        \"structureValue\": {\n            \"hi\": \"hello\"\n        }\n    }\n}",
  535    553   
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
  536    554   
        ));
  537    555   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  538    556   
        ::pretty_assertions::assert_eq!(http_request.method(), "PUT", "method was incorrect");
  539    557   
        ::pretty_assertions::assert_eq!(uri.path(), "/JsonUnions", "path was incorrect");
  540    558   
    }
  541    559   
  542    560   
    /// Serializes a renamed structure union value
  543    561   
    /// Test ID: RestJsonSerializeRenamedStructureUnionValue
  544    562   
    #[::tokio::test]
  545    563   
    #[::tracing_test::traced_test]
  546    564   
    async fn rest_json_serialize_renamed_structure_union_value_request() {
  547    565   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  548    566   
        let config_builder = crate::config::Config::builder()
  549    567   
            .with_test_defaults()
  550         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         568  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         569  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         570  +
            .allow_no_auth()
  551    571   
            .endpoint_url("https://example.com");
  552    572   
  553    573   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  554    574   
        let result = client
  555    575   
            .json_unions()
  556    576   
            .set_contents(::std::option::Option::Some(crate::types::MyUnion::RenamedStructureValue(
  557    577   
                crate::types::RenamedGreeting::builder()
  558    578   
                    .set_salutation(::std::option::Option::Some("hello!".to_owned()))
  559    579   
                    .build(),
  560    580   
            )))

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

@@ -219,219 +279,281 @@
  239    239   
mod media_type_header_test {
  240    240   
  241    241   
    /// Headers that target strings with a mediaType are base64 encoded
  242    242   
    /// Test ID: MediaTypeHeaderInputBase64
  243    243   
    #[::tokio::test]
  244    244   
    #[::tracing_test::traced_test]
  245    245   
    async fn media_type_header_input_base64_request() {
  246    246   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  247    247   
        let config_builder = crate::config::Config::builder()
  248    248   
            .with_test_defaults()
  249         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         249  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         250  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         251  +
            .allow_no_auth()
  250    252   
            .endpoint_url("https://example.com");
  251    253   
  252    254   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  253    255   
        let result = client
  254    256   
            .media_type_header()
  255    257   
            .set_json(::std::option::Option::Some("true".to_owned()))
  256    258   
            .send()
  257    259   
            .await;
  258    260   
        let _ = dbg!(result);
  259    261   
        let http_request = request_receiver.expect_request();

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

@@ -220,220 +280,282 @@
  240    240   
    /// No input serializes no payload. When clients do not need to
  241    241   
    /// serialize any data in the payload, they should omit a payload
  242    242   
    /// altogether.
  243    243   
    /// Test ID: RestJsonNoInputAndNoOutput
  244    244   
    #[::tokio::test]
  245    245   
    #[::tracing_test::traced_test]
  246    246   
    async fn rest_json_no_input_and_no_output_request() {
  247    247   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  248    248   
        let config_builder = crate::config::Config::builder()
  249    249   
            .with_test_defaults()
  250         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         250  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         251  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         252  +
            .allow_no_auth()
  251    253   
            .endpoint_url("https://example.com");
  252    254   
  253    255   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  254    256   
        let result = client.no_input_and_no_output().send().await;
  255    257   
        let _ = dbg!(result);
  256    258   
        let http_request = request_receiver.expect_request();
  257    259   
        let body = http_request.body().bytes().expect("body should be strict");
  258    260   
        // No body.
  259    261   
        ::pretty_assertions::assert_eq!(&body, &::bytes::Bytes::new());
  260    262   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");

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

@@ -220,220 +280,282 @@
  240    240   
    /// No input serializes no payload. When clients do not need to
  241    241   
    /// serialize any data in the payload, they should omit a payload
  242    242   
    /// altogether.
  243    243   
    /// Test ID: RestJsonNoInputAndOutput
  244    244   
    #[::tokio::test]
  245    245   
    #[::tracing_test::traced_test]
  246    246   
    async fn rest_json_no_input_and_output_request() {
  247    247   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  248    248   
        let config_builder = crate::config::Config::builder()
  249    249   
            .with_test_defaults()
  250         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         250  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         251  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         252  +
            .allow_no_auth()
  251    253   
            .endpoint_url("https://example.com");
  252    254   
  253    255   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  254    256   
        let result = client.no_input_and_output().send().await;
  255    257   
        let _ = dbg!(result);
  256    258   
        let http_request = request_receiver.expect_request();
  257    259   
        let body = http_request.body().bytes().expect("body should be strict");
  258    260   
        // No body.
  259    261   
        ::pretty_assertions::assert_eq!(&body, &::bytes::Bytes::new());
  260    262   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");