Server Test

Server Test

rev. 03e6e47f15dfd569240d570d98975ebba692c405

Files changed:

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

@@ -0,1 +0,174 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub fn ser_operation_with_defaults_output_output_output(
           3  +
    value: &crate::output::OperationWithDefaultsOutput,
           4  +
) -> ::std::result::Result<String, ::aws_smithy_types::error::operation::SerializationError> {
           5  +
    let mut out = ::std::string::String::new();
           6  +
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
           7  +
    crate::protocol_serde::shape_operation_with_defaults_output::ser_operation_with_defaults_output_output(&mut object, value)?;
           8  +
    object.finish();
           9  +
    Ok(out)
          10  +
}
          11  +
          12  +
pub fn ser_operation_with_defaults_output_output(
          13  +
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
          14  +
    input: &crate::output::OperationWithDefaultsOutput,
          15  +
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          16  +
    {
          17  +
        object
          18  +
            .key("defaultString")
          19  +
            .string(input.default_string.as_str());
          20  +
    }
          21  +
    {
          22  +
        object.key("defaultBoolean").boolean(input.default_boolean);
          23  +
    }
          24  +
    {
          25  +
        let mut array_1 = object.key("defaultList").start_array();
          26  +
        for item_2 in &input.default_list {
          27  +
            {
          28  +
                array_1.value().string(item_2.as_str());
          29  +
            }
          30  +
        }
          31  +
        array_1.finish();
          32  +
    }
          33  +
    {
          34  +
        object
          35  +
            .key("defaultDocumentMap")
          36  +
            .document(&input.default_document_map);
          37  +
    }
          38  +
    {
          39  +
        object
          40  +
            .key("defaultDocumentString")
          41  +
            .document(&input.default_document_string);
          42  +
    }
          43  +
    {
          44  +
        object
          45  +
            .key("defaultDocumentBoolean")
          46  +
            .document(&input.default_document_boolean);
          47  +
    }
          48  +
    {
          49  +
        object
          50  +
            .key("defaultDocumentList")
          51  +
            .document(&input.default_document_list);
          52  +
    }
          53  +
    if let Some(var_3) = &input.default_null_document {
          54  +
        object.key("defaultNullDocument").document(var_3);
          55  +
    }
          56  +
    {
          57  +
        object.key("defaultTimestamp").date_time(
          58  +
            &input.default_timestamp,
          59  +
            ::aws_smithy_types::date_time::Format::EpochSeconds,
          60  +
        )?;
          61  +
    }
          62  +
    {
          63  +
        object
          64  +
            .key("defaultBlob")
          65  +
            .string_unchecked(&::aws_smithy_types::base64::encode(&input.default_blob));
          66  +
    }
          67  +
    {
          68  +
        object.key("defaultByte").number(
          69  +
            #[allow(clippy::useless_conversion)]
          70  +
            ::aws_smithy_types::Number::NegInt((input.default_byte).into()),
          71  +
        );
          72  +
    }
          73  +
    {
          74  +
        object.key("defaultShort").number(
          75  +
            #[allow(clippy::useless_conversion)]
          76  +
            ::aws_smithy_types::Number::NegInt((input.default_short).into()),
          77  +
        );
          78  +
    }
          79  +
    {
          80  +
        object.key("defaultInteger").number(
          81  +
            #[allow(clippy::useless_conversion)]
          82  +
            ::aws_smithy_types::Number::NegInt((input.default_integer).into()),
          83  +
        );
          84  +
    }
          85  +
    {
          86  +
        object.key("defaultLong").number(
          87  +
            #[allow(clippy::useless_conversion)]
          88  +
            ::aws_smithy_types::Number::NegInt((input.default_long).into()),
          89  +
        );
          90  +
    }
          91  +
    {
          92  +
        object.key("defaultFloat").number(
          93  +
            #[allow(clippy::useless_conversion)]
          94  +
            ::aws_smithy_types::Number::Float((input.default_float).into()),
          95  +
        );
          96  +
    }
          97  +
    {
          98  +
        object.key("defaultDouble").number(
          99  +
            #[allow(clippy::useless_conversion)]
         100  +
            ::aws_smithy_types::Number::Float((input.default_double).into()),
         101  +
        );
         102  +
    }
         103  +
    {
         104  +
        #[allow(unused_mut)]
         105  +
        let mut object_4 = object.key("defaultMap").start_object();
         106  +
        for (key_5, value_6) in &input.default_map {
         107  +
            {
         108  +
                object_4.key(key_5.as_str()).string(value_6.as_str());
         109  +
            }
         110  +
        }
         111  +
        object_4.finish();
         112  +
    }
         113  +
    {
         114  +
        object
         115  +
            .key("defaultEnum")
         116  +
            .string(input.default_enum.as_str());
         117  +
    }
         118  +
    {
         119  +
        object.key("defaultIntEnum").number(
         120  +
            #[allow(clippy::useless_conversion)]
         121  +
            ::aws_smithy_types::Number::NegInt((input.default_int_enum).into()),
         122  +
        );
         123  +
    }
         124  +
    {
         125  +
        object
         126  +
            .key("emptyString")
         127  +
            .string(input.empty_string.as_str());
         128  +
    }
         129  +
    {
         130  +
        object.key("falseBoolean").boolean(input.false_boolean);
         131  +
    }
         132  +
    {
         133  +
        object
         134  +
            .key("emptyBlob")
         135  +
            .string_unchecked(&::aws_smithy_types::base64::encode(&input.empty_blob));
         136  +
    }
         137  +
    {
         138  +
        object.key("zeroByte").number(
         139  +
            #[allow(clippy::useless_conversion)]
         140  +
            ::aws_smithy_types::Number::NegInt((input.zero_byte).into()),
         141  +
        );
         142  +
    }
         143  +
    {
         144  +
        object.key("zeroShort").number(
         145  +
            #[allow(clippy::useless_conversion)]
         146  +
            ::aws_smithy_types::Number::NegInt((input.zero_short).into()),
         147  +
        );
         148  +
    }
         149  +
    {
         150  +
        object.key("zeroInteger").number(
         151  +
            #[allow(clippy::useless_conversion)]
         152  +
            ::aws_smithy_types::Number::NegInt((input.zero_integer).into()),
         153  +
        );
         154  +
    }
         155  +
    {
         156  +
        object.key("zeroLong").number(
         157  +
            #[allow(clippy::useless_conversion)]
         158  +
            ::aws_smithy_types::Number::NegInt((input.zero_long).into()),
         159  +
        );
         160  +
    }
         161  +
    {
         162  +
        object.key("zeroFloat").number(
         163  +
            #[allow(clippy::useless_conversion)]
         164  +
            ::aws_smithy_types::Number::Float((input.zero_float).into()),
         165  +
        );
         166  +
    }
         167  +
    {
         168  +
        object.key("zeroDouble").number(
         169  +
            #[allow(clippy::useless_conversion)]
         170  +
            ::aws_smithy_types::Number::Float((input.zero_double).into()),
         171  +
        );
         172  +
    }
         173  +
    Ok(())
         174  +
}

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

