Server Test

Server Test

rev. d06a46cae0f385cdae37a9f8264db3469a090ab5

Files changed:

tmp-codegen-diff/codegen-server-test/rpcv2Cbor-http0x/rust-server-codegen/src/protocol_serde.rs

@@ -0,1 +0,118 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub(crate) mod shape_empty_input_output;
           3  +
           4  +
pub(crate) mod shape_float16;
           5  +
           6  +
pub(crate) mod shape_fractional_seconds;
           7  +
           8  +
pub(crate) mod shape_greeting_with_errors;
           9  +
          10  +
pub(crate) mod shape_no_input_output;
          11  +
          12  +
pub(crate) mod shape_operation_with_defaults;
          13  +
          14  +
pub(crate) mod shape_optional_input_output;
          15  +
          16  +
pub(crate) mod shape_recursive_shapes;
          17  +
          18  +
pub(crate) mod shape_rpc_v2_cbor_dense_maps;
          19  +
          20  +
pub(crate) mod shape_rpc_v2_cbor_lists;
          21  +
          22  +
pub(crate) mod shape_rpc_v2_cbor_sparse_maps;
          23  +
          24  +
pub(crate) mod shape_simple_scalar_properties;
          25  +
          26  +
pub(crate) mod shape_sparse_nulls_operation;
          27  +
          28  +
pub(crate) mod shape_complex_error;
          29  +
          30  +
pub(crate) mod shape_empty_input_output_output;
          31  +
          32  +
pub(crate) mod shape_float16_output;
          33  +
          34  +
pub(crate) mod shape_fractional_seconds_output;
          35  +
          36  +
pub(crate) mod shape_greeting_with_errors_output;
          37  +
          38  +
pub(crate) mod shape_invalid_greeting;
          39  +
          40  +
pub(crate) mod shape_operation_with_defaults_output;
          41  +
          42  +
pub(crate) mod shape_optional_input_output_output;
          43  +
          44  +
pub(crate) mod shape_recursive_shapes_output;
          45  +
          46  +
pub(crate) mod shape_rpc_v2_cbor_dense_maps_output;
          47  +
          48  +
pub(crate) mod shape_rpc_v2_cbor_lists_output;
          49  +
          50  +
pub(crate) mod shape_rpc_v2_cbor_sparse_maps_output;
          51  +
          52  +
pub(crate) mod shape_simple_scalar_properties_output;
          53  +
          54  +
pub(crate) mod shape_sparse_nulls_operation_output;
          55  +
          56  +
pub(crate) mod shape_validation_exception;
          57  +
          58  +
pub(crate) mod shape_blob_list;
          59  +
          60  +
pub(crate) mod shape_boolean_list;
          61  +
          62  +
pub(crate) mod shape_client_optional_defaults;
          63  +
          64  +
pub(crate) mod shape_defaults;
          65  +
          66  +
pub(crate) mod shape_dense_boolean_map;
          67  +
          68  +
pub(crate) mod shape_dense_number_map;
          69  +
          70  +
pub(crate) mod shape_dense_set_map;
          71  +
          72  +
pub(crate) mod shape_dense_string_map;
          73  +
          74  +
pub(crate) mod shape_dense_struct_map;
          75  +
          76  +
pub(crate) mod shape_foo_enum_list;
          77  +
          78  +
pub(crate) mod shape_integer_enum_list;
          79  +
          80  +
pub(crate) mod shape_integer_list;
          81  +
          82  +
pub(crate) mod shape_nested_string_list;
          83  +
          84  +
pub(crate) mod shape_recursive_shapes_input_output_nested1;
          85  +
          86  +
pub(crate) mod shape_sparse_boolean_map;
          87  +
          88  +
pub(crate) mod shape_sparse_number_map;
          89  +
          90  +
pub(crate) mod shape_sparse_set_map;
          91  +
          92  +
pub(crate) mod shape_sparse_string_list;
          93  +
          94  +
pub(crate) mod shape_sparse_string_map;
          95  +
          96  +
pub(crate) mod shape_sparse_struct_map;
          97  +
          98  +
pub(crate) mod shape_string_list;
          99  +
         100  +
pub(crate) mod shape_string_set;
         101  +
         102  +
pub(crate) mod shape_structure_list;
         103  +
         104  +
pub(crate) mod shape_timestamp_list;
         105  +
         106  +
pub(crate) mod shape_complex_nested_error_data;
         107  +
         108  +
pub(crate) mod shape_greeting_struct;
         109  +
         110  +
pub(crate) mod shape_recursive_shapes_input_output_nested2;
         111  +
         112  +
pub(crate) mod shape_structure_list_member;
         113  +
         114  +
pub(crate) mod shape_test_string_list;
         115  +
         116  +
pub(crate) mod shape_test_string_map;
         117  +
         118  +
pub(crate) mod shape_validation_exception_field;

tmp-codegen-diff/codegen-server-test/rpcv2Cbor-http0x/rust-server-codegen/src/protocol_serde/shape_blob_list.rs

@@ -0,1 +0,52 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub(crate) fn de_blob_list(
           3  +
    decoder: &mut ::aws_smithy_cbor::Decoder,
           4  +
) -> ::std::result::Result<
           5  +
    ::std::vec::Vec<::aws_smithy_types::Blob>,
           6  +
    ::aws_smithy_cbor::decode::DeserializeError,
           7  +
