Client Test

Client Test

rev. 26e0a1e8aaec58e3c7fd18a79449d71bcadaf391 (ignoring whitespace)

Files changed:

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

@@ -219,219 +279,281 @@
  239    239   
mod null_and_empty_headers_client_test {
  240    240   
  241    241   
    /// Do not send null values, but do send empty strings and empty lists over the wire in headers
  242    242   
    /// Test ID: RestJsonNullAndEmptyHeaders
  243    243   
    #[::tokio::test]
  244    244   
    #[::tracing_test::traced_test]
  245    245   
    async fn rest_json_null_and_empty_headers_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   
            .null_and_empty_headers_client()
  255    257   
            .set_a(::std::option::Option::None)
  256    258   
            .set_b(::std::option::Option::Some("".to_owned()))
  257    259   
            .set_c(::std::option::Option::Some(vec![]))
  258    260   
            .send()
  259    261   
            .await;

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

@@ -238,238 +325,329 @@
  258    258   
mod omits_null_serializes_empty_string_test {
  259    259   
  260    260   
    /// Omits null query values
  261    261   
    /// Test ID: RestJsonOmitsNullQuery
  262    262   
    #[::tokio::test]
  263    263   
    #[::tracing_test::traced_test]
  264    264   
    async fn rest_json_omits_null_query_request() {
  265    265   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  266    266   
        let config_builder = crate::config::Config::builder()
  267    267   
            .with_test_defaults()
  268         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         268  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         269  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         270  +
            .allow_no_auth()
  269    271   
            .endpoint_url("https://example.com");
  270    272   
  271    273   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  272    274   
        let result = client
  273    275   
            .omits_null_serializes_empty_string()
  274    276   
            .set_null_value(::std::option::Option::None)
  275    277   
            .send()
  276    278   
            .await;
  277    279   
        let _ = dbg!(result);
  278    280   
        let http_request = request_receiver.expect_request();
  279    281   
        let body = http_request.body().bytes().expect("body should be strict");
  280    282   
        // No body.
  281    283   
        ::pretty_assertions::assert_eq!(&body, &::bytes::Bytes::new());
  282    284   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  283    285   
        ::pretty_assertions::assert_eq!(http_request.method(), "GET", "method was incorrect");
  284    286   
        ::pretty_assertions::assert_eq!(uri.path(), "/OmitsNullSerializesEmptyString", "path was incorrect");
  285    287   
    }
  286    288   
  287    289   
    /// Serializes empty query strings
  288    290   
    /// Test ID: RestJsonSerializesEmptyQueryValue
  289    291   
    #[::tokio::test]
  290    292   
    #[::tracing_test::traced_test]
  291    293   
    async fn rest_json_serializes_empty_query_value_request() {
  292    294   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  293    295   
        let config_builder = crate::config::Config::builder()
  294    296   
            .with_test_defaults()
  295         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         297  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         298  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         299  +
            .allow_no_auth()
  296    300   
            .endpoint_url("https://example.com");
  297    301   
  298    302   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  299    303   
        let result = client
  300    304   
            .omits_null_serializes_empty_string()
  301    305   
            .set_empty_string(::std::option::Option::Some("".to_owned()))
  302    306   
            .send()
  303    307   
            .await;
  304    308   
        let _ = dbg!(result);
  305    309   
        let http_request = request_receiver.expect_request();

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

@@ -278,278 +338,340 @@
  298    298   
mod omits_serializing_empty_lists_test {
  299    299   
  300    300   
    /// Supports omitting empty lists.
  301    301   
    /// Test ID: RestJsonOmitsEmptyListQueryValues
  302    302   
    #[::tokio::test]
  303    303   
    #[::tracing_test::traced_test]
  304    304   
    async fn rest_json_omits_empty_list_query_values_request() {
  305    305   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  306    306   
        let config_builder = crate::config::Config::builder()
  307    307   
            .with_test_defaults()
  308         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         308  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         309  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         310  +
            .allow_no_auth()
  309    311   
            .endpoint_url("https://example.com");
  310    312   
  311    313   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  312    314   
        let result = client
  313    315   
            .omits_serializing_empty_lists()
  314    316   
            .set_query_string_list(::std::option::Option::Some(vec![]))
  315    317   
            .set_query_integer_list(::std::option::Option::Some(vec![]))
  316    318   
            .set_query_double_list(::std::option::Option::Some(vec![]))
  317    319   
            .set_query_boolean_list(::std::option::Option::Some(vec![]))
  318    320   
            .set_query_timestamp_list(::std::option::Option::Some(vec![]))

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

@@ -226,226 +345,351 @@
  246    246   
  247    247   
    /// Client populates default values in input.
  248    248   
    /// Test ID: RestJsonClientPopulatesDefaultValuesInInput
  249    249   
    #[::tokio::test]
  250    250   
    #[::tracing_test::traced_test]
  251    251   
    #[should_panic]
  252    252   
    async fn rest_json_client_populates_default_values_in_input_request() {
  253    253   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  254    254   
        let config_builder = crate::config::Config::builder()
  255    255   
            .with_test_defaults()
  256         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         256  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         257  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         258  +
            .allow_no_auth()
  257    259   
            .endpoint_url("https://example.com");
  258    260   
  259    261   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  260    262   
        let result = client
  261    263   
            .operation_with_defaults()
  262    264   
            .set_defaults(::std::option::Option::Some(crate::types::Defaults::builder().build()))
  263    265   
            .send()
  264    266   
            .await;
  265    267   
        let _ = dbg!(result);
  266    268   
        let http_request = request_receiver.expect_request();
  267    269   
        let expected_headers = [("Content-Type", "application/json")];
  268    270   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
  269    271   
        let body = http_request.body().bytes().expect("body should be strict");
  270    272   
        ::aws_smithy_protocol_test::assert_ok(
  271    273   
        ::aws_smithy_protocol_test::validate_body(body, "{\n    \"defaults\": {\n        \"defaultString\": \"hi\",\n        \"defaultBoolean\": true,\n        \"defaultList\": [],\n        \"defaultDocumentMap\": {},\n        \"defaultDocumentString\": \"hi\",\n        \"defaultDocumentBoolean\": true,\n        \"defaultDocumentList\": [],\n        \"defaultTimestamp\": 0,\n        \"defaultBlob\": \"YWJj\",\n        \"defaultByte\": 1,\n        \"defaultShort\": 1,\n        \"defaultInteger\": 10,\n        \"defaultLong\": 100,\n        \"defaultFloat\": 1.0,\n        \"defaultDouble\": 1.0,\n        \"defaultMap\": {},\n        \"defaultEnum\": \"FOO\",\n        \"defaultIntEnum\": 1,\n        \"emptyString\": \"\",\n        \"falseBoolean\": false,\n        \"emptyBlob\": \"\",\n        \"zeroByte\": 0,\n        \"zeroShort\": 0,\n        \"zeroInteger\": 0,\n        \"zeroLong\": 0,\n        \"zeroFloat\": 0.0,\n        \"zeroDouble\": 0.0\n    }\n}", ::aws_smithy_protocol_test::MediaType::from("application/json"))
  272    274   
        );
  273    275   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  274    276   
        ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
  275    277   
        ::pretty_assertions::assert_eq!(uri.path(), "/OperationWithDefaults", "path was incorrect");
  276    278   
    }
  277    279   
  278    280   
    /// Client skips top level default values in input.
  279    281   
    /// Test ID: RestJsonClientSkipsTopLevelDefaultValuesInInput
  280    282   
    #[::tokio::test]
  281    283   
    #[::tracing_test::traced_test]
  282    284   
    async fn rest_json_client_skips_top_level_default_values_in_input_request() {
  283    285   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  284    286   
        let config_builder = crate::config::Config::builder()
  285    287   
            .with_test_defaults()
  286         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         288  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         289  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         290  +
            .allow_no_auth()
  287    291   
            .endpoint_url("https://example.com");
  288    292   
  289    293   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  290    294   
        let result = client.operation_with_defaults().send().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}",
  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(), "/OperationWithDefaults", "path was incorrect");
  304    308   
    }
  305    309   
  306    310   
    /// Client uses explicitly provided member values over defaults
  307    311   
    /// Test ID: RestJsonClientUsesExplicitlyProvidedMemberValuesOverDefaults
  308    312   
    #[::tokio::test]
  309    313   
    #[::tracing_test::traced_test]
  310    314   
    #[should_panic]
  311    315   
    async fn rest_json_client_uses_explicitly_provided_member_values_over_defaults_request() {
  312    316   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  313    317   
        let config_builder = crate::config::Config::builder()
  314    318   
            .with_test_defaults()
  315         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         319  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         320  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         321  +
            .allow_no_auth()
  316    322   
            .endpoint_url("https://example.com");
  317    323   
  318    324   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  319    325   
        let result = client
  320    326   
            .operation_with_defaults()
  321    327   
            .set_defaults(::std::option::Option::Some(
  322    328   
                crate::types::Defaults::builder()
  323    329   
                    .set_default_string(::std::option::Option::Some("bye".to_owned()))
  324    330   
                    .set_default_boolean(::std::option::Option::Some(true))
  325    331   
                    .set_default_list(::std::option::Option::Some(vec!["a".to_owned()]))
@@ -376,382 +469,479 @@
  396    402   
    }
  397    403   
  398    404   
    /// Any time a value is provided for a member in the top level of input, it is used, regardless of if its the default.
  399    405   
    /// Test ID: RestJsonClientUsesExplicitlyProvidedValuesInTopLevel
  400    406   
    #[::tokio::test]
  401    407   
    #[::tracing_test::traced_test]
  402    408   
    async fn rest_json_client_uses_explicitly_provided_values_in_top_level_request() {
  403    409   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  404    410   
        let config_builder = crate::config::Config::builder()
  405    411   
            .with_test_defaults()
  406         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         412  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         413  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         414  +
            .allow_no_auth()
  407    415   
            .endpoint_url("https://example.com");
  408    416   
  409    417   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  410    418   
        let result = client
  411    419   
            .operation_with_defaults()
  412    420   
            .set_top_level_default(::std::option::Option::Some("hi".to_owned()))
  413    421   
            .set_other_top_level_default(::std::option::Option::Some(0))
  414    422   
            .send()
  415    423   
            .await;
  416    424   
        let _ = dbg!(result);
  417    425   
        let http_request = request_receiver.expect_request();
  418    426   
        let expected_headers = [("Content-Type", "application/json")];
  419    427   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
  420    428   
        let body = http_request.body().bytes().expect("body should be strict");
  421    429   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
  422    430   
            body,
  423    431   
            "{\n    \"topLevelDefault\": \"hi\",\n    \"otherTopLevelDefault\": 0\n}",
  424    432   
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
  425    433   
        ));
  426    434   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  427    435   
        ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
  428    436   
        ::pretty_assertions::assert_eq!(uri.path(), "/OperationWithDefaults", "path was incorrect");
  429    437   
    }
  430    438   
  431    439   
    /// Typically, non top-level members would have defaults filled in, but if they have the clientOptional trait, the defaults should be ignored.
  432    440   
    /// Test ID: RestJsonClientIgnoresNonTopLevelDefaultsOnMembersWithClientOptional
  433    441   
    #[::tokio::test]
  434    442   
    #[::tracing_test::traced_test]
  435    443   
    async fn rest_json_client_ignores_non_top_level_defaults_on_members_with_client_optional_request() {
  436    444   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  437    445   
        let config_builder = crate::config::Config::builder()
  438    446   
            .with_test_defaults()
  439         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         447  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         448  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         449  +
            .allow_no_auth()
  440    450   
            .endpoint_url("https://example.com");
  441    451   
  442    452   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  443    453   
        let result = client
  444    454   
            .operation_with_defaults()
  445    455   
            .set_client_optional_defaults(::std::option::Option::Some(crate::types::ClientOptionalDefaults::builder().build()))
  446    456   
            .send()
  447    457   
            .await;
  448    458   
        let _ = dbg!(result);
  449    459   
        let http_request = request_receiver.expect_request();

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

@@ -224,224 +284,286 @@
  244    244   
mod operation_with_nested_structure_test {
  245    245   
  246    246   
    /// Client populates nested default values when missing.
  247    247   
    /// Test ID: RestJsonClientPopulatesNestedDefaultValuesWhenMissing
  248    248   
    #[::tokio::test]
  249    249   
    #[::tracing_test::traced_test]
  250    250   
    async fn rest_json_client_populates_nested_default_values_when_missing_request() {
  251    251   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  252    252   
        let config_builder = crate::config::Config::builder()
  253    253   
            .with_test_defaults()
  254         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         254  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         255  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         256  +
            .allow_no_auth()
  255    257   
            .endpoint_url("https://example.com");
  256    258   
  257    259   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  258    260   
        let result = client
  259    261   
            .operation_with_nested_structure()
  260    262   
            .set_top_level(::std::option::Option::Some(
  261    263   
                crate::types::TopLevel::builder()
  262    264   
                    .set_dialog(::std::option::Option::Some(
  263    265   
                        crate::types::Dialog::builder()
  264    266   
                            .set_language(::std::option::Option::Some("en".to_owned()))

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

@@ -222,222 +282,284 @@
  242    242   
mod post_player_action_test {
  243    243   
  244    244   
    /// Unit types in unions are serialized like normal structures in requests.
  245    245   
    /// Test ID: RestJsonInputUnionWithUnitMember
  246    246   
    #[::tokio::test]
  247    247   
    #[::tracing_test::traced_test]
  248    248   
    async fn rest_json_input_union_with_unit_member_request() {
  249    249   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  250    250   
        let config_builder = crate::config::Config::builder()
  251    251   
            .with_test_defaults()
  252         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         252  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         253  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         254  +
            .allow_no_auth()
  253    255   
            .endpoint_url("https://example.com");
  254    256   
  255    257   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  256    258   
        let result = client
  257    259   
            .post_player_action()
  258    260   
            .set_action(::std::option::Option::Some(crate::types::PlayerAction::Quit))
  259    261   
            .send()
  260    262   
            .await;
  261    263   
        let _ = dbg!(result);
  262    264   
        let http_request = request_receiver.expect_request();

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

@@ -224,224 +348,354 @@
  244    244   
mod post_union_with_json_name_test {
  245    245   
  246    246   
    /// Tests that jsonName works with union members.
  247    247   
    /// Test ID: PostUnionWithJsonNameRequest1
  248    248   
    #[::tokio::test]
  249    249   
    #[::tracing_test::traced_test]
  250    250   
    async fn post_union_with_json_name_request1_request() {
  251    251   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  252    252   
        let config_builder = crate::config::Config::builder()
  253    253   
            .with_test_defaults()
  254         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         254  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         255  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         256  +
            .allow_no_auth()
  255    257   
            .endpoint_url("https://example.com");
  256    258   
  257    259   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  258    260   
        let result = client
  259    261   
            .post_union_with_json_name()
  260    262   
            .set_value(::std::option::Option::Some(crate::types::UnionWithJsonName::Foo("hi".to_owned())))
  261    263   
            .send()
  262    264   
            .await;
  263    265   
        let _ = dbg!(result);
  264    266   
        let http_request = request_receiver.expect_request();
  265    267   
        let expected_headers = [("Content-Type", "application/json")];
  266    268   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
  267    269   
        let body = http_request.body().bytes().expect("body should be strict");
  268    270   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
  269    271   
            body,
  270    272   
            "{\n    \"value\": {\n        \"FOO\": \"hi\"\n    }\n}",
  271    273   
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
  272    274   
        ));
  273    275   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  274    276   
        ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
  275    277   
        ::pretty_assertions::assert_eq!(uri.path(), "/PostUnionWithJsonName", "path was incorrect");
  276    278   
    }
  277    279   
  278    280   
    /// Tests that jsonName works with union members.
  279    281   
    /// Test ID: PostUnionWithJsonNameRequest2
  280    282   
    #[::tokio::test]
  281    283   
    #[::tracing_test::traced_test]
  282    284   
    async fn post_union_with_json_name_request2_request() {
  283    285   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  284    286   
        let config_builder = crate::config::Config::builder()
  285    287   
            .with_test_defaults()
  286         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         288  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         289  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         290  +
            .allow_no_auth()
  287    291   
            .endpoint_url("https://example.com");
  288    292   
  289    293   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  290    294   
        let result = client
  291    295   
            .post_union_with_json_name()
  292    296   
            .set_value(::std::option::Option::Some(crate::types::UnionWithJsonName::Baz("hi".to_owned())))
  293    297   
            .send()
  294    298   
            .await;
  295    299   
        let _ = dbg!(result);
  296    300   
        let http_request = request_receiver.expect_request();
  297    301   
        let expected_headers = [("Content-Type", "application/json")];
  298    302   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
  299    303   
        let body = http_request.body().bytes().expect("body should be strict");
  300    304   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
  301    305   
            body,
  302    306   
            "{\n    \"value\": {\n        \"_baz\": \"hi\"\n    }\n}",
  303    307   
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
  304    308   
        ));
  305    309   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  306    310   
        ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
  307    311   
        ::pretty_assertions::assert_eq!(uri.path(), "/PostUnionWithJsonName", "path was incorrect");
  308    312   
    }
  309    313   
  310    314   
    /// Tests that jsonName works with union members.
  311    315   
    /// Test ID: PostUnionWithJsonNameRequest3
  312    316   
    #[::tokio::test]
  313    317   
    #[::tracing_test::traced_test]
  314    318   
    async fn post_union_with_json_name_request3_request() {
  315    319   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  316    320   
        let config_builder = crate::config::Config::builder()
  317    321   
            .with_test_defaults()
  318         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         322  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         323  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         324  +
            .allow_no_auth()
  319    325   
            .endpoint_url("https://example.com");
  320    326   
  321    327   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  322    328   
        let result = client
  323    329   
            .post_union_with_json_name()
  324    330   
            .set_value(::std::option::Option::Some(crate::types::UnionWithJsonName::Bar("hi".to_owned())))
  325    331   
            .send()
  326    332   
            .await;
  327    333   
        let _ = dbg!(result);
  328    334   
        let http_request = request_receiver.expect_request();

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

@@ -225,225 +316,320 @@
  245    245   
mod put_with_content_encoding_test {
  246    246   
  247    247   
    /// Compression algorithm encoding is appended to the Content-Encoding header.
  248    248   
    /// Test ID: SDKAppliedContentEncoding_restJson1
  249    249   
    #[::tokio::test]
  250    250   
    #[::tracing_test::traced_test]
  251    251   
    async fn sdk_applied_content_encoding_rest_json1_request() {
  252    252   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  253    253   
        let config_builder = crate::config::Config::builder()
  254    254   
            .with_test_defaults()
  255         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         255  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         256  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         257  +
            .allow_no_auth()
  256    258   
            .endpoint_url("https://example.com");
  257    259   
  258    260   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  259    261   
        let result = client.put_with_content_encoding()
  260    262   
        .set_data(
  261    263   
            ::std::option::Option::Some(
  262    264   
                "RjCEL3kBwqPivZUXGiyA5JCujtWgJAkKRlnTEsNYfBRGOS0f7LT6R3bCSOXeJ4auSHzQ4BEZZTklUyj5\n1HEojihShQC2jkQJrNdGOZNSW49yRO0XbnGmeczUHbZqZRelLFKW4xjru9uTuB8lFCtwoGgciFsgqTF8\n5HYcoqINTRxuAwGuRUMoNO473QT0BtCQoKUkAyVaypG0hBZdGNoJhunBfW0d3HWTYlzz9pXElyZhq3C1\n2PDB17GEoOYXmTxDecysmPOdo5z6T0HFhujfeJFIQQ8dirmXcG4F3v0bZdf6AZ3jsiVh6RnEXIPxPbOi\ngIXDWTMUr4Pg3f2LdYCM01eAb2qTdgsEN0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LoZE\nX5K2zQiNA163uMCl5xzaBqY4YTL0wgALg3IFdYSp0RFYLWdt6IxoGI1tnoxcjlUEPo5eGIc3mS3SmaLn\nOdumfUQQ4Jgmgaa5anUVQsfBDrlAN5oaX7O0JO71SSPSWiHBsT9WIPy2J1Cace9ZZLRxblFPSXcvsuHh\nhvnhWQltEDAe7MgvkFQ8lGVFa8jhzijoF9kLmMhMILSzYnfXnZPNP7TlAAwlLHK1RqlpHskJqb6CPpGP\nQvOAhEMsM3zJ2KejZx0esxkjxA0ZufVvGAMN3vTUMplQaF4RiQkp9fzBXf3CMk01dWjOMMIEXTeKzIQe\nEcffzjixWU9FpAyGp2rVl4ETRgqljOGw4UgK31r0ZIEGnH0xGz1FtbW1OcQM008JVujRqulCucEMmntr\n".to_owned()
  263    265   
            )
  264    266   
        )
  265    267   
        .send().await;
  266    268   
        let _ = dbg!(result);
  267    269   
        let http_request = request_receiver.expect_request();
  268    270   
        let expected_headers = [("Content-Encoding", "gzip")];
  269    271   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
  270    272   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  271    273   
        ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
  272    274   
        ::pretty_assertions::assert_eq!(uri.path(), "/requestcompression/putcontentwithencoding", "path was incorrect");
  273    275   
    }
  274    276   
  275    277   
    /// Compression algorithm encoding is appended to the Content-Encoding header, and the
  276    278   
    /// user-provided content-encoding is in the Content-Encoding header before the
  277    279   
    /// request compression encoding from the HTTP binding.
  278    280   
    ///
  279    281   
    /// Test ID: SDKAppendedGzipAfterProvidedEncoding_restJson1
  280    282   
    #[::tokio::test]
  281    283   
    #[::tracing_test::traced_test]
  282    284   
    async fn sdk_appended_gzip_after_provided_encoding_rest_json1_request() {
  283    285   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  284    286   
        let config_builder = crate::config::Config::builder()
  285    287   
            .with_test_defaults()
  286         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         288  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         289  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         290  +
            .allow_no_auth()
  287    291   
            .endpoint_url("https://example.com");
  288    292   
  289    293   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  290    294   
        let result = client.put_with_content_encoding()
  291    295   
        .set_encoding(
  292    296   
            ::std::option::Option::Some(
  293    297   
                "custom".to_owned()
  294    298   
            )
  295    299   
        )
  296    300   
        .set_data(

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

@@ -239,239 +324,328 @@
  259    259   
mod query_idempotency_token_auto_fill_test {
  260    260   
  261    261   
    /// Automatically adds idempotency token when not set
  262    262   
    /// Test ID: RestJsonQueryIdempotencyTokenAutoFill
  263    263   
    #[::tokio::test]
  264    264   
    #[::tracing_test::traced_test]
  265    265   
    async fn rest_json_query_idempotency_token_auto_fill_request() {
  266    266   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  267    267   
        let config_builder = crate::config::Config::builder()
  268    268   
            .with_test_defaults()
  269         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         269  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         270  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         271  +
            .allow_no_auth()
  270    272   
            .endpoint_url("https://example.com");
  271    273   
  272    274   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  273    275   
        let result = client.query_idempotency_token_auto_fill().send().await;
  274    276   
        let _ = dbg!(result);
  275    277   
        let http_request = request_receiver.expect_request();
  276    278   
        let expected_query_params = &["token=00000000-0000-4000-8000-000000000000"];
  277    279   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_query_string(&http_request, expected_query_params));
  278    280   
        let body = http_request.body().bytes().expect("body should be strict");
  279    281   
        // No body.
  280    282   
        ::pretty_assertions::assert_eq!(&body, &::bytes::Bytes::new());
  281    283   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  282    284   
        ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
  283    285   
        ::pretty_assertions::assert_eq!(uri.path(), "/QueryIdempotencyTokenAutoFill", "path was incorrect");
  284    286   
    }
  285    287   
  286    288   
    /// Uses the given idempotency token as-is
  287    289   
    /// Test ID: RestJsonQueryIdempotencyTokenAutoFillIsSet
  288    290   
    #[::tokio::test]
  289    291   
    #[::tracing_test::traced_test]
  290    292   
    async fn rest_json_query_idempotency_token_auto_fill_is_set_request() {
  291    293   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  292    294   
        let config_builder = crate::config::Config::builder()
  293    295   
            .with_test_defaults()
  294         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         296  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         297  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         298  +
            .allow_no_auth()
  295    299   
            .endpoint_url("https://example.com");
  296    300   
  297    301   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  298    302   
        let result = client
  299    303   
            .query_idempotency_token_auto_fill()
  300    304   
            .set_token(::std::option::Option::Some("00000000-0000-4000-8000-000000000000".to_owned()))
  301    305   
            .send()
  302    306   
            .await;
  303    307   
        let _ = dbg!(result);
  304    308   
        let http_request = request_receiver.expect_request();

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

@@ -243,243 +303,305 @@
  263    263   
mod query_params_as_string_list_map_test {
  264    264   
  265    265   
    /// Serialize query params from map of list strings
  266    266   
    /// Test ID: RestJsonQueryParamsStringListMap
  267    267   
    #[::tokio::test]
  268    268   
    #[::tracing_test::traced_test]
  269    269   
    async fn rest_json_query_params_string_list_map_request() {
  270    270   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  271    271   
        let config_builder = crate::config::Config::builder()
  272    272   
            .with_test_defaults()
  273         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         273  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         274  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         275  +
            .allow_no_auth()
  274    276   
            .endpoint_url("https://example.com");
  275    277   
  276    278   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  277    279   
        let result = client
  278    280   
            .query_params_as_string_list_map()
  279    281   
            .set_qux(::std::option::Option::Some("named".to_owned()))
  280    282   
            .set_foo(::std::option::Option::Some({
  281    283   
                let mut ret = ::std::collections::HashMap::new();
  282    284   
                ret.insert("baz".to_owned(), vec!["bar".to_owned(), "qux".to_owned()]);
  283    285   
                ret

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

@@ -241,241 +301,303 @@
  261    261   
mod query_precedence_test {
  262    262   
  263    263   
    /// Prefer named query parameters when serializing
  264    264   
    /// Test ID: RestJsonQueryPrecedence
  265    265   
    #[::tokio::test]
  266    266   
    #[::tracing_test::traced_test]
  267    267   
    async fn rest_json_query_precedence_request() {
  268    268   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  269    269   
        let config_builder = crate::config::Config::builder()
  270    270   
            .with_test_defaults()
  271         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         271  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         272  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         273  +
            .allow_no_auth()
  272    274   
            .endpoint_url("https://example.com");
  273    275   
  274    276   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  275    277   
        let result = client
  276    278   
            .query_precedence()
  277    279   
            .set_foo(::std::option::Option::Some("named".to_owned()))
  278    280   
            .set_baz(::std::option::Option::Some({
  279    281   
                let mut ret = ::std::collections::HashMap::new();
  280    282   
                ret.insert("bar".to_owned(), "fromMap".to_owned());
  281    283   
                ret.insert("qux".to_owned(), "alsoFromMap".to_owned());

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

@@ -222,222 +282,284 @@
  242    242   
mod recursive_shapes_test {
  243    243   
  244    244   
    /// Serializes recursive structures
  245    245   
    /// Test ID: RestJsonRecursiveShapes
  246    246   
    #[::tokio::test]
  247    247   
    #[::tracing_test::traced_test]
  248    248   
    async fn rest_json_recursive_shapes_request() {
  249    249   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  250    250   
        let config_builder = crate::config::Config::builder()
  251    251   
            .with_test_defaults()
  252         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         252  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         253  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         254  +
            .allow_no_auth()
  253    255   
            .endpoint_url("https://example.com");
  254    256   
  255    257   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  256    258   
        let result = client
  257    259   
            .recursive_shapes()
  258    260   
            .set_nested(::std::option::Option::Some(
  259    261   
                crate::types::RecursiveShapesInputOutputNested1::builder()
  260    262   
                    .set_foo(::std::option::Option::Some("Foo1".to_owned()))
  261    263   
                    .set_nested(::std::option::Option::Some(::std::boxed::Box::new(
  262    264   
                        crate::types::RecursiveShapesInputOutputNested2::builder()

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

@@ -226,226 +431,441 @@
  246    246   
    use ::aws_smithy_protocol_test::FloatEquals;
  247    247   
  248    248   
    /// Serializes simple scalar properties
  249    249   
    /// Test ID: RestJsonSimpleScalarProperties
  250    250   
    #[::tokio::test]
  251    251   
    #[::tracing_test::traced_test]
  252    252   
    async fn rest_json_simple_scalar_properties_request() {
  253    253   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  254    254   
        let config_builder = crate::config::Config::builder()
  255    255   
            .with_test_defaults()
  256         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         256  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         257  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         258  +
            .allow_no_auth()
  257    259   
            .endpoint_url("https://example.com");
  258    260   
  259    261   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  260    262   
        let result = client
  261    263   
            .simple_scalar_properties()
  262    264   
            .set_foo(::std::option::Option::Some("Foo".to_owned()))
  263    265   
            .set_string_value(::std::option::Option::Some("string".to_owned()))
  264    266   
            .set_true_boolean_value(::std::option::Option::Some(true))
  265    267   
            .set_false_boolean_value(::std::option::Option::Some(false))
  266    268   
            .set_byte_value(::std::option::Option::Some(1))
  267    269   
            .set_short_value(::std::option::Option::Some(2))
  268    270   
            .set_integer_value(::std::option::Option::Some(3))
  269    271   
            .set_long_value(::std::option::Option::Some(4))
  270    272   
            .set_float_value(::std::option::Option::Some(5.5_f32))
  271    273   
            .set_double_value(::std::option::Option::Some(6.5_f64))
  272    274   
            .send()
  273    275   
            .await;
  274    276   
        let _ = dbg!(result);
  275    277   
        let http_request = request_receiver.expect_request();
  276    278   
        let expected_headers = [("Content-Type", "application/json"), ("X-Foo", "Foo")];
  277    279   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
  278    280   
        let body = http_request.body().bytes().expect("body should be strict");
  279    281   
        ::aws_smithy_protocol_test::assert_ok(
  280    282   
        ::aws_smithy_protocol_test::validate_body(body, "{\n    \"stringValue\": \"string\",\n    \"trueBooleanValue\": true,\n    \"falseBooleanValue\": false,\n    \"byteValue\": 1,\n    \"shortValue\": 2,\n    \"integerValue\": 3,\n    \"longValue\": 4,\n    \"floatValue\": 5.5,\n    \"DoubleDribble\": 6.5\n}", ::aws_smithy_protocol_test::MediaType::from("application/json"))
  281    283   
        );
  282    284   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  283    285   
        ::pretty_assertions::assert_eq!(http_request.method(), "PUT", "method was incorrect");
  284    286   
        ::pretty_assertions::assert_eq!(uri.path(), "/SimpleScalarProperties", "path was incorrect");
  285    287   
    }
  286    288   
  287    289   
    /// Rest Json should not serialize null structure values
  288    290   
    /// Test ID: RestJsonDoesntSerializeNullStructureValues
  289    291   
    #[::tokio::test]
  290    292   
    #[::tracing_test::traced_test]
  291    293   
    async fn rest_json_doesnt_serialize_null_structure_values_request() {
  292    294   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  293    295   
        let config_builder = crate::config::Config::builder()
  294    296   
            .with_test_defaults()
  295         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         297  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         298  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         299  +
            .allow_no_auth()
  296    300   
            .endpoint_url("https://example.com");
  297    301   
  298    302   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  299    303   
        let result = client
  300    304   
            .simple_scalar_properties()
  301    305   
            .set_string_value(::std::option::Option::None)
  302    306   
            .send()
  303    307   
            .await;
  304    308   
        let _ = dbg!(result);
  305    309   
        let http_request = request_receiver.expect_request();
  306    310   
        let expected_headers = [("Content-Type", "application/json")];
  307    311   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
  308    312   
        let body = http_request.body().bytes().expect("body should be strict");
  309    313   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
  310    314   
            body,
  311    315   
            "{}",
  312    316   
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
  313    317   
        ));
  314    318   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  315    319   
        ::pretty_assertions::assert_eq!(http_request.method(), "PUT", "method was incorrect");
  316    320   
        ::pretty_assertions::assert_eq!(uri.path(), "/SimpleScalarProperties", "path was incorrect");
  317    321   
    }
  318    322   
  319    323   
    /// Supports handling NaN float values.
  320    324   
    /// Test ID: RestJsonSupportsNaNFloatInputs
  321    325   
    #[::tokio::test]
  322    326   
    #[::tracing_test::traced_test]
  323    327   
    async fn rest_json_supports_na_n_float_inputs_request() {
  324    328   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  325    329   
        let config_builder = crate::config::Config::builder()
  326    330   
            .with_test_defaults()
  327         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         331  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         332  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         333  +
            .allow_no_auth()
  328    334   
            .endpoint_url("https://example.com");
  329    335   
  330    336   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  331    337   
        let result = client
  332    338   
            .simple_scalar_properties()
  333    339   
            .set_float_value(::std::option::Option::Some(
  334    340   
                <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("NaN").expect("invalid string for number"),
  335    341   
            ))
  336    342   
            .set_double_value(::std::option::Option::Some(
  337    343   
                <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("NaN").expect("invalid string for number"),
  338    344   
            ))
  339    345   
            .send()
  340    346   
            .await;
  341    347   
        let _ = dbg!(result);
  342    348   
        let http_request = request_receiver.expect_request();
  343    349   
        let expected_headers = [("Content-Type", "application/json")];
  344    350   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
  345    351   
        let body = http_request.body().bytes().expect("body should be strict");
  346    352   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
  347    353   
            body,
  348    354   
            "{\n    \"floatValue\": \"NaN\",\n    \"DoubleDribble\": \"NaN\"\n}",
  349    355   
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
  350    356   
        ));
  351    357   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  352    358   
        ::pretty_assertions::assert_eq!(http_request.method(), "PUT", "method was incorrect");
  353    359   
        ::pretty_assertions::assert_eq!(uri.path(), "/SimpleScalarProperties", "path was incorrect");
  354    360   
    }
  355    361   
  356    362   
    /// Supports handling Infinity float values.
  357    363   
    /// Test ID: RestJsonSupportsInfinityFloatInputs
  358    364   
    #[::tokio::test]
  359    365   
    #[::tracing_test::traced_test]
  360    366   
    async fn rest_json_supports_infinity_float_inputs_request() {
  361    367   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  362    368   
        let config_builder = crate::config::Config::builder()
  363    369   
            .with_test_defaults()
  364         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         370  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         371  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         372  +
            .allow_no_auth()
  365    373   
            .endpoint_url("https://example.com");
  366    374   
  367    375   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  368    376   
        let result = client
  369    377   
            .simple_scalar_properties()
  370    378   
            .set_float_value(::std::option::Option::Some(
  371    379   
                <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("Infinity").expect("invalid string for number"),
  372    380   
            ))
  373    381   
            .set_double_value(::std::option::Option::Some(
  374    382   
                <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("Infinity").expect("invalid string for number"),
  375    383   
            ))
  376    384   
            .send()
  377    385   
            .await;
  378    386   
        let _ = dbg!(result);
  379    387   
        let http_request = request_receiver.expect_request();
  380    388   
        let expected_headers = [("Content-Type", "application/json")];
  381    389   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
  382    390   
        let body = http_request.body().bytes().expect("body should be strict");
  383    391   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
  384    392   
            body,
  385    393   
            "{\n    \"floatValue\": \"Infinity\",\n    \"DoubleDribble\": \"Infinity\"\n}",
  386    394   
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
  387    395   
        ));
  388    396   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  389    397   
        ::pretty_assertions::assert_eq!(http_request.method(), "PUT", "method was incorrect");
  390    398   
        ::pretty_assertions::assert_eq!(uri.path(), "/SimpleScalarProperties", "path was incorrect");
  391    399   
    }
  392    400   
  393    401   
    /// Supports handling -Infinity float values.
  394    402   
    /// Test ID: RestJsonSupportsNegativeInfinityFloatInputs
  395    403   
    #[::tokio::test]
  396    404   
    #[::tracing_test::traced_test]
  397    405   
    async fn rest_json_supports_negative_infinity_float_inputs_request() {
  398    406   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  399    407   
        let config_builder = crate::config::Config::builder()
  400    408   
            .with_test_defaults()
  401         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         409  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         410  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         411  +
            .allow_no_auth()
  402    412   
            .endpoint_url("https://example.com");
  403    413   
  404    414   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  405    415   
        let result = client
  406    416   
            .simple_scalar_properties()
  407    417   
            .set_float_value(::std::option::Option::Some(
  408    418   
                <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("-Infinity").expect("invalid string for number"),
  409    419   
            ))
  410    420   
            .set_double_value(::std::option::Option::Some(
  411    421   
                <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/sparse_json_lists.rs

@@ -222,222 +282,284 @@
  242    242   
mod sparse_json_lists_test {
  243    243   
  244    244   
    /// Serializes null values in sparse lists
  245    245   
    /// Test ID: RestJsonSparseListsSerializeNull
  246    246   
    #[::tokio::test]
  247    247   
    #[::tracing_test::traced_test]
  248    248   
    async fn rest_json_sparse_lists_serialize_null_request() {
  249    249   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  250    250   
        let config_builder = crate::config::Config::builder()
  251    251   
            .with_test_defaults()
  252         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         252  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         253  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         254  +
            .allow_no_auth()
  253    255   
            .endpoint_url("https://example.com");
  254    256   
  255    257   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  256    258   
        let result = client
  257    259   
            .sparse_json_lists()
  258    260   
            .set_sparse_string_list(::std::option::Option::Some(vec![
  259    261   
                ::std::option::Option::None,
  260    262   
                ::std::option::Option::Some("hi".to_owned()),
  261    263   
            ]))
  262    264   
            .set_sparse_short_list(::std::option::Option::Some(vec![

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

@@ -216,216 +452,462 @@
  236    236   
mod sparse_json_maps_test {
  237    237   
  238    238   
    /// Serializes JSON maps
  239    239   
    /// Test ID: RestJsonSparseJsonMaps
  240    240   
    #[::tokio::test]
  241    241   
    #[::tracing_test::traced_test]
  242    242   
    async fn rest_json_sparse_json_maps_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   
            .sparse_json_maps()
  252    254   
            .set_sparse_struct_map(::std::option::Option::Some({
  253    255   
                let mut ret = ::std::collections::HashMap::new();
  254    256   
                ret.insert(
  255    257   
                    "foo".to_owned(),
  256    258   
                    ::std::option::Option::Some(
  257    259   
                        crate::types::GreetingStruct::builder()
  258    260   
                            .set_hi(::std::option::Option::Some("there".to_owned()))
  259    261   
                            .build(),
  260    262   
                    ),
  261    263   
                );
  262    264   
                ret.insert(
  263    265   
                    "baz".to_owned(),
  264    266   
                    ::std::option::Option::Some(
  265    267   
                        crate::types::GreetingStruct::builder()
  266    268   
                            .set_hi(::std::option::Option::Some("bye".to_owned()))
  267    269   
                            .build(),
  268    270   
                    ),
  269    271   
                );
  270    272   
                ret
  271    273   
            }))
  272    274   
            .send()
  273    275   
            .await;
  274    276   
        let _ = dbg!(result);
  275    277   
        let http_request = request_receiver.expect_request();
  276    278   
        let expected_headers = [("Content-Type", "application/json")];
  277    279   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
  278    280   
        let body = http_request.body().bytes().expect("body should be strict");
  279    281   
        ::aws_smithy_protocol_test::assert_ok(
  280    282   
        ::aws_smithy_protocol_test::validate_body(body, "{\n    \"sparseStructMap\": {\n        \"foo\": {\n            \"hi\": \"there\"\n        },\n        \"baz\": {\n            \"hi\": \"bye\"\n        }\n    }\n}", ::aws_smithy_protocol_test::MediaType::from("application/json"))
  281    283   
        );
  282    284   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  283    285   
        ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
  284    286   
        ::pretty_assertions::assert_eq!(uri.path(), "/SparseJsonMaps", "path was incorrect");
  285    287   
    }
  286    288   
  287    289   
    /// Serializes JSON map values in sparse maps
  288    290   
    /// Test ID: RestJsonSerializesSparseNullMapValues
  289    291   
    #[::tokio::test]
  290    292   
    #[::tracing_test::traced_test]
  291    293   
    async fn rest_json_serializes_sparse_null_map_values_request() {
  292    294   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  293    295   
        let config_builder = crate::config::Config::builder()
  294    296   
            .with_test_defaults()
  295         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         297  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         298  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         299  +
            .allow_no_auth()
  296    300   
            .endpoint_url("https://example.com");
  297    301   
  298    302   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  299    303   
        let result = client
  300    304   
            .sparse_json_maps()
  301    305   
            .set_sparse_boolean_map(::std::option::Option::Some({
  302    306   
                let mut ret = ::std::collections::HashMap::new();
  303    307   
                ret.insert("x".to_owned(), ::std::option::Option::None);
  304    308   
                ret
  305    309   
            }))
  306    310   
            .set_sparse_number_map(::std::option::Option::Some({
  307    311   
                let mut ret = ::std::collections::HashMap::new();
  308    312   
                ret.insert("x".to_owned(), ::std::option::Option::None);
  309    313   
                ret
  310    314   
            }))
  311    315   
            .set_sparse_string_map(::std::option::Option::Some({
  312    316   
                let mut ret = ::std::collections::HashMap::new();
  313    317   
                ret.insert("x".to_owned(), ::std::option::Option::None);
  314    318   
                ret
  315    319   
            }))
  316    320   
            .set_sparse_struct_map(::std::option::Option::Some({
  317    321   
                let mut ret = ::std::collections::HashMap::new();
  318    322   
                ret.insert("x".to_owned(), ::std::option::Option::None);
  319    323   
                ret
  320    324   
            }))
  321    325   
            .send()
  322    326   
            .await;
  323    327   
        let _ = dbg!(result);
  324    328   
        let http_request = request_receiver.expect_request();
  325    329   
        let expected_headers = [("Content-Type", "application/json")];
  326    330   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
  327    331   
        let body = http_request.body().bytes().expect("body should be strict");
  328    332   
        ::aws_smithy_protocol_test::assert_ok(
  329    333   
        ::aws_smithy_protocol_test::validate_body(body, "{\n    \"sparseBooleanMap\": {\n        \"x\": null\n    },\n    \"sparseNumberMap\": {\n        \"x\": null\n    },\n    \"sparseStringMap\": {\n        \"x\": null\n    },\n    \"sparseStructMap\": {\n        \"x\": null\n    }\n}", ::aws_smithy_protocol_test::MediaType::from("application/json"))
  330    334   
        );
  331    335   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  332    336   
        ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
  333    337   
        ::pretty_assertions::assert_eq!(uri.path(), "/SparseJsonMaps", "path was incorrect");
  334    338   
    }
  335    339   
  336    340   
    /// Ensure that 0 and false are sent over the wire in all maps and lists
  337    341   
    /// Test ID: RestJsonSerializesZeroValuesInSparseMaps
  338    342   
    #[::tokio::test]
  339    343   
    #[::tracing_test::traced_test]
  340    344   
    async fn rest_json_serializes_zero_values_in_sparse_maps_request() {
  341    345   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  342    346   
        let config_builder = crate::config::Config::builder()
  343    347   
            .with_test_defaults()
  344         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         348  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         349  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         350  +
            .allow_no_auth()
  345    351   
            .endpoint_url("https://example.com");
  346    352   
  347    353   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  348    354   
        let result = client
  349    355   
            .sparse_json_maps()
  350    356   
            .set_sparse_number_map(::std::option::Option::Some({
  351    357   
                let mut ret = ::std::collections::HashMap::new();
  352    358   
                ret.insert("x".to_owned(), ::std::option::Option::Some(0));
  353    359   
                ret
  354    360   
            }))
  355    361   
            .set_sparse_boolean_map(::std::option::Option::Some({
  356    362   
                let mut ret = ::std::collections::HashMap::new();
  357    363   
                ret.insert("x".to_owned(), ::std::option::Option::Some(false));
  358    364   
                ret
  359    365   
            }))
  360    366   
            .send()
  361    367   
            .await;
  362    368   
        let _ = dbg!(result);
  363    369   
        let http_request = request_receiver.expect_request();
  364    370   
        let expected_headers = [("Content-Type", "application/json")];
  365    371   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
  366    372   
        let body = http_request.body().bytes().expect("body should be strict");
  367    373   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
  368    374   
            body,
  369    375   
            "{\n    \"sparseNumberMap\": {\n        \"x\": 0\n    },\n    \"sparseBooleanMap\": {\n        \"x\": false\n    }\n}",
  370    376   
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
  371    377   
        ));
  372    378   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  373    379   
        ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
  374    380   
        ::pretty_assertions::assert_eq!(uri.path(), "/SparseJsonMaps", "path was incorrect");
  375    381   
    }
  376    382   
  377    383   
    /// A request that contains a sparse map of sets
  378    384   
    /// Test ID: RestJsonSerializesSparseSetMap
  379    385   
    #[::tokio::test]
  380    386   
    #[::tracing_test::traced_test]
  381    387   
    async fn rest_json_serializes_sparse_set_map_request() {
  382    388   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  383    389   
        let config_builder = crate::config::Config::builder()
  384    390   
            .with_test_defaults()
  385         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         391  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         392  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         393  +
            .allow_no_auth()
  386    394   
            .endpoint_url("https://example.com");
  387    395   
  388    396   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  389    397   
        let result = client
  390    398   
            .sparse_json_maps()
  391    399   
            .set_sparse_set_map(::std::option::Option::Some({
  392    400   
                let mut ret = ::std::collections::HashMap::new();
  393    401   
                ret.insert("x".to_owned(), ::std::option::Option::Some(vec![]));
  394    402   
                ret.insert("y".to_owned(), ::std::option::Option::Some(vec!["a".to_owned(), "b".to_owned()]));
  395    403   
                ret
  396    404   
            }))
  397    405   
            .send()
  398    406   
            .await;
  399    407   
        let _ = dbg!(result);
  400    408   
        let http_request = request_receiver.expect_request();
  401    409   
        let expected_headers = [("Content-Type", "application/json")];
  402    410   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
  403    411   
        let body = http_request.body().bytes().expect("body should be strict");
  404    412   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
  405    413   
            body,
  406    414   
            "{\n    \"sparseSetMap\": {\n        \"x\": [],\n        \"y\": [\"a\", \"b\"]\n    }\n}",
  407    415   
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
  408    416   
        ));
  409    417   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  410    418   
        ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
  411    419   
        ::pretty_assertions::assert_eq!(uri.path(), "/SparseJsonMaps", "path was incorrect");
  412    420   
    }
  413    421   
  414    422   
    /// A request that contains a sparse map of sets.
  415    423   
    /// Test ID: RestJsonSerializesSparseSetMapAndRetainsNull
  416    424   
    #[::tokio::test]
  417    425   
    #[::tracing_test::traced_test]
  418    426   
    async fn rest_json_serializes_sparse_set_map_and_retains_null_request() {
  419    427   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  420    428   
        let config_builder = crate::config::Config::builder()
  421    429   
            .with_test_defaults()
  422         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         430  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         431  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         432  +
            .allow_no_auth()
  423    433   
            .endpoint_url("https://example.com");
  424    434   
  425    435   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  426    436   
        let result = client
  427    437   
            .sparse_json_maps()
  428    438   
            .set_sparse_set_map(::std::option::Option::Some({
  429    439   
                let mut ret = ::std::collections::HashMap::new();
  430    440   
                ret.insert("x".to_owned(), ::std::option::Option::Some(vec![]));
  431    441   
                ret.insert("y".to_owned(), ::std::option::Option::Some(vec!["a".to_owned(), "b".to_owned()]));
  432    442   
                ret.insert("z".to_owned(), ::std::option::Option::None);

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

@@ -234,234 +329,333 @@
  254    254   
mod streaming_traits_test {
  255    255   
  256    256   
    /// Serializes a blob in the HTTP payload
  257    257   
    /// Test ID: RestJsonStreamingTraitsWithBlob
  258    258   
    #[::tokio::test]
  259    259   
    #[::tracing_test::traced_test]
  260    260   
    async fn rest_json_streaming_traits_with_blob_request() {
  261    261   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  262    262   
        let config_builder = crate::config::Config::builder()
  263    263   
            .with_test_defaults()
  264         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         264  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         265  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         266  +
            .allow_no_auth()
  265    267   
            .endpoint_url("https://example.com");
  266    268   
  267    269   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  268    270   
        let result = client
  269    271   
            .streaming_traits()
  270    272   
            .set_foo(::std::option::Option::Some("Foo".to_owned()))
  271    273   
            .set_blob(::std::option::Option::Some(::aws_smithy_types::byte_stream::ByteStream::from_static(
  272    274   
                b"blobby blob blob",
  273    275   
            )))
  274    276   
            .send()
  275    277   
            .await;
  276    278   
        let _ = dbg!(result);
  277    279   
        let http_request = request_receiver.expect_request();
  278    280   
        let expected_headers = [("Content-Type", "application/octet-stream"), ("X-Foo", "Foo")];
  279    281   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
  280    282   
        let body = http_request.body().bytes().expect("body should be strict");
  281    283   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
  282    284   
            body,
  283    285   
            "blobby blob blob",
  284    286   
            ::aws_smithy_protocol_test::MediaType::from("application/octet-stream"),
  285    287   
        ));
  286    288   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  287    289   
        ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
  288    290   
        ::pretty_assertions::assert_eq!(uri.path(), "/StreamingTraits", "path was incorrect");
  289    291   
    }
  290    292   
  291    293   
    /// Serializes an empty blob in the HTTP payload
  292    294   
    /// Test ID: RestJsonStreamingTraitsWithNoBlobBody
  293    295   
    #[::tokio::test]
  294    296   
    #[::tracing_test::traced_test]
  295    297   
    async fn rest_json_streaming_traits_with_no_blob_body_request() {
  296    298   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  297    299   
        let config_builder = crate::config::Config::builder()
  298    300   
            .with_test_defaults()
  299         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         301  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         302  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         303  +
            .allow_no_auth()
  300    304   
            .endpoint_url("https://example.com");
  301    305   
  302    306   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  303    307   
        let result = client
  304    308   
            .streaming_traits()
  305    309   
            .set_foo(::std::option::Option::Some("Foo".to_owned()))
  306    310   
            .send()
  307    311   
            .await;
  308    312   
        let _ = dbg!(result);
  309    313   
        let http_request = request_receiver.expect_request();