@@ -0,1 +0,141 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
#[allow(clippy::unnecessary_wraps)]
           3  +
pub async fn de_operation_with_nested_structure_http_request<B>(
           4  +
    #[allow(unused_variables)] request: ::http::Request<B>,
           5  +
) -> std::result::Result<
           6  +
    crate::input::OperationWithNestedStructureInput,
           7  +
    ::aws_smithy_legacy_http_server::protocol::aws_json::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::aws_json::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::operation_with_nested_structure_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  +
        let bytes = ::hyper::body::to_bytes(body).await?;
          23  +
        if !bytes.is_empty() {
          24  +
            ::aws_smithy_legacy_http_server::protocol::content_type_header_classifier_smithy(
          25  +
                &headers,
          26  +
                Some("application/x-amz-json-1.0"),
          27  +
            )?;
          28  +
            input = crate::protocol_serde::shape_operation_with_nested_structure::de_operation_with_nested_structure(bytes.as_ref(), input)?;
          29  +
        }
          30  +
        input.build()?
          31  +
    })
          32  +
}
          33  +
          34  +
#[allow(clippy::unnecessary_wraps)]
          35  +
pub fn ser_operation_with_nested_structure_http_response(
          36  +
    #[allow(unused_variables)] output: crate::output::OperationWithNestedStructureOutput,
          37  +
) -> std::result::Result<
          38  +
    ::aws_smithy_legacy_http_server::response::Response,
          39  +
    ::aws_smithy_legacy_http_server::protocol::aws_json::rejection::ResponseRejection,
          40  +
> {
          41  +
    Ok({
          42  +
        #[allow(unused_mut)]
          43  +
        let mut builder = ::http::Response::builder();
          44  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
          45  +
            builder,
          46  +
            ::http::header::CONTENT_TYPE,
          47  +
            "application/x-amz-json-1.0",
          48  +
        );
          49  +
        let http_status: u16 = 200;
          50  +
        builder = builder.status(http_status);
          51  +
        let payload =
          52  +
            crate::protocol_serde::shape_operation_with_nested_structure_output::ser_operation_with_nested_structure_output_output_output(&output)?
          53  +
        ;
          54  +
        let content_length = payload.len();
          55  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
          56  +
            builder,
          57  +
            ::http::header::CONTENT_LENGTH,
          58  +
            content_length,
          59  +
        );
          60  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
          61  +
        builder.body(body)?
          62  +
    })
          63  +
}
          64  +
          65  +
#[allow(clippy::unnecessary_wraps)]
          66  +
pub fn ser_operation_with_nested_structure_http_error(
          67  +
    error: &crate::error::OperationWithNestedStructureError,
          68  +
) -> std::result::Result<
          69  +
    ::aws_smithy_legacy_http_server::response::Response,
          70  +
    ::aws_smithy_legacy_http_server::protocol::aws_json::rejection::ResponseRejection,
          71  +