> {
           8  +
    fn member(
           9  +
        mut list: ::std::vec::Vec<::aws_smithy_types::Blob>,
          10  +
        decoder: &mut ::aws_smithy_cbor::Decoder,
          11  +
    ) -> ::std::result::Result<
          12  +
        ::std::vec::Vec<::aws_smithy_types::Blob>,
          13  +
        ::aws_smithy_cbor::decode::DeserializeError,
          14  +
    > {
          15  +
        let value = match decoder.datatype()? {
          16  +
            ::aws_smithy_cbor::data::Type::Null => {
          17  +
                return ::std::result::Result::Err(
          18  +
                    ::aws_smithy_cbor::decode::DeserializeError::custom(
          19  +
                        "dense list cannot contain null values",
          20  +
                        decoder.position(),
          21  +
                    ),
          22  +
                )
          23  +
            }
          24  +
            _ => decoder.blob()?,
          25  +
        };
          26  +
        list.push(value);
          27  +
        Ok(list)
          28  +
    }
          29  +
          30  +
    let mut list = ::std::vec::Vec::new();
          31  +
          32  +
    match decoder.list()? {
          33  +
        None => loop {
          34  +
            match decoder.datatype()? {
          35  +
                ::aws_smithy_cbor::data::Type::Break => {
          36  +
                    decoder.skip()?;
          37  +
                    break;
          38  +
                }
          39  +
                _ => {
          40  +
                    list = member(list, decoder)?;
          41  +
                }
          42  +
            };
          43  +
        },
          44  +
        Some(n) => {
          45  +
            for _ in 0..n {
          46  +
                list = member(list, decoder)?;
          47  +
            }
          48  +
        }
          49  +
    };
          50  +
          51  +
    Ok(list)
          52  +
}

tmp-codegen-diff/codegen-server-test/rpcv2Cbor-http0x/rust-server-codegen/src/protocol_serde/shape_boolean_list.rs

@@ -0,1 +0,47 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub(crate) fn de_boolean_list(
           3  +
    decoder: &mut ::aws_smithy_cbor::Decoder,
           4  +
) -> ::std::result::Result<::std::vec::Vec<bool>, ::aws_smithy_cbor::decode::DeserializeError> {
           5  +
    fn member(
           6  +
        mut list: ::std::vec::Vec<bool>,
           7  +
        decoder: &mut ::aws_smithy_cbor::Decoder,
           8  +
    ) -> ::std::result::Result<::std::vec::Vec<bool>, ::aws_smithy_cbor::decode::DeserializeError>
           9  +
    {
          10  +
        let value = match decoder.datatype()? {
          11  +
            ::aws_smithy_cbor::data::Type::Null => {
          12  +
                return ::std::result::Result::Err(
          13  +
                    ::aws_smithy_cbor::decode::DeserializeError::custom(
          14  +
                        "dense list cannot contain null values",
          15  +
                        decoder.position(),
          16  +
                    ),
          17  +
                )
          18  +
            }
          19  +
            _ => decoder.boolean()?,
          20  +
        };
          21  +
        list.push(value);
          22  +
        Ok(list)
          23  +
    }
          24  +
          25  +
    let mut list = ::std::vec::Vec::new();
          26  +
          27  +
    match decoder.list()? {
          28  +
        None => loop {
          29  +
            match decoder.datatype()? {
          30  +
                ::aws_smithy_cbor::data::Type::Break => {
          31  +
                    decoder.skip()?;
          32  +
                    break;
          33  +
                }
          34  +
                _ => {
          35  +
                    list = member(list, decoder)?;
          36  +
                }
          37  +
            };
          38  +
        },
          39  +
        Some(n) => {
          40  +
            for _ in 0..n {
          41  +
                list = member(list, decoder)?;
          42  +
            }
          43  +
        }
          44  +
    };
          45  +
          46  +
    Ok(list)
          47  +
}

tmp-codegen-diff/codegen-server-test/rpcv2Cbor-http0x/rust-server-codegen/src/protocol_serde/shape_client_optional_defaults.rs

@@ -0,1 +0,54 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub(crate) fn de_client_optional_defaults(
           3  +
    decoder: &mut ::aws_smithy_cbor::Decoder,
           4  +
) -> ::std::result::Result<
           5  +
    crate::model::ClientOptionalDefaults,
           6  +
    ::aws_smithy_cbor::decode::DeserializeError,
           7  +
> {
           8  +
    #[allow(clippy::match_single_binding)]
           9  +
    fn pair(
          10  +
        mut builder: crate::model::client_optional_defaults::Builder,
          11  +
        decoder: &mut ::aws_smithy_cbor::Decoder,
          12  +
    ) -> ::std::result::Result<
          13  +
        crate::model::client_optional_defaults::Builder,
          14  +
        ::aws_smithy_cbor::decode::DeserializeError,
          15  +
    > {
          16  +
        builder = match decoder.str()?.as_ref() {
          17  +
            "member" => {
          18  +
                ::aws_smithy_cbor::decode::set_optional(builder, decoder, |builder, decoder| {
          19  +
                    Ok(builder.set_member(decoder.integer()?))
          20  +
                })?
          21  +
            }
          22  +
            _ => {
          23  +
                decoder.skip()?;
          24  +
                builder
          25  +
            }
          26  +
        };
          27  +
        Ok(builder)
          28  +
    }
          29  +
          30  +
    let mut builder = crate::model::client_optional_defaults::Builder::default();
          31  +
          32  +
    match decoder.map()? {
          33  +
        None => loop {
          34  +
            match decoder.datatype()? {
          35  +
                ::aws_smithy_cbor::data::Type::Break => {
          36  +
                    decoder.skip()?;
          37  +
                    break;
          38  +
                }
          39  +
                _ => {
          40  +
                    builder = pair(builder, decoder)?;
          41  +
                }
          42  +
            };
          43  +
        },
          44  +
        Some(n) => {
          45  +
            for _ in 0..n {
          46  +
                builder = pair(builder, decoder)?;
          47  +
            }
          48  +
        }
          49  +
    };
          50  +
    #[allow(clippy::needless_question_mark)]
          51  +
    {
          52  +
        return Ok(builder.build());
          53  +
    }
          54  +
}