> {
          72  +
    Ok({
          73  +
        match error {
          74  +
            crate::error::OperationWithNestedStructureError::ValidationException(output) => {
          75  +
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
          76  +
                #[allow(unused_mut)]
          77  +
                let mut builder = ::http::Response::builder();
          78  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
          79  +
                    builder,
          80  +
                    ::http::header::CONTENT_TYPE,
          81  +
                    "application/x-amz-json-1.0",
          82  +
                );
          83  +
                let content_length = payload.len();
          84  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
          85  +
                    builder,
          86  +
                    ::http::header::CONTENT_LENGTH,
          87  +
                    content_length,
          88  +
                );
          89  +
                builder
          90  +
                    .status(400)
          91  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
          92  +
            }
          93  +
        }
          94  +
    })
          95  +
}
          96  +
          97  +
pub(crate) fn de_operation_with_nested_structure(
          98  +
    value: &[u8],
          99  +
    mut builder: crate::input::operation_with_nested_structure_input::Builder,
         100  +
) -> ::std::result::Result<
         101  +
    crate::input::operation_with_nested_structure_input::Builder,
         102  +
    ::aws_smithy_json::deserialize::error::DeserializeError,
         103  +
> {
         104  +
    let mut tokens_owned =
         105  +
        ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value))
         106  +
            .peekable();
         107  +
    let tokens = &mut tokens_owned;
         108  +
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
         109  +
    loop {
         110  +
        match tokens.next().transpose()? {
         111  +
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
         112  +
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
         113  +
                match key.to_unescaped()?.as_ref() {
         114  +
                    "topLevel" => {
         115  +
                        if let Some(v) =
         116  +
                            crate::protocol_serde::shape_top_level::de_top_level(tokens)?
         117  +
                        {
         118  +
                            builder = builder.set_top_level(v);
         119  +
                        }
         120  +
                    }
         121  +
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
         122  +
                }
         123  +
            }
         124  +
            other => {
         125  +
                return Err(
         126  +
                    ::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
         127  +
                        "expected object key or end object, found: {other:?}"
         128  +
                    )),
         129  +
                )
         130  +
            }
         131  +
        }
         132  +
    }
         133  +
    if tokens.next().is_some() {
         134  +
        return Err(
         135  +
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
         136  +
                "found more JSON tokens after completing parsing",
         137  +
            ),
         138  +
        );
         139  +
    }
         140  +
    Ok(builder)
         141  +
}

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

@@ -0,1 +0,48 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub fn ser_operation_with_nested_structure_output_output_output(
           3  +
    value: &crate::output::OperationWithNestedStructureOutput,
           4  +
) -> ::std::result::Result<String, ::aws_smithy_types::error::operation::SerializationError> {
           5  +
    let mut out = ::std::string::String::new();
           6  +
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
           7  +
    crate::protocol_serde::shape_operation_with_nested_structure_output::ser_operation_with_nested_structure_output_output(&mut object, value)?;
           8  +
    object.finish();
           9  +
    Ok(out)
          10  +
}
          11  +
          12  +
pub fn ser_operation_with_nested_structure_output_output(
          13  +
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
          14  +
    input: &crate::output::OperationWithNestedStructureOutput,
          15  +
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          16  +
    {
          17  +
        #[allow(unused_mut)]
          18  +
        let mut object_1 = object.key("dialog").start_object();
          19  +
        crate::protocol_serde::shape_dialog::ser_dialog(&mut object_1, &input.dialog)?;
          20  +
        object_1.finish();
          21  +
    }
          22  +
    {
          23  +
        let mut array_2 = object.key("dialogList").start_array();
          24  +
        for item_3 in &input.dialog_list {
          25  +
            {
          26  +
                #[allow(unused_mut)]
          27  +
                let mut object_4 = array_2.value().start_object();
          28  +
                crate::protocol_serde::shape_dialog::ser_dialog(&mut object_4, item_3)?;
          29  +
                object_4.finish();
          30  +
            }
          31  +
        }
          32  +
        array_2.finish();
          33  +
    }
          34  +
    {
          35  +
        #[allow(unused_mut)]
          36  +
        let mut object_5 = object.key("dialogMap").start_object();
          37  +
        for (key_6, value_7) in &input.dialog_map {
          38  +
            {
          39  +
                #[allow(unused_mut)]
          40  +
                let mut object_8 = object_5.key(key_6.as_str()).start_object();
          41  +
                crate::protocol_serde::shape_dialog::ser_dialog(&mut object_8, value_7)?;
          42  +
                object_8.finish();
          43  +
            }
          44  +
        }
          45  +
        object_5.finish();
          46  +
    }
          47  +
    Ok(())
          48  +
}

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

@@ -0,1 +0,55 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
#[allow(clippy::unnecessary_wraps)]
           3  +
pub async fn de_operation_with_required_members_http_request<B>(
           4  +
    #[allow(unused_variables)] request: ::http::Request<B>,
           5  +
) -> std::result::Result<
           6  +
    crate::input::OperationWithRequiredMembersInput,
           7  +
    ::aws_smithy_legacy_http_server::protocol::aws_json::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::aws_json::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::operation_with_required_members_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_operation_with_required_members_http_response(
          28  +
    #[allow(unused_variables)] output: crate::output::OperationWithRequiredMembersOutput,
          29  +
) -> std::result::Result<
          30  +
    ::aws_smithy_legacy_http_server::response::Response,
          31  +
    ::aws_smithy_legacy_http_server::protocol::aws_json::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/x-amz-json-1.0",
          40  +
        );
          41  +
        let http_status: u16 = 200;
          42  +
        builder = builder.status(http_status);
          43  +
        let payload =
          44  +
            crate::protocol_serde::shape_operation_with_required_members_output::ser_operation_with_required_members_output_output_output(&output)?
          45  +
        ;
          46  +
        let content_length = payload.len();
          47  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
          48  +
            builder,
          49  +
            ::http::header::CONTENT_LENGTH,
          50  +
            content_length,
          51  +
        );
          52  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
          53  +
        builder.body(body)?
          54  +
    })
          55  +
}

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

@@ -0,1 +0,93 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub fn ser_operation_with_required_members_output_output_output(
           3  +
    value: &crate::output::OperationWithRequiredMembersOutput,
           4  +
) -> ::std::result::Result<String, ::aws_smithy_types::error::operation::SerializationError> {
           5  +
    let mut out = ::std::string::String::new();
           6  +
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
           7  +
    crate::protocol_serde::shape_operation_with_required_members_output::ser_operation_with_required_members_output_output(&mut object, value)?;
           8  +
    object.finish();
           9  +
    Ok(out)
          10  +
}
          11  +
          12  +
pub fn ser_operation_with_required_members_output_output(
          13  +
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
          14  +
    input: &crate::output::OperationWithRequiredMembersOutput,
          15  +
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          16  +
    {
          17  +
        object
          18  +
            .key("requiredString")
          19  +
            .string(input.required_string.as_str());
          20  +
    }
          21  +
    {
          22  +
        object
          23  +
            .key("requiredBoolean")
          24  +
            .boolean(input.required_boolean);
          25  +
    }
          26  +
    {
          27  +
        let mut array_1 = object.key("requiredList").start_array();
          28  +
        for item_2 in &input.required_list {
          29  +
            {
          30  +
                array_1.value().string(item_2.as_str());
          31  +
            }
          32  +
        }
          33  +
        array_1.finish();
          34  +
    }
          35  +
    {
          36  +
        object.key("requiredTimestamp").date_time(
          37  +
            &input.required_timestamp,
          38  +
            ::aws_smithy_types::date_time::Format::EpochSeconds,
          39  +
        )?;
          40  +
    }
          41  +
    {
          42  +
        object
          43  +
            .key("requiredBlob")
          44  +
            .string_unchecked(&::aws_smithy_types::base64::encode(&input.required_blob));
          45  +
    }
          46  +
    {
          47  +
        object.key("requiredByte").number(
          48  +
            #[allow(clippy::useless_conversion)]
          49  +
            ::aws_smithy_types::Number::NegInt((input.required_byte).into()),
          50  +
        );
          51  +
    }
          52  +
    {
          53  +
        object.key("requiredShort").number(
          54  +
            #[allow(clippy::useless_conversion)]
          55  +
            ::aws_smithy_types::Number::NegInt((input.required_short).into()),
          56  +
        );
          57  +
    }
          58  +
    {
          59  +
        object.key("requiredInteger").number(
          60  +
            #[allow(clippy::useless_conversion)]
          61  +
            ::aws_smithy_types::Number::NegInt((input.required_integer).into()),
          62  +
        );
          63  +
    }
          64  +
    {
          65  +
        object.key("requiredLong").number(
          66  +
            #[allow(clippy::useless_conversion)]
          67  +
            ::aws_smithy_types::Number::NegInt((input.required_long).into()),
          68  +
        );
          69  +
    }
          70  +
    {
          71  +
        object.key("requiredFloat").number(
          72  +
            #[allow(clippy::useless_conversion)]
          73  +
            ::aws_smithy_types::Number::Float((input.required_float).into()),
          74  +
        );
          75  +
    }
          76  +
    {
          77  +
        object.key("requiredDouble").number(
          78  +
            #[allow(clippy::useless_conversion)]
          79  +
            ::aws_smithy_types::Number::Float((input.required_double).into()),
          80  +
        );
          81  +
    }
          82  +
    {
          83  +
        #[allow(unused_mut)]
          84  +
        let mut object_3 = object.key("requiredMap").start_object();
          85  +
        for (key_4, value_5) in &input.required_map {
          86  +
            {
          87  +
                object_3.key(key_4.as_str()).string(value_5.as_str());
          88  +
            }
          89  +
        }
          90  +
        object_3.finish();
          91  +
    }
          92  +
    Ok(())
          93  +
}

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