tmp-codegen-diff/codegen-server-test/rpcv2Cbor-http0x/rust-server-codegen/src/protocol_serde/shape_complex_error.rs

@@ -0,1 +0,35 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub fn ser_complex_error_error(
           3  +
    value: &crate::error::ComplexError,
           4  +
) -> ::std::result::Result<
           5  +
    ::std::vec::Vec<u8>,
           6  +
    ::aws_smithy_types::error::operation::SerializationError,
           7  +
> {
           8  +
    let mut encoder = ::aws_smithy_cbor::Encoder::new(::std::vec::Vec::new());
           9  +
    {
          10  +
        let encoder = &mut encoder;
          11  +
        crate::protocol_serde::shape_complex_error::ser_complex_error(encoder, value)?;
          12  +
    }
          13  +
    ::std::result::Result::Ok(encoder.into_writer())
          14  +
}
          15  +
          16  +
pub fn ser_complex_error(
          17  +
    encoder: &mut ::aws_smithy_cbor::Encoder,
          18  +
    #[allow(unused)] input: &crate::error::ComplexError,
          19  +
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          20  +
    encoder.begin_map();
          21  +
    encoder
          22  +
        .str("__type")
          23  +
        .str("smithy.protocoltests.rpcv2Cbor#ComplexError");
          24  +
    if let Some(var_1) = &input.top_level {
          25  +
        encoder.str("TopLevel").str(var_1.as_str());
          26  +
    }
          27  +
    if let Some(var_2) = &input.nested {
          28  +
        encoder.str("Nested");
          29  +
        crate::protocol_serde::shape_complex_nested_error_data::ser_complex_nested_error_data(
          30  +
            encoder, var_2,
          31  +
        )?;
          32  +
    }
          33  +
    encoder.end();
          34  +
    Ok(())
          35  +
}

tmp-codegen-diff/codegen-server-test/rpcv2Cbor-http0x/rust-server-codegen/src/protocol_serde/shape_complex_nested_error_data.rs

@@ -0,1 +0,12 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub fn ser_complex_nested_error_data(
           3  +
    encoder: &mut ::aws_smithy_cbor::Encoder,
           4  +
    #[allow(unused)] input: &crate::model::ComplexNestedErrorData,
           5  +
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
           6  +
    encoder.begin_map();
           7  +
    if let Some(var_1) = &input.foo {
           8  +
        encoder.str("Foo").str(var_1.as_str());
           9  +
    }
          10  +
    encoder.end();
          11  +
    Ok(())
          12  +
}

tmp-codegen-diff/codegen-server-test/rpcv2Cbor-http0x/rust-server-codegen/src/protocol_serde/shape_defaults.rs

@@ -0,1 +0,167 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub(crate) fn de_defaults(
           3  +
    decoder: &mut ::aws_smithy_cbor::Decoder,
           4  +
) -> ::std::result::Result<
           5  +
    crate::model::defaults::Builder,
           6  +
    ::aws_smithy_cbor::decode::DeserializeError,
           7  +