@@ -0,1 +0,57 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
#[allow(clippy::unnecessary_wraps)]
           3  +
pub async fn de_operation_with_required_members_with_defaults_http_request<B>(
           4  +
    #[allow(unused_variables)] request: ::http::Request<B>,
           5  +
) -> std::result::Result<
           6  +
    crate::input::OperationWithRequiredMembersWithDefaultsInput,
           7  +
    ::aws_smithy_legacy_http_server::protocol::aws_json::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::aws_json::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 =
          18  +
            crate::input::operation_with_required_members_with_defaults_input::Builder::default();
          19  +
        #[allow(unused_variables)]
          20  +
        let ::aws_smithy_runtime_api::http::RequestParts {
          21  +
            uri, headers, body, ..
          22  +
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          23  +
        input.build()
          24  +
    })
          25  +
}
          26  +
          27  +
#[allow(clippy::unnecessary_wraps)]
          28  +
pub fn ser_operation_with_required_members_with_defaults_http_response(
          29  +
    #[allow(unused_variables)]
          30  +
    output: crate::output::OperationWithRequiredMembersWithDefaultsOutput,
          31  +
) -> std::result::Result<
          32  +
    ::aws_smithy_legacy_http_server::response::Response,
          33  +
    ::aws_smithy_legacy_http_server::protocol::aws_json::rejection::ResponseRejection,
          34  +
> {
          35  +
    Ok({
          36  +
        #[allow(unused_mut)]
          37  +
        let mut builder = ::http::Response::builder();
          38  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
          39  +
            builder,
          40  +
            ::http::header::CONTENT_TYPE,
          41  +
            "application/x-amz-json-1.0",
          42  +
        );
          43  +
        let http_status: u16 = 200;
          44  +
        builder = builder.status(http_status);
          45  +
        let payload =
          46  +
            crate::protocol_serde::shape_operation_with_required_members_with_defaults_output::ser_operation_with_required_members_with_defaults_output_output_output(&output)?
          47  +
        ;
          48  +
        let content_length = payload.len();
          49  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
          50  +
            builder,
          51  +
            ::http::header::CONTENT_LENGTH,
          52  +
            content_length,
          53  +
        );
          54  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
          55  +
        builder.body(body)?
          56  +
    })
          57  +
}

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

@@ -0,1 +0,104 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub fn ser_operation_with_required_members_with_defaults_output_output_output(
           3  +
    value: &crate::output::OperationWithRequiredMembersWithDefaultsOutput,
           4  +
) -> ::std::result::Result<String, ::aws_smithy_types::error::operation::SerializationError> {
           5  +
    let mut out = ::std::string::String::new();
           6  +
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
           7  +
    crate::protocol_serde::shape_operation_with_required_members_with_defaults_output::ser_operation_with_required_members_with_defaults_output_output(&mut object, value)?;
           8  +
    object.finish();
           9  +
    Ok(out)
          10  +
}
          11  +
          12  +
pub fn ser_operation_with_required_members_with_defaults_output_output(
          13  +
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
          14  +
    input: &crate::output::OperationWithRequiredMembersWithDefaultsOutput,
          15  +
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          16  +
    {
          17  +
        object
          18  +
            .key("requiredString")
          19  +
            .string(input.required_string.as_str());
          20  +
    }
          21  +
    {
          22  +
        object
          23  +
            .key("requiredBoolean")
          24  +
            .boolean(input.required_boolean);
          25  +
    }
          26  +
    {
          27  +
        let mut array_1 = object.key("requiredList").start_array();
          28  +
        for item_2 in &input.required_list {
          29  +
            {
          30  +
                array_1.value().string(item_2.as_str());
          31  +
            }
          32  +
        }
          33  +
        array_1.finish();
          34  +
    }
          35  +
    {
          36  +
        object.key("requiredTimestamp").date_time(
          37  +
            &input.required_timestamp,
          38  +
            ::aws_smithy_types::date_time::Format::EpochSeconds,
          39  +
        )?;
          40  +
    }
          41  +
    {
          42  +
        object
          43  +
            .key("requiredBlob")
          44  +
            .string_unchecked(&::aws_smithy_types::base64::encode(&input.required_blob));
          45  +
    }
          46  +
    {
          47  +
        object.key("requiredByte").number(
          48  +
            #[allow(clippy::useless_conversion)]
          49  +
            ::aws_smithy_types::Number::NegInt((input.required_byte).into()),
          50  +
        );
          51  +
    }
          52  +
    {
          53  +
        object.key("requiredShort").number(
          54  +
            #[allow(clippy::useless_conversion)]
          55  +
            ::aws_smithy_types::Number::NegInt((input.required_short).into()),
          56  +
        );
          57  +
    }
          58  +
    {
          59  +
        object.key("requiredInteger").number(
          60  +
            #[allow(clippy::useless_conversion)]
          61  +
            ::aws_smithy_types::Number::NegInt((input.required_integer).into()),
          62  +
        );
          63  +
    }
          64  +
    {
          65  +
        object.key("requiredLong").number(
          66  +
            #[allow(clippy::useless_conversion)]
          67  +
            ::aws_smithy_types::Number::NegInt((input.required_long).into()),
          68  +
        );
          69  +
    }
          70  +
    {
          71  +
        object.key("requiredFloat").number(
          72  +
            #[allow(clippy::useless_conversion)]
          73  +
            ::aws_smithy_types::Number::Float((input.required_float).into()),
          74  +
        );
          75  +
    }
          76  +
    {
          77  +
        object.key("requiredDouble").number(
          78  +
            #[allow(clippy::useless_conversion)]
          79  +
            ::aws_smithy_types::Number::Float((input.required_double).into()),
          80  +
        );
          81  +
    }
          82  +
    {
          83  +
        #[allow(unused_mut)]
          84  +
        let mut object_3 = object.key("requiredMap").start_object();
          85  +
        for (key_4, value_5) in &input.required_map {
          86  +
            {
          87  +
                object_3.key(key_4.as_str()).string(value_5.as_str());
          88  +
            }
          89  +
        }
          90  +
        object_3.finish();
          91  +
    }
          92  +
    {
          93  +
        object
          94  +
            .key("requiredEnum")
          95  +
            .string(input.required_enum.as_str());
          96  +
    }
          97  +
    {
          98  +
        object.key("requiredIntEnum").number(
          99  +
            #[allow(clippy::useless_conversion)]
         100  +
            ::aws_smithy_types::Number::NegInt((input.required_int_enum).into()),
         101  +
        );
         102  +
    }
         103  +
    Ok(())
         104  +
}

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

@@ -0,1 +0,118 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
#[allow(clippy::unnecessary_wraps)]
           3  +
pub async fn de_put_with_content_encoding_http_request<B>(
           4  +
    #[allow(unused_variables)] request: ::http::Request<B>,
           5  +
) -> std::result::Result<
           6  +
    crate::input::PutWithContentEncodingInput,
           7  +
    ::aws_smithy_legacy_http_server::protocol::aws_json::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::aws_json::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::put_with_content_encoding_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  +
        let bytes = ::hyper::body::to_bytes(body).await?;
          23  +
        if !bytes.is_empty() {
          24  +
            ::aws_smithy_legacy_http_server::protocol::content_type_header_classifier_smithy(
          25  +
                &headers,
          26  +
                Some("application/x-amz-json-1.0"),
          27  +
            )?;
          28  +
            input = crate::protocol_serde::shape_put_with_content_encoding::de_put_with_content_encoding(bytes.as_ref(), input)?;
          29  +
        }
          30  +
        input.build()
          31  +
    })
          32  +
}
          33  +
          34  +
#[allow(clippy::unnecessary_wraps)]
          35  +
pub fn ser_put_with_content_encoding_http_response(
          36  +
    #[allow(unused_variables)] output: crate::output::PutWithContentEncodingOutput,
          37  +
) -> std::result::Result<
          38  +
    ::aws_smithy_legacy_http_server::response::Response,
          39  +
    ::aws_smithy_legacy_http_server::protocol::aws_json::rejection::ResponseRejection,
          40  +
> {
          41  +
    Ok({
          42  +
        #[allow(unused_mut)]
          43  +
        let mut builder = ::http::Response::builder();
          44  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
          45  +
            builder,
          46  +
            ::http::header::CONTENT_TYPE,
          47  +
            "application/x-amz-json-1.0",
          48  +
        );
          49  +
        let http_status: u16 = 200;
          50  +
        builder = builder.status(http_status);
          51  +
        let payload = "";
          52  +
        let content_length = payload.len();
          53  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
          54  +
            builder,
          55  +
            ::http::header::CONTENT_LENGTH,
          56  +
            content_length,
          57  +
        );
          58  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
          59  +
        builder.body(body)?
          60  +
    })
          61  +
}
          62  +
          63  +
pub(crate) fn de_put_with_content_encoding(
          64  +
    value: &[u8],
          65  +
    mut builder: crate::input::put_with_content_encoding_input::Builder,
          66  +
) -> ::std::result::Result<
          67  +
    crate::input::put_with_content_encoding_input::Builder,
          68  +
    ::aws_smithy_json::deserialize::error::DeserializeError,
          69  +