> {
           8  +
    #[allow(clippy::match_single_binding)]
           9  +
    fn pair(
          10  +
        mut builder: crate::model::defaults::Builder,
          11  +
        decoder: &mut ::aws_smithy_cbor::Decoder,
          12  +
    ) -> ::std::result::Result<
          13  +
        crate::model::defaults::Builder,
          14  +
        ::aws_smithy_cbor::decode::DeserializeError,
          15  +
    > {
          16  +
        builder = match decoder.str()?.as_ref() {
          17  +
            "defaultString" => {
          18  +
                ::aws_smithy_cbor::decode::set_optional(builder, decoder, |builder, decoder| {
          19  +
                    Ok(builder.set_default_string(decoder.string()?))
          20  +
                })?
          21  +
            }
          22  +
            "defaultBoolean" => {
          23  +
                ::aws_smithy_cbor::decode::set_optional(builder, decoder, |builder, decoder| {
          24  +
                    Ok(builder.set_default_boolean(decoder.boolean()?))
          25  +
                })?
          26  +
            }
          27  +
            "defaultList" => {
          28  +
                ::aws_smithy_cbor::decode::set_optional(builder, decoder, |builder, decoder| {
          29  +
                    Ok(builder.set_default_list(
          30  +
                        crate::protocol_serde::shape_test_string_list::de_test_string_list(
          31  +
                            decoder,
          32  +
                        )?,
          33  +
                    ))
          34  +
                })?
          35  +
            }
          36  +
            "defaultTimestamp" => {
          37  +
                ::aws_smithy_cbor::decode::set_optional(builder, decoder, |builder, decoder| {
          38  +
                    Ok(builder.set_default_timestamp(decoder.timestamp()?))
          39  +
                })?
          40  +
            }
          41  +
            "defaultBlob" => {
          42  +
                ::aws_smithy_cbor::decode::set_optional(builder, decoder, |builder, decoder| {
          43  +
                    Ok(builder.set_default_blob(decoder.blob()?))
          44  +
                })?
          45  +
            }
          46  +
            "defaultByte" => {
          47  +
                ::aws_smithy_cbor::decode::set_optional(builder, decoder, |builder, decoder| {
          48  +
                    Ok(builder.set_default_byte(decoder.byte()?))
          49  +
                })?
          50  +
            }
          51  +
            "defaultShort" => {
          52  +
                ::aws_smithy_cbor::decode::set_optional(builder, decoder, |builder, decoder| {
          53  +
                    Ok(builder.set_default_short(decoder.short()?))
          54  +
                })?
          55  +
            }
          56  +
            "defaultInteger" => {
          57  +
                ::aws_smithy_cbor::decode::set_optional(builder, decoder, |builder, decoder| {
          58  +
                    Ok(builder.set_default_integer(decoder.integer()?))
          59  +
                })?
          60  +
            }
          61  +
            "defaultLong" => {
          62  +
                ::aws_smithy_cbor::decode::set_optional(builder, decoder, |builder, decoder| {
          63  +
                    Ok(builder.set_default_long(decoder.long()?))
          64  +
                })?
          65  +
            }
          66  +
            "defaultFloat" => {
          67  +
                ::aws_smithy_cbor::decode::set_optional(builder, decoder, |builder, decoder| {
          68  +
                    Ok(builder.set_default_float(decoder.float()?))
          69  +
                })?
          70  +
            }
          71  +
            "defaultDouble" => {
          72  +
                ::aws_smithy_cbor::decode::set_optional(builder, decoder, |builder, decoder| {
          73  +
                    Ok(builder.set_default_double(decoder.double()?))
          74  +
                })?
          75  +
            }
          76  +
            "defaultMap" => {
          77  +
                ::aws_smithy_cbor::decode::set_optional(builder, decoder, |builder, decoder| {
          78  +
                    Ok(builder.set_default_map(
          79  +
                        crate::protocol_serde::shape_test_string_map::de_test_string_map(decoder)?,
          80  +
                    ))
          81  +
                })?
          82  +
            }
          83  +
            "defaultEnum" => {
          84  +
                ::aws_smithy_cbor::decode::set_optional(builder, decoder, |builder, decoder| {
          85  +
                    Ok(builder.set_default_enum(decoder.string()?))
          86  +
                })?
          87  +
            }
          88  +
            "defaultIntEnum" => {
          89  +
                ::aws_smithy_cbor::decode::set_optional(builder, decoder, |builder, decoder| {
          90  +
                    Ok(builder.set_default_int_enum(decoder.integer()?))
          91  +
                })?
          92  +
            }
          93  +
            "emptyString" => {
          94  +
                ::aws_smithy_cbor::decode::set_optional(builder, decoder, |builder, decoder| {
          95  +
                    Ok(builder.set_empty_string(decoder.string()?))
          96  +
                })?
          97  +
            }
          98  +
            "falseBoolean" => {
          99  +
                ::aws_smithy_cbor::decode::set_optional(builder, decoder, |builder, decoder| {
         100  +
                    Ok(builder.set_false_boolean(decoder.boolean()?))
         101  +
                })?
         102  +
            }
         103  +
            "emptyBlob" => {
         104  +
                ::aws_smithy_cbor::decode::set_optional(builder, decoder, |builder, decoder| {
         105  +
                    Ok(builder.set_empty_blob(decoder.blob()?))
         106  +
                })?
         107  +
            }
         108  +
            "zeroByte" => {
         109  +
                ::aws_smithy_cbor::decode::set_optional(builder, decoder, |builder, decoder| {
         110  +
                    Ok(builder.set_zero_byte(decoder.byte()?))
         111  +
                })?
         112  +
            }
         113  +
            "zeroShort" => {
         114  +
                ::aws_smithy_cbor::decode::set_optional(builder, decoder, |builder, decoder| {
         115  +
                    Ok(builder.set_zero_short(decoder.short()?))
         116  +
                })?
         117  +
            }
         118  +
            "zeroInteger" => {
         119  +
                ::aws_smithy_cbor::decode::set_optional(builder, decoder, |builder, decoder| {
         120  +
                    Ok(builder.set_zero_integer(decoder.integer()?))
         121  +
                })?
         122  +
            }
         123  +
            "zeroLong" => {
         124  +
                ::aws_smithy_cbor::decode::set_optional(builder, decoder, |builder, decoder| {
         125  +
                    Ok(builder.set_zero_long(decoder.long()?))
         126  +
                })?
         127  +
            }
         128  +
            "zeroFloat" => {
         129  +
                ::aws_smithy_cbor::decode::set_optional(builder, decoder, |builder, decoder| {
         130  +
                    Ok(builder.set_zero_float(decoder.float()?))
         131  +
                })?
         132  +
            }
         133  +
            "zeroDouble" => {
         134  +
                ::aws_smithy_cbor::decode::set_optional(builder, decoder, |builder, decoder| {
         135  +
                    Ok(builder.set_zero_double(decoder.double()?))
         136  +
                })?
         137  +
            }
         138  +
            _ => {
         139  +
                decoder.skip()?;
         140  +
                builder
         141  +
            }
         142  +
        };
         143  +
        Ok(builder)
         144  +
    }
         145  +
         146  +
    let mut builder = crate::model::defaults::Builder::default();
         147  +
         148  +
    match decoder.map()? {
         149  +
        None => loop {
         150  +
            match decoder.datatype()? {
         151  +
                ::aws_smithy_cbor::data::Type::Break => {
         152  +
                    decoder.skip()?;
         153  +
                    break;
         154  +
                }
         155  +
                _ => {
         156  +
                    builder = pair(builder, decoder)?;
         157  +
                }
         158  +
            };
         159  +
        },
         160  +
        Some(n) => {
         161  +
            for _ in 0..n {
         162  +
                builder = pair(builder, decoder)?;
         163  +
            }
         164  +
        }
         165  +
    };
         166  +
    Ok(builder)
         167  +
}