> {
          70  +
    let mut tokens_owned =
          71  +
        ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value))
          72  +
            .peekable();
          73  +
    let tokens = &mut tokens_owned;
          74  +
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
          75  +
    loop {
          76  +
        match tokens.next().transpose()? {
          77  +
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
          78  +
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
          79  +
                match key.to_unescaped()?.as_ref() {
          80  +
                    "encoding" => {
          81  +
                        builder = builder.set_encoding(
          82  +
                            ::aws_smithy_json::deserialize::token::expect_string_or_null(
          83  +
                                tokens.next(),
          84  +
                            )?
          85  +
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
          86  +
                            .transpose()?,
          87  +
                        );
          88  +
                    }
          89  +
                    "data" => {
          90  +
                        builder = builder.set_data(
          91  +
                            ::aws_smithy_json::deserialize::token::expect_string_or_null(
          92  +
                                tokens.next(),
          93  +
                            )?
          94  +
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
          95  +
                            .transpose()?,
          96  +
                        );
          97  +
                    }
          98  +
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
          99  +
                }
         100  +
            }
         101  +
            other => {
         102  +
                return Err(
         103  +
                    ::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
         104  +
                        "expected object key or end object, found: {other:?}"
         105  +
                    )),
         106  +
                )
         107  +
            }
         108  +
        }
         109  +
    }
         110  +
    if tokens.next().is_some() {
         111  +
        return Err(
         112  +
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
         113  +
                "found more JSON tokens after completing parsing",
         114  +
            ),
         115  +
        );
         116  +
    }
         117  +
    Ok(builder)
         118  +
}

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

@@ -0,1 +0,53 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
#[allow(clippy::unnecessary_wraps)]
           3  +
pub async fn de_query_incompatible_operation_http_request<B>(
           4  +
    #[allow(unused_variables)] request: ::http::Request<B>,
           5  +
) -> std::result::Result<
           6  +
    crate::input::QueryIncompatibleOperationInput,
           7  +
    ::aws_smithy_legacy_http_server::protocol::aws_json::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::aws_json::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::query_incompatible_operation_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_query_incompatible_operation_http_response(
          28  +
    #[allow(unused_variables)] output: crate::output::QueryIncompatibleOperationOutput,
          29  +
) -> std::result::Result<
          30  +
    ::aws_smithy_legacy_http_server::response::Response,
          31  +
    ::aws_smithy_legacy_http_server::protocol::aws_json::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/x-amz-json-1.0",
          40  +
        );
          41  +
        let http_status: u16 = 200;
          42  +
        builder = builder.status(http_status);
          43  +
        let payload = "";
          44  +
        let content_length = payload.len();
          45  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
          46  +
            builder,
          47  +
            ::http::header::CONTENT_LENGTH,
          48  +
            content_length,
          49  +
        );
          50  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
          51  +
        builder.body(body)?
          52  +
    })
          53  +
}

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

@@ -0,1 +0,122 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
#[allow(clippy::unnecessary_wraps)]
           3  +
pub async fn de_simple_scalar_properties_http_request<B>(
           4  +
    #[allow(unused_variables)] request: ::http::Request<B>,
           5  +
) -> std::result::Result<
           6  +
    crate::input::SimpleScalarPropertiesInput,
           7  +
    ::aws_smithy_legacy_http_server::protocol::aws_json::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::aws_json::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::simple_scalar_properties_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  +
        let bytes = ::hyper::body::to_bytes(body).await?;
          23  +
        if !bytes.is_empty() {
          24  +
            ::aws_smithy_legacy_http_server::protocol::content_type_header_classifier_smithy(
          25  +
                &headers,
          26  +
                Some("application/x-amz-json-1.0"),
          27  +
            )?;
          28  +
            input =
          29  +
                crate::protocol_serde::shape_simple_scalar_properties::de_simple_scalar_properties(
          30  +
                    bytes.as_ref(),
          31  +
                    input,
          32  +
                )?;
          33  +
        }
          34  +
        input.build()
          35  +
    })
          36  +
}
          37  +
          38  +
#[allow(clippy::unnecessary_wraps)]
          39  +
pub fn ser_simple_scalar_properties_http_response(
          40  +
    #[allow(unused_variables)] output: crate::output::SimpleScalarPropertiesOutput,
          41  +
) -> std::result::Result<
          42  +
    ::aws_smithy_legacy_http_server::response::Response,
          43  +
    ::aws_smithy_legacy_http_server::protocol::aws_json::rejection::ResponseRejection,
          44  +
> {
          45  +
    Ok({
          46  +
        #[allow(unused_mut)]
          47  +
        let mut builder = ::http::Response::builder();
          48  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
          49  +
            builder,
          50  +
            ::http::header::CONTENT_TYPE,
          51  +
            "application/x-amz-json-1.0",
          52  +
        );
          53  +
        let http_status: u16 = 200;
          54  +
        builder = builder.status(http_status);
          55  +
        let payload =
          56  +
            crate::protocol_serde::shape_simple_scalar_properties_output::ser_simple_scalar_properties_output_output_output(&output)?
          57  +
        ;
          58  +
        let content_length = payload.len();
          59  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
          60  +
            builder,
          61  +
            ::http::header::CONTENT_LENGTH,
          62  +
            content_length,
          63  +
        );
          64  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
          65  +
        builder.body(body)?
          66  +
    })
          67  +
}
          68  +
          69  +
pub(crate) fn de_simple_scalar_properties(
          70  +
    value: &[u8],
          71  +
    mut builder: crate::input::simple_scalar_properties_input::Builder,
          72  +
) -> ::std::result::Result<
          73  +
    crate::input::simple_scalar_properties_input::Builder,
          74  +
    ::aws_smithy_json::deserialize::error::DeserializeError,
          75  +
> {
          76  +
    let mut tokens_owned =
          77  +
        ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value))
          78  +
            .peekable();
          79  +
    let tokens = &mut tokens_owned;
          80  +
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
          81  +
    loop {
          82  +
        match tokens.next().transpose()? {
          83  +
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
          84  +
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
          85  +
                match key.to_unescaped()?.as_ref() {
          86  +
                    "floatValue" => {
          87  +
                        builder = builder.set_float_value(
          88  +
                            ::aws_smithy_json::deserialize::token::expect_number_or_null(
          89  +
                                tokens.next(),
          90  +
                            )?
          91  +
                            .map(|v| v.to_f32_lossy()),
          92  +
                        );
          93  +
                    }
          94  +
                    "doubleValue" => {
          95  +
                        builder = builder.set_double_value(
          96  +
                            ::aws_smithy_json::deserialize::token::expect_number_or_null(
          97  +
                                tokens.next(),
          98  +
                            )?
          99  +
                            .map(|v| v.to_f64_lossy()),
         100  +
                        );
         101  +
                    }
         102  +
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
         103  +
                }
         104  +
            }
         105  +
            other => {
         106  +
                return Err(
         107  +
                    ::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
         108  +
                        "expected object key or end object, found: {other:?}"
         109  +
                    )),
         110  +
                )
         111  +
            }
         112  +
        }
         113  +
    }
         114  +
    if tokens.next().is_some() {
         115  +
        return Err(
         116  +
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
         117  +
                "found more JSON tokens after completing parsing",
         118  +
            ),
         119  +
        );
         120  +
    }
         121  +
    Ok(builder)
         122  +
}

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

@@ -0,1 +0,29 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub fn ser_simple_scalar_properties_output_output_output(
           3  +
    value: &crate::output::SimpleScalarPropertiesOutput,
           4  +
) -> ::std::result::Result<String, ::aws_smithy_types::error::operation::SerializationError> {
           5  +
    let mut out = ::std::string::String::new();
           6  +
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
           7  +
    crate::protocol_serde::shape_simple_scalar_properties_output::ser_simple_scalar_properties_output_output(&mut object, value)?;
           8  +
    object.finish();
           9  +
    Ok(out)
          10  +
}
          11  +
          12  +
pub fn ser_simple_scalar_properties_output_output(
          13  +
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
          14  +
    input: &crate::output::SimpleScalarPropertiesOutput,
          15  +
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          16  +
    if let Some(var_1) = &input.float_value {
          17  +
        object.key("floatValue").number(
          18  +
            #[allow(clippy::useless_conversion)]
          19  +
            ::aws_smithy_types::Number::Float((*var_1).into()),
          20  +
        );
          21  +
    }
          22  +
    if let Some(var_2) = &input.double_value {
          23  +
        object.key("doubleValue").number(
          24  +
            #[allow(clippy::useless_conversion)]
          25  +
            ::aws_smithy_types::Number::Float((*var_2).into()),
          26  +
        );
          27  +
    }
          28  +
    Ok(())
          29  +
}

tmp-codegen-diff/codegen-server-test/json_rpc10-http0x/rust-server-codegen/src/protocol_serde/shape_string_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_string_list<'a, I>(
           3  +
    tokens: &mut ::std::iter::Peekable<I>,
           4  +
) -> ::std::result::Result<
           5  +
    Option<::std::vec::Vec<::std::string::String>>,
           6  +
    ::aws_smithy_json::deserialize::error::DeserializeError,
           7  +
>
           8  +
where
           9  +
    I: Iterator<
          10  +
        Item = Result<
          11  +
            ::aws_smithy_json::deserialize::Token<'a>,
          12  +
            ::aws_smithy_json::deserialize::error::DeserializeError,
          13  +
        >,
          14  +
    >,
          15  +
{
          16  +
    match tokens.next().transpose()? {
          17  +
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
          18  +
        Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => {
          19  +
            let mut items = Vec::new();
          20  +
            loop {
          21  +
                match tokens.peek() {
          22  +
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
          23  +
                        tokens.next().transpose().unwrap();
          24  +
                        break;
          25  +
                    }
          26  +
                    _ => {
          27  +
                        let value = ::aws_smithy_json::deserialize::token::expect_string_or_null(
          28  +
                            tokens.next(),
          29  +
                        )?
          30  +
                        .map(|s| s.to_unescaped().map(|u| u.into_owned()))
          31  +
                        .transpose()?;
          32  +
                        if let Some(value) = value {
          33  +
                            items.push(value);
          34  +
                        } else {
          35  +
                            return Err(
          36  +
                                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
          37  +
                                    "dense list cannot contain null values",
          38  +
                                ),
          39  +
                            );
          40  +
                        }
          41  +
                    }
          42  +
                }
          43  +
            }
          44  +
            Ok(Some(items))
          45  +
        }
          46  +
        _ => Err(
          47  +
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
          48  +
                "expected start array or null",
          49  +
            ),
          50  +
        ),
          51  +
    }
          52  +
}