tmp-codegen-diff/codegen-server-test/rpcv2Cbor-http0x/rust-server-codegen/src/protocol_serde/shape_dense_boolean_map.rs

@@ -0,1 +0,53 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub(crate) fn de_dense_boolean_map(
           3  +
    decoder: &mut ::aws_smithy_cbor::Decoder,
           4  +
) -> ::std::result::Result<
           5  +
    ::std::collections::HashMap<::std::string::String, bool>,
           6  +
    ::aws_smithy_cbor::decode::DeserializeError,
           7  +
> {
           8  +
    fn pair(
           9  +
        mut map: ::std::collections::HashMap<::std::string::String, bool>,
          10  +
        decoder: &mut ::aws_smithy_cbor::Decoder,
          11  +
    ) -> ::std::result::Result<
          12  +
        ::std::collections::HashMap<::std::string::String, bool>,
          13  +
        ::aws_smithy_cbor::decode::DeserializeError,
          14  +
    > {
          15  +
        let key = decoder.string()?;
          16  +
        let value = match decoder.datatype()? {
          17  +
            ::aws_smithy_cbor::data::Type::Null => {
          18  +
                return ::std::result::Result::Err(
          19  +
                    ::aws_smithy_cbor::decode::DeserializeError::custom(
          20  +
                        "dense map cannot contain null values",
          21  +
                        decoder.position(),
          22  +
                    ),
          23  +
                )
          24  +
            }
          25  +
            _ => decoder.boolean()?,
          26  +
        };
          27  +
        map.insert(key, value);
          28  +
        Ok(map)
          29  +
    }
          30  +
          31  +
    let mut map = ::std::collections::HashMap::new();
          32  +
          33  +
    match decoder.map()? {
          34  +
        None => loop {
          35  +
            match decoder.datatype()? {
          36  +
                ::aws_smithy_cbor::data::Type::Break => {
          37  +
                    decoder.skip()?;
          38  +
                    break;
          39  +
                }
          40  +
                _ => {
          41  +
                    map = pair(map, decoder)?;
          42  +
                }
          43  +
            };
          44  +
        },
          45  +
        Some(n) => {
          46  +
            for _ in 0..n {
          47  +
                map = pair(map, decoder)?;
          48  +
            }
          49  +
        }
          50  +
    };
          51  +
          52  +
    Ok(map)
          53  +
}

tmp-codegen-diff/codegen-server-test/rpcv2Cbor-http0x/rust-server-codegen/src/protocol_serde/shape_dense_number_map.rs

@@ -0,1 +0,53 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub(crate) fn de_dense_number_map(
           3  +
    decoder: &mut ::aws_smithy_cbor::Decoder,
           4  +
) -> ::std::result::Result<
           5  +
    ::std::collections::HashMap<::std::string::String, i32>,
           6  +
    ::aws_smithy_cbor::decode::DeserializeError,
           7  +
> {
           8  +
    fn pair(
           9  +
        mut map: ::std::collections::HashMap<::std::string::String, i32>,
          10  +
        decoder: &mut ::aws_smithy_cbor::Decoder,
          11  +
    ) -> ::std::result::Result<
          12  +
        ::std::collections::HashMap<::std::string::String, i32>,
          13  +
        ::aws_smithy_cbor::decode::DeserializeError,
          14  +
    > {
          15  +
        let key = decoder.string()?;
          16  +
        let value = match decoder.datatype()? {
          17  +
            ::aws_smithy_cbor::data::Type::Null => {
          18  +
                return ::std::result::Result::Err(
          19  +
                    ::aws_smithy_cbor::decode::DeserializeError::custom(
          20  +
                        "dense map cannot contain null values",
          21  +
                        decoder.position(),
          22  +
                    ),
          23  +
                )
          24  +
            }
          25  +
            _ => decoder.integer()?,
          26  +
        };
          27  +
        map.insert(key, value);
          28  +
        Ok(map)
          29  +
    }
          30  +
          31  +
    let mut map = ::std::collections::HashMap::new();
          32  +
          33  +
    match decoder.map()? {
          34  +
        None => loop {
          35  +
            match decoder.datatype()? {
          36  +
                ::aws_smithy_cbor::data::Type::Break => {
          37  +
                    decoder.skip()?;
          38  +
                    break;
          39  +
                }
          40  +
                _ => {
          41  +
                    map = pair(map, decoder)?;
          42  +
                }
          43  +
            };
          44  +
        },
          45  +
        Some(n) => {
          46  +
            for _ in 0..n {
          47  +
                map = pair(map, decoder)?;
          48  +
            }
          49  +
        }
          50  +
    };
          51  +
          52  +
    Ok(map)
          53  +
}

tmp-codegen-diff/codegen-server-test/rpcv2Cbor-http0x/rust-server-codegen/src/protocol_serde/shape_dense_set_map.rs

@@ -0,1 +0,55 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub(crate) fn de_dense_set_map(
           3  +
    decoder: &mut ::aws_smithy_cbor::Decoder,
           4  +
) -> ::std::result::Result<
           5  +
    crate::unconstrained::dense_set_map_unconstrained::DenseSetMapUnconstrained,
           6  +
    ::aws_smithy_cbor::decode::DeserializeError,
           7  +
> {
           8  +
    fn pair(
           9  +
        mut map: crate::unconstrained::dense_set_map_unconstrained::DenseSetMapUnconstrained,
          10  +
        decoder: &mut ::aws_smithy_cbor::Decoder,
          11  +
    ) -> ::std::result::Result<
          12  +
        crate::unconstrained::dense_set_map_unconstrained::DenseSetMapUnconstrained,
          13  +
        ::aws_smithy_cbor::decode::DeserializeError,
          14  +
    > {
          15  +
        let key = decoder.string()?;
          16  +
        let value = match decoder.datatype()? {
          17  +
            ::aws_smithy_cbor::data::Type::Null => {
          18  +
                return ::std::result::Result::Err(
          19  +
                    ::aws_smithy_cbor::decode::DeserializeError::custom(
          20  +
                        "dense map cannot contain null values",
          21  +
                        decoder.position(),
          22  +
                    ),
          23  +
                )
          24  +
            }
          25  +
            _ => crate::protocol_serde::shape_string_set::de_string_set(decoder)?,
          26  +
        };
          27  +
        map.0.insert(key, value);
          28  +
        Ok(map)
          29  +
    }
          30  +
          31  +
    let mut map = crate::unconstrained::dense_set_map_unconstrained::DenseSetMapUnconstrained(
          32  +
        ::std::collections::HashMap::new(),
          33  +
    );
          34  +
          35  +
    match decoder.map()? {
          36  +
        None => loop {
          37  +
            match decoder.datatype()? {
          38  +
                ::aws_smithy_cbor::data::Type::Break => {
          39  +
                    decoder.skip()?;
          40  +
                    break;
          41  +
                }
          42  +
                _ => {
          43  +
                    map = pair(map, decoder)?;
          44  +
                }
          45  +
            };
          46  +
        },
          47  +
        Some(n) => {
          48  +
            for _ in 0..n {
          49  +
                map = pair(map, decoder)?;
          50  +
            }
          51  +
        }
          52  +
    };
          53  +
          54  +
    Ok(map)
          55  +
}

tmp-codegen-diff/codegen-server-test/rpcv2Cbor-http0x/rust-server-codegen/src/protocol_serde/shape_dense_string_map.rs

@@ -0,1 +0,53 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub(crate) fn de_dense_string_map(
           3  +
    decoder: &mut ::aws_smithy_cbor::Decoder,
           4  +
) -> ::std::result::Result<
           5  +
    ::std::collections::HashMap<::std::string::String, ::std::string::String>,
           6  +
    ::aws_smithy_cbor::decode::DeserializeError,
           7  +
> {
           8  +
    fn pair(
           9  +
        mut map: ::std::collections::HashMap<::std::string::String, ::std::string::String>,
          10  +
        decoder: &mut ::aws_smithy_cbor::Decoder,
          11  +
    ) -> ::std::result::Result<
          12  +
        ::std::collections::HashMap<::std::string::String, ::std::string::String>,
          13  +
        ::aws_smithy_cbor::decode::DeserializeError,
          14  +
    > {
          15  +
        let key = decoder.string()?;
          16  +
        let value = match decoder.datatype()? {
          17  +
            ::aws_smithy_cbor::data::Type::Null => {
          18  +
                return ::std::result::Result::Err(
          19  +
                    ::aws_smithy_cbor::decode::DeserializeError::custom(
          20  +
                        "dense map cannot contain null values",
          21  +
                        decoder.position(),
          22  +
                    ),
          23  +
                )
          24  +
            }
          25  +
            _ => decoder.string()?,
          26  +
        };
          27  +
        map.insert(key, value);
          28  +
        Ok(map)
          29  +
    }
          30  +
          31  +
    let mut map = ::std::collections::HashMap::new();
          32  +
          33  +
    match decoder.map()? {
          34  +
        None => loop {
          35  +
            match decoder.datatype()? {
          36  +
                ::aws_smithy_cbor::data::Type::Break => {
          37  +
                    decoder.skip()?;
          38  +
                    break;
          39  +
                }
          40  +
                _ => {
          41  +
                    map = pair(map, decoder)?;
          42  +
                }
          43  +
            };
          44  +
        },
          45  +
        Some(n) => {
          46  +
            for _ in 0..n {
          47  +
                map = pair(map, decoder)?;
          48  +
            }
          49  +
        }
          50  +
    };
          51  +
          52  +
    Ok(map)
          53  +
}

tmp-codegen-diff/codegen-server-test/rpcv2Cbor-http0x/rust-server-codegen/src/protocol_serde/shape_dense_struct_map.rs

@@ -0,1 +0,53 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub(crate) fn de_dense_struct_map(
           3  +
    decoder: &mut ::aws_smithy_cbor::Decoder,
           4  +
) -> ::std::result::Result<
           5  +
    ::std::collections::HashMap<::std::string::String, crate::model::GreetingStruct>,
           6  +
    ::aws_smithy_cbor::decode::DeserializeError,
           7  +
> {
           8  +
    fn pair(
           9  +
        mut map: ::std::collections::HashMap<::std::string::String, crate::model::GreetingStruct>,
          10  +
        decoder: &mut ::aws_smithy_cbor::Decoder,
          11  +
    ) -> ::std::result::Result<
          12  +
        ::std::collections::HashMap<::std::string::String, crate::model::GreetingStruct>,
          13  +
        ::aws_smithy_cbor::decode::DeserializeError,
          14  +
    > {
          15  +
        let key = decoder.string()?;
          16  +
        let value = match decoder.datatype()? {
          17  +
            ::aws_smithy_cbor::data::Type::Null => {
          18  +
                return ::std::result::Result::Err(
          19  +
                    ::aws_smithy_cbor::decode::DeserializeError::custom(
          20  +
                        "dense map cannot contain null values",
          21  +
                        decoder.position(),
          22  +
                    ),
          23  +
                )
          24  +
            }
          25  +
            _ => crate::protocol_serde::shape_greeting_struct::de_greeting_struct(decoder)?,
          26  +
        };
          27  +
        map.insert(key, value);
          28  +
        Ok(map)
          29  +
    }
          30  +
          31  +
    let mut map = ::std::collections::HashMap::new();
          32  +
          33  +
    match decoder.map()? {
          34  +
        None => loop {
          35  +
            match decoder.datatype()? {
          36  +
                ::aws_smithy_cbor::data::Type::Break => {
          37  +
                    decoder.skip()?;
          38  +
                    break;
          39  +
                }
          40  +
                _ => {
          41  +
                    map = pair(map, decoder)?;
          42  +
                }
          43  +
            };
          44  +
        },
          45  +
        Some(n) => {
          46  +
            for _ in 0..n {
          47  +
                map = pair(map, decoder)?;
          48  +
            }
          49  +
        }
          50  +
    };
          51  +
          52  +
    Ok(map)
          53  +
}

tmp-codegen-diff/codegen-server-test/rpcv2Cbor-http0x/rust-server-codegen/src/protocol_serde/shape_empty_input_output.rs

@@ -0,1 +0,60 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
#[allow(clippy::unnecessary_wraps)]
           3  +
pub async fn de_empty_input_output_http_request<B>(
           4  +
    #[allow(unused_variables)] request: ::http::Request<B>,
           5  +
) -> std::result::Result<
           6  +
    crate::input::EmptyInputOutputInput,
           7  +
    ::aws_smithy_legacy_http_server::protocol::rpc_v2_cbor::rejection::RequestRejection,
           8  +
>
           9  +
where
          10  +
    B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
          11  +
    B::Data: Send,
          12  +
    ::aws_smithy_legacy_http_server::protocol::rpc_v2_cbor::rejection::RequestRejection:
          13  +
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
          14  +
{
          15  +
    Ok({
          16  +
        #[allow(unused_mut)]
          17  +
        let mut input = crate::input::empty_input_output_input::Builder::default();
          18  +
        #[allow(unused_variables)]
          19  +
        let ::aws_smithy_runtime_api::http::RequestParts {
          20  +
            uri, headers, body, ..
          21  +
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          22  +
        input.build()
          23  +
    })
          24  +
}
          25  +
          26  +
#[allow(clippy::unnecessary_wraps)]
          27  +
pub fn ser_empty_input_output_http_response(
          28  +
    #[allow(unused_variables)] output: crate::output::EmptyInputOutputOutput,
          29  +
) -> std::result::Result<
          30  +
    ::aws_smithy_legacy_http_server::response::Response,
          31  +
    ::aws_smithy_legacy_http_server::protocol::rpc_v2_cbor::rejection::ResponseRejection,
          32  +
> {
          33  +
    Ok({
          34  +
        #[allow(unused_mut)]
          35  +
        let mut builder = ::http::Response::builder();
          36  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
          37  +
            builder,
          38  +
            ::http::header::CONTENT_TYPE,
          39  +
            "application/cbor",
          40  +
        );
          41  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
          42  +
            builder,
          43  +
            ::http::header::HeaderName::from_static("smithy-protocol"),
          44  +
            "rpc-v2-cbor",
          45  +
        );
          46  +
        let http_status: u16 = 200;
          47  +
        builder = builder.status(http_status);
          48  +
        let payload =
          49  +
            crate::protocol_serde::shape_empty_input_output_output::ser_empty_input_output_output_output_output(&output)?
          50  +
        ;
          51  +
        let content_length = payload.len();
          52  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
          53  +
            builder,
          54  +
            ::http::header::CONTENT_LENGTH,
          55  +
            content_length,
          56  +
        );
          57  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
          58  +
        builder.body(body)?
          59  +
    })
          60  +
}

tmp-codegen-diff/codegen-server-test/rpcv2Cbor-http0x/rust-server-codegen/src/protocol_serde/shape_empty_input_output_output.rs

@@ -0,1 +0,23 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub fn ser_empty_input_output_output_output_output(
           3  +
    value: &crate::output::EmptyInputOutputOutput,
           4  +
) -> ::std::result::Result<
           5  +
    ::std::vec::Vec<u8>,
           6  +
    ::aws_smithy_types::error::operation::SerializationError,
           7  +
> {
           8  +
    let mut encoder = ::aws_smithy_cbor::Encoder::new(::std::vec::Vec::new());
           9  +
    {
          10  +
        let encoder = &mut encoder;
          11  +
        crate::protocol_serde::shape_empty_input_output_output::ser_empty_input_output_output_output(encoder, value )?;
          12  +
    }
          13  +
    ::std::result::Result::Ok(encoder.into_writer())
          14  +
}
          15  +
          16  +
pub fn ser_empty_input_output_output_output(
          17  +
    encoder: &mut ::aws_smithy_cbor::Encoder,
          18  +
    #[allow(unused)] input: &crate::output::EmptyInputOutputOutput,
          19  +
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          20  +
    encoder.begin_map();
          21  +
    encoder.end();
          22  +
    Ok(())
          23  +
}

tmp-codegen-diff/codegen-server-test/rpcv2Cbor-http0x/rust-server-codegen/src/protocol_serde/shape_float16.rs

@@ -0,1 +0,59 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
#[allow(clippy::unnecessary_wraps)]
           3  +
pub async fn de_float16_http_request<B>(
           4  +
    #[allow(unused_variables)] request: ::http::Request<B>,
           5  +
) -> std::result::Result<
           6  +
    crate::input::Float16Input,
           7  +
    ::aws_smithy_legacy_http_server::protocol::rpc_v2_cbor::rejection::RequestRejection,
           8  +
>
           9  +
where
          10  +
    B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
          11  +
    B::Data: Send,
          12  +
    ::aws_smithy_legacy_http_server::protocol::rpc_v2_cbor::rejection::RequestRejection:
          13  +
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
          14  +
{
          15  +
    Ok({
          16  +
        #[allow(unused_mut)]
          17  +
        let mut input = crate::input::float16_input::Builder::default();
          18  +
        #[allow(unused_variables)]
          19  +
        let ::aws_smithy_runtime_api::http::RequestParts {
          20  +
            uri, headers, body, ..
          21  +
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          22  +
        input.build()
          23  +
    })
          24  +
}
          25  +
          26  +
#[allow(clippy::unnecessary_wraps)]
          27  +
pub fn ser_float16_http_response(
          28  +
    #[allow(unused_variables)] output: crate::output::Float16Output,
          29  +
) -> std::result::Result<
          30  +
    ::aws_smithy_legacy_http_server::response::Response,
          31  +
    ::aws_smithy_legacy_http_server::protocol::rpc_v2_cbor::rejection::ResponseRejection,
          32  +
> {
          33  +
    Ok({
          34  +
        #[allow(unused_mut)]
          35  +
        let mut builder = ::http::Response::builder();
          36  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
          37  +
            builder,
          38  +
            ::http::header::CONTENT_TYPE,
          39  +
            "application/cbor",
          40  +
        );
          41  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
          42  +
            builder,
          43  +
            ::http::header::HeaderName::from_static("smithy-protocol"),
          44  +
            "rpc-v2-cbor",
          45  +
        );
          46  +
        let http_status: u16 = 200;
          47  +
        builder = builder.status(http_status);
          48  +
        let payload =
          49  +
            crate::protocol_serde::shape_float16_output::ser_float16_output_output_output(&output)?;
          50  +
        let content_length = payload.len();
          51  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
          52  +
            builder,
          53  +
            ::http::header::CONTENT_LENGTH,
          54  +
            content_length,
          55  +
        );
          56  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
          57  +
        builder.body(body)?
          58  +
    })
          59  +
}

tmp-codegen-diff/codegen-server-test/rpcv2Cbor-http0x/rust-server-codegen/src/protocol_serde/shape_float16_output.rs

@@ -0,1 +0,26 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub fn ser_float16_output_output_output(
           3  +
    value: &crate::output::Float16Output,
           4  +
) -> ::std::result::Result<
           5  +
    ::std::vec::Vec<u8>,
           6  +
    ::aws_smithy_types::error::operation::SerializationError,
           7  +
> {
           8  +
    let mut encoder = ::aws_smithy_cbor::Encoder::new(::std::vec::Vec::new());
           9  +
    {
          10  +
        let encoder = &mut encoder;
          11  +
        crate::protocol_serde::shape_float16_output::ser_float16_output_output(encoder, value)?;
          12  +
    }
          13  +
    ::std::result::Result::Ok(encoder.into_writer())
          14  +
}
          15  +
          16  +
pub fn ser_float16_output_output(
          17  +
    encoder: &mut ::aws_smithy_cbor::Encoder,
          18  +
    #[allow(unused)] input: &crate::output::Float16Output,
          19  +
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          20  +
    encoder.begin_map();
          21  +
    if let Some(var_1) = &input.value {
          22  +
        encoder.str("value").double(*var_1);
          23  +
    }
          24  +
    encoder.end();
          25  +
    Ok(())
          26  +
}