Server Test

Server Test

rev. 3c756f73b1f83a0eed4275d9d1e22df0b10b66fb

Files changed:

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

@@ -0,1 +0,117 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:516 */
           3  +
pub(crate) fn de_recursive_shapes_input_output_nested1<'a, I>(
           4  +
    tokens: &mut ::std::iter::Peekable<I>,
           5  +
) -> ::std::result::Result<
           6  +
    Option<crate::model::RecursiveShapesInputOutputNested1>,
           7  +
    ::aws_smithy_json::deserialize::error::DeserializeError,
           8  +
>
           9  +
where
          10  +
    I: Iterator<
          11  +
        Item = Result<
          12  +
            ::aws_smithy_json::deserialize::Token<'a>,
          13  +
            ::aws_smithy_json::deserialize::error::DeserializeError,
          14  +
        >,
          15  +
    >,
          16  +
{
          17  +
    /* JsonParserGenerator.kt:712 */
          18  +
    match tokens.next().transpose()? {
          19  +
        /* JsonParserGenerator.kt:713 */
          20  +
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
          21  +
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
          22  +
            /* RustType.kt:534 */
          23  +
            #[allow(unused_mut)]
          24  +
            /* JsonParserGenerator.kt:526 */
          25  +
            let mut builder =
          26  +
                crate::model::recursive_shapes_input_output_nested1::Builder::default();
          27  +
            /* JsonParserGenerator.kt:684 */
          28  +
            loop {
          29  +
                /* JsonParserGenerator.kt:685 */
          30  +
                match tokens.next().transpose()? {
          31  +
                    /* JsonParserGenerator.kt:686 */
          32  +
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
          33  +
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
          34  +
                        /* JsonParserGenerator.kt:260 */
          35  +
                        match key.to_unescaped()?.as_ref() {
          36  +
                            /* JsonParserGenerator.kt:262 */
          37  +
                            "foo" => {
          38  +
                                /* JsonParserGenerator.kt:272 */
          39  +
                                builder = builder.set_foo(
          40  +
                                    /* JsonParserGenerator.kt:354 */::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?.map(|s|
          41  +
                                        /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          42  +
                                            /* JsonParserGenerator.kt:348 */u.into_owned()
          43  +
                                        /* JsonParserGenerator.kt:339 */)
          44  +
                                    /* JsonParserGenerator.kt:354 */).transpose()?
          45  +
                                /* JsonParserGenerator.kt:272 */);
          46  +
                                /* JsonParserGenerator.kt:262 */
          47  +
                            }
          48  +
                            /* JsonParserGenerator.kt:262 */
          49  +
                            "nested" => {
          50  +
                                /* JsonParserGenerator.kt:272 */
          51  +
                                builder = builder.set_nested(
          52  +
                                    /* JsonParserGenerator.kt:544 */crate::protocol_serde::shape_recursive_shapes_input_output_nested2::de_recursive_shapes_input_output_nested2(tokens)?
          53  +
                                    /* JsonParserGenerator.kt:314 */.map(Box::new)
          54  +
                                /* JsonParserGenerator.kt:272 */);
          55  +
                                /* JsonParserGenerator.kt:262 */
          56  +
                            }
          57  +
                            /* JsonParserGenerator.kt:290 */
          58  +
                            _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
          59  +
                        }
          60  +
                        /* JsonParserGenerator.kt:686 */
          61  +
                    }
          62  +
                    /* JsonParserGenerator.kt:695 */
          63  +
                    other => {
          64  +
                        return Err(
          65  +
                            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
          66  +
                                format!("expected object key or end object, found: {other:?}"),
          67  +
                            ),
          68  +
                        )
          69  +
                    } /* JsonParserGenerator.kt:685 */
          70  +
                }
          71  +
                /* JsonParserGenerator.kt:684 */
          72  +
            }
          73  +
            /* JsonParserGenerator.kt:540 */
          74  +
            Ok(Some(builder.build()))
          75  +
            /* JsonParserGenerator.kt:713 */
          76  +
        }
          77  +
        /* JsonParserGenerator.kt:722 */
          78  +
        _ => {
          79  +
            /* JsonParserGenerator.kt:723 */
          80  +
            Err(
          81  +
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
          82  +
                    "expected start object or null",
          83  +
                ),
          84  +
            )
          85  +
            /* JsonParserGenerator.kt:722 */
          86  +
        } /* JsonParserGenerator.kt:712 */
          87  +
    }
          88  +
    /* JsonParserGenerator.kt:516 */
          89  +
}
          90  +
          91  +
/* JsonSerializerGenerator.kt:358 */
          92  +
pub fn ser_recursive_shapes_input_output_nested1(
          93  +
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
          94  +
    input: &crate::model::RecursiveShapesInputOutputNested1,
          95  +
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          96  +
    /* JsonSerializerGenerator.kt:382 */
          97  +
    if let Some(var_1) = &input.foo {
          98  +
        /* JsonSerializerGenerator.kt:423 */
          99  +
        object.key("foo").string(var_1.as_str());
         100  +
        /* JsonSerializerGenerator.kt:382 */
         101  +
    }
         102  +
    /* JsonSerializerGenerator.kt:382 */
         103  +
    if let Some(var_2) = &input.nested {
         104  +
        /* JsonSerializerGenerator.kt:495 */
         105  +
        #[allow(unused_mut)]
         106  +
        /* JsonSerializerGenerator.kt:496 */
         107  +
        let mut object_3 = object.key("nested").start_object();
         108  +
        /* JsonSerializerGenerator.kt:375 */
         109  +
        crate::protocol_serde::shape_recursive_shapes_input_output_nested2::ser_recursive_shapes_input_output_nested2(&mut object_3, var_2)?;
         110  +
        /* JsonSerializerGenerator.kt:515 */
         111  +
        object_3.finish();
         112  +
        /* JsonSerializerGenerator.kt:382 */
         113  +
    }
         114  +
    /* JsonSerializerGenerator.kt:372 */
         115  +
    Ok(())
         116  +
    /* JsonSerializerGenerator.kt:358 */
         117  +
}

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

@@ -0,1 +0,116 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:516 */
           3  +
pub(crate) fn de_recursive_shapes_input_output_nested2<'a, I>(
           4  +
    tokens: &mut ::std::iter::Peekable<I>,
           5  +
) -> ::std::result::Result<
           6  +
    Option<crate::model::RecursiveShapesInputOutputNested2>,
           7  +
    ::aws_smithy_json::deserialize::error::DeserializeError,
           8  +
>
           9  +
where
          10  +
    I: Iterator<
          11  +
        Item = Result<
          12  +
            ::aws_smithy_json::deserialize::Token<'a>,
          13  +
            ::aws_smithy_json::deserialize::error::DeserializeError,
          14  +
        >,
          15  +
    >,
          16  +
{
          17  +
    /* JsonParserGenerator.kt:712 */
          18  +
    match tokens.next().transpose()? {
          19  +
        /* JsonParserGenerator.kt:713 */
          20  +
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
          21  +
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
          22  +
            /* RustType.kt:534 */
          23  +
            #[allow(unused_mut)]
          24  +
            /* JsonParserGenerator.kt:526 */
          25  +
            let mut builder =
          26  +
                crate::model::recursive_shapes_input_output_nested2::Builder::default();
          27  +
            /* JsonParserGenerator.kt:684 */
          28  +
            loop {
          29  +
                /* JsonParserGenerator.kt:685 */
          30  +
                match tokens.next().transpose()? {
          31  +
                    /* JsonParserGenerator.kt:686 */
          32  +
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
          33  +
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
          34  +
                        /* JsonParserGenerator.kt:260 */
          35  +
                        match key.to_unescaped()?.as_ref() {
          36  +
                            /* JsonParserGenerator.kt:262 */
          37  +
                            "bar" => {
          38  +
                                /* JsonParserGenerator.kt:272 */
          39  +
                                builder = builder.set_bar(
          40  +
                                    /* JsonParserGenerator.kt:354 */::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?.map(|s|
          41  +
                                        /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          42  +
                                            /* JsonParserGenerator.kt:348 */u.into_owned()
          43  +
                                        /* JsonParserGenerator.kt:339 */)
          44  +
                                    /* JsonParserGenerator.kt:354 */).transpose()?
          45  +
                                /* JsonParserGenerator.kt:272 */);
          46  +
                                /* JsonParserGenerator.kt:262 */
          47  +
                            }
          48  +
                            /* JsonParserGenerator.kt:262 */
          49  +
                            "recursiveMember" => {
          50  +
                                /* JsonParserGenerator.kt:272 */
          51  +
                                builder = builder.set_recursive_member(
          52  +
                                    /* JsonParserGenerator.kt:544 */crate::protocol_serde::shape_recursive_shapes_input_output_nested1::de_recursive_shapes_input_output_nested1(tokens)?
          53  +
                                /* JsonParserGenerator.kt:272 */);
          54  +
                                /* JsonParserGenerator.kt:262 */
          55  +
                            }
          56  +
                            /* JsonParserGenerator.kt:290 */
          57  +
                            _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
          58  +
                        }
          59  +
                        /* JsonParserGenerator.kt:686 */
          60  +
                    }
          61  +
                    /* JsonParserGenerator.kt:695 */
          62  +
                    other => {
          63  +
                        return Err(
          64  +
                            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
          65  +
                                format!("expected object key or end object, found: {other:?}"),
          66  +
                            ),
          67  +
                        )
          68  +
                    } /* JsonParserGenerator.kt:685 */
          69  +
                }
          70  +
                /* JsonParserGenerator.kt:684 */
          71  +
            }
          72  +
            /* JsonParserGenerator.kt:540 */
          73  +
            Ok(Some(builder.build()))
          74  +
            /* JsonParserGenerator.kt:713 */
          75  +
        }
          76  +
        /* JsonParserGenerator.kt:722 */
          77  +
        _ => {
          78  +
            /* JsonParserGenerator.kt:723 */
          79  +
            Err(
          80  +
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
          81  +
                    "expected start object or null",
          82  +
                ),
          83  +
            )
          84  +
            /* JsonParserGenerator.kt:722 */
          85  +
        } /* JsonParserGenerator.kt:712 */
          86  +
    }
          87  +
    /* JsonParserGenerator.kt:516 */
          88  +
}
          89  +
          90  +
/* JsonSerializerGenerator.kt:358 */
          91  +
pub fn ser_recursive_shapes_input_output_nested2(
          92  +
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
          93  +
    input: &crate::model::RecursiveShapesInputOutputNested2,
          94  +
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          95  +
    /* JsonSerializerGenerator.kt:382 */
          96  +
    if let Some(var_1) = &input.bar {
          97  +
        /* JsonSerializerGenerator.kt:423 */
          98  +
        object.key("bar").string(var_1.as_str());
          99  +
        /* JsonSerializerGenerator.kt:382 */
         100  +
    }
         101  +
    /* JsonSerializerGenerator.kt:382 */
         102  +
    if let Some(var_2) = &input.recursive_member {
         103  +
        /* JsonSerializerGenerator.kt:495 */
         104  +
        #[allow(unused_mut)]
         105  +
        /* JsonSerializerGenerator.kt:496 */
         106  +
        let mut object_3 = object.key("recursiveMember").start_object();
         107  +
        /* JsonSerializerGenerator.kt:375 */
         108  +
        crate::protocol_serde::shape_recursive_shapes_input_output_nested1::ser_recursive_shapes_input_output_nested1(&mut object_3, var_2)?;
         109  +
        /* JsonSerializerGenerator.kt:515 */
         110  +
        object_3.finish();
         111  +
        /* JsonSerializerGenerator.kt:382 */
         112  +
    }
         113  +
    /* JsonSerializerGenerator.kt:372 */
         114  +
    Ok(())
         115  +
    /* JsonSerializerGenerator.kt:358 */
         116  +
}

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

@@ -0,1 +0,40 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
           3  +
pub fn ser_recursive_shapes_output_output_output(
           4  +
    value: &crate::output::RecursiveShapesOutput,
           5  +
) -> ::std::result::Result<String, ::aws_smithy_types::error::operation::SerializationError> {
           6  +
    /* JsonSerializerGenerator.kt:218 */
           7  +
    let mut out = ::std::string::String::new();
           8  +
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
           9  +
    /* JsonSerializerGenerator.kt:375 */
          10  +
    crate::protocol_serde::shape_recursive_shapes_output::ser_recursive_shapes_output_output(
          11  +
        &mut object,
          12  +
        value,
          13  +
    )?;
          14  +
    /* JsonSerializerGenerator.kt:227 */
          15  +
    object.finish();
          16  +
    Ok(out)
          17  +
    /* JsonSerializerGenerator.kt:213 */
          18  +
}
          19  +
          20  +
/* JsonSerializerGenerator.kt:358 */
          21  +
pub fn ser_recursive_shapes_output_output(
          22  +
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
          23  +
    input: &crate::output::RecursiveShapesOutput,
          24  +
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          25  +
    /* JsonSerializerGenerator.kt:382 */
          26  +
    if let Some(var_1) = &input.nested {
          27  +
        /* JsonSerializerGenerator.kt:495 */
          28  +
        #[allow(unused_mut)]
          29  +
        /* JsonSerializerGenerator.kt:496 */
          30  +
        let mut object_2 = object.key("nested").start_object();
          31  +
        /* JsonSerializerGenerator.kt:375 */
          32  +
        crate::protocol_serde::shape_recursive_shapes_input_output_nested1::ser_recursive_shapes_input_output_nested1(&mut object_2, var_1)?;
          33  +
        /* JsonSerializerGenerator.kt:515 */
          34  +
        object_2.finish();
          35  +
        /* JsonSerializerGenerator.kt:382 */
          36  +
    }
          37  +
    /* JsonSerializerGenerator.kt:372 */
          38  +
    Ok(())
          39  +
    /* JsonSerializerGenerator.kt:358 */
          40  +
}

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

@@ -0,1 +0,95 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:516 */
           3  +
pub(crate) fn de_renamed_greeting<'a, I>(
           4  +
    tokens: &mut ::std::iter::Peekable<I>,
           5  +
) -> ::std::result::Result<
           6  +
    Option<crate::model::RenamedGreeting>,
           7  +
    ::aws_smithy_json::deserialize::error::DeserializeError,
           8  +
>
           9  +
where
          10  +
    I: Iterator<
          11  +
        Item = Result<
          12  +
            ::aws_smithy_json::deserialize::Token<'a>,
          13  +
            ::aws_smithy_json::deserialize::error::DeserializeError,
          14  +
        >,
          15  +
    >,
          16  +
{
          17  +
    /* JsonParserGenerator.kt:712 */
          18  +
    match tokens.next().transpose()? {
          19  +
        /* JsonParserGenerator.kt:713 */
          20  +
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
          21  +
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
          22  +
            /* RustType.kt:534 */
          23  +
            #[allow(unused_mut)]
          24  +
            /* JsonParserGenerator.kt:526 */
          25  +
            let mut builder = crate::model::renamed_greeting::Builder::default();
          26  +
            /* JsonParserGenerator.kt:684 */
          27  +
            loop {
          28  +
                /* JsonParserGenerator.kt:685 */
          29  +
                match tokens.next().transpose()? {
          30  +
                    /* JsonParserGenerator.kt:686 */
          31  +
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
          32  +
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
          33  +
                        /* JsonParserGenerator.kt:260 */
          34  +
                        match key.to_unescaped()?.as_ref() {
          35  +
                            /* JsonParserGenerator.kt:262 */
          36  +
                            "salutation" => {
          37  +
                                /* JsonParserGenerator.kt:272 */
          38  +
                                builder = builder.set_salutation(
          39  +
                                    /* JsonParserGenerator.kt:354 */::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?.map(|s|
          40  +
                                        /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          41  +
                                            /* JsonParserGenerator.kt:348 */u.into_owned()
          42  +
                                        /* JsonParserGenerator.kt:339 */)
          43  +
                                    /* JsonParserGenerator.kt:354 */).transpose()?
          44  +
                                /* JsonParserGenerator.kt:272 */);
          45  +
                                /* JsonParserGenerator.kt:262 */
          46  +
                            }
          47  +
                            /* JsonParserGenerator.kt:290 */
          48  +
                            _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
          49  +
                        }
          50  +
                        /* JsonParserGenerator.kt:686 */
          51  +
                    }
          52  +
                    /* JsonParserGenerator.kt:695 */
          53  +
                    other => {
          54  +
                        return Err(
          55  +
                            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
          56  +
                                format!("expected object key or end object, found: {other:?}"),
          57  +
                            ),
          58  +
                        )
          59  +
                    } /* JsonParserGenerator.kt:685 */
          60  +
                }
          61  +
                /* JsonParserGenerator.kt:684 */
          62  +
            }
          63  +
            /* JsonParserGenerator.kt:540 */
          64  +
            Ok(Some(builder.build()))
          65  +
            /* JsonParserGenerator.kt:713 */
          66  +
        }
          67  +
        /* JsonParserGenerator.kt:722 */
          68  +
        _ => {
          69  +
            /* JsonParserGenerator.kt:723 */
          70  +
            Err(
          71  +
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
          72  +
                    "expected start object or null",
          73  +
                ),
          74  +
            )
          75  +
            /* JsonParserGenerator.kt:722 */
          76  +
        } /* JsonParserGenerator.kt:712 */
          77  +
    }
          78  +
    /* JsonParserGenerator.kt:516 */
          79  +
}
          80  +
          81  +
/* JsonSerializerGenerator.kt:358 */
          82  +
pub fn ser_renamed_greeting(
          83  +
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
          84  +
    input: &crate::model::RenamedGreeting,
          85  +
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          86  +
    /* JsonSerializerGenerator.kt:382 */
          87  +
    if let Some(var_1) = &input.salutation {
          88  +
        /* JsonSerializerGenerator.kt:423 */
          89  +
        object.key("salutation").string(var_1.as_str());
          90  +
        /* JsonSerializerGenerator.kt:382 */
          91  +
    }
          92  +
    /* JsonSerializerGenerator.kt:372 */
          93  +
    Ok(())
          94  +
    /* JsonSerializerGenerator.kt:358 */
          95  +
}

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

@@ -0,1 +0,78 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:534 */
           3  +
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ServerHttpBoundProtocolGenerator.kt:408 */
           5  +
pub async fn de_response_code_http_fallback_http_request<B>(
           6  +
    #[allow(unused_variables)] request: ::http::Request<B>,
           7  +
) -> std::result::Result<
           8  +
    crate::input::ResponseCodeHttpFallbackInput,
           9  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
          10  +
>
          11  +
where
          12  +
    B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
          13  +
    B::Data: Send,
          14  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection:
          15  +
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
          16  +
{
          17  +
    /* ServerHttpBoundProtocolGenerator.kt:424 */
          18  +
    Ok({
          19  +
        /* RustType.kt:534 */
          20  +
        #[allow(unused_mut)]
          21  +
        /* ServerHttpBoundProtocolGenerator.kt:759 */
          22  +
        let mut input = crate::input::response_code_http_fallback_input::Builder::default();
          23  +
        /* RustType.kt:534 */
          24  +
        #[allow(unused_variables)]
          25  +
        /* ServerHttpBoundProtocolGenerator.kt:764 */
          26  +
        let ::aws_smithy_runtime_api::http::RequestParts {
          27  +
            uri, headers, body, ..
          28  +
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          29  +
        /* ServerHttpBoundProtocolGenerator.kt:896 */
          30  +
        input.build()
          31  +
        /* ServerHttpBoundProtocolGenerator.kt:424 */
          32  +
    })
          33  +
    /* ServerHttpBoundProtocolGenerator.kt:408 */
          34  +
}
          35  +
          36  +
/* RustType.kt:534 */
          37  +
#[allow(clippy::unnecessary_wraps)]
          38  +
/* ServerHttpBoundProtocolGenerator.kt:445 */
          39  +
pub fn ser_response_code_http_fallback_http_response(
          40  +
    #[allow(unused_variables)] output: crate::output::ResponseCodeHttpFallbackOutput,
          41  +
) -> std::result::Result<
          42  +
    ::aws_smithy_legacy_http_server::response::Response,
          43  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          44  +
> {
          45  +
    /* ServerHttpBoundProtocolGenerator.kt:457 */
          46  +
    Ok({
          47  +
        /* RustType.kt:534 */
          48  +
        #[allow(unused_mut)]
          49  +
        /* ServerHttpBoundProtocolGenerator.kt:547 */
          50  +
        let mut builder = ::http::Response::builder();
          51  +
        /* ServerHttpBoundProtocolGenerator.kt:633 */
          52  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
          53  +
            builder,
          54  +
            ::http::header::CONTENT_TYPE,
          55  +
            "application/json",
          56  +
        );
          57  +
        /* ServerHttpBoundProtocolGenerator.kt:718 */
          58  +
        let http_status: u16 = 201;
          59  +
        builder = builder.status(http_status);
          60  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
          61  +
        let payload =
          62  +
            /* HttpBoundProtocolPayloadGenerator.kt:235 */crate::protocol_serde::shape_response_code_http_fallback_output::ser_response_code_http_fallback_output_output_output(&output)?
          63  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */;
          64  +
        /* ServerHttpBoundProtocolGenerator.kt:699 */
          65  +
        let content_length = payload.len();
          66  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
          67  +
            builder,
          68  +
            ::http::header::CONTENT_LENGTH,
          69  +
            content_length,
          70  +
        );
          71  +
        /* ServerHttpBoundProtocolGenerator.kt:603 */
          72  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
          73  +
        /* ServerHttpBoundProtocolGenerator.kt:611 */
          74  +
        builder.body(body)?
          75  +
        /* ServerHttpBoundProtocolGenerator.kt:457 */
          76  +
    })
          77  +
    /* ServerHttpBoundProtocolGenerator.kt:445 */
          78  +
}

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

@@ -0,1 +0,25 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
           3  +
pub fn ser_response_code_http_fallback_output_output_output(
           4  +
    value: &crate::output::ResponseCodeHttpFallbackOutput,
           5  +
) -> ::std::result::Result<String, ::aws_smithy_types::error::operation::SerializationError> {
           6  +
    /* JsonSerializerGenerator.kt:218 */
           7  +
    let mut out = ::std::string::String::new();
           8  +
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
           9  +
    /* JsonSerializerGenerator.kt:375 */
          10  +
    crate::protocol_serde::shape_response_code_http_fallback_output::ser_response_code_http_fallback_output_output(&mut object, value)?;
          11  +
    /* JsonSerializerGenerator.kt:227 */
          12  +
    object.finish();
          13  +
    Ok(out)
          14  +
    /* JsonSerializerGenerator.kt:213 */
          15  +
}
          16  +
          17  +
/* JsonSerializerGenerator.kt:358 */
          18  +
pub fn ser_response_code_http_fallback_output_output(
          19  +
    #[allow(unused_variables)] object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
          20  +
    #[allow(unused_variables)] input: &crate::output::ResponseCodeHttpFallbackOutput,
          21  +
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          22  +
    /* JsonSerializerGenerator.kt:372 */
          23  +
    Ok(())
          24  +
    /* JsonSerializerGenerator.kt:358 */
          25  +
}

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

@@ -0,1 +0,85 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:534 */
           3  +
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ServerHttpBoundProtocolGenerator.kt:408 */
           5  +
pub async fn de_response_code_required_http_request<B>(
           6  +
    #[allow(unused_variables)] request: ::http::Request<B>,
           7  +
) -> std::result::Result<
           8  +
    crate::input::ResponseCodeRequiredInput,
           9  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
          10  +
>
          11  +
where
          12  +
    B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
          13  +
    B::Data: Send,
          14  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection:
          15  +
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
          16  +
{
          17  +
    /* ServerHttpBoundProtocolGenerator.kt:424 */
          18  +
    Ok({
          19  +
        /* RustType.kt:534 */
          20  +
        #[allow(unused_mut)]
          21  +
        /* ServerHttpBoundProtocolGenerator.kt:759 */
          22  +
        let mut input = crate::input::response_code_required_input::Builder::default();
          23  +
        /* RustType.kt:534 */
          24  +
        #[allow(unused_variables)]
          25  +
        /* ServerHttpBoundProtocolGenerator.kt:764 */
          26  +
        let ::aws_smithy_runtime_api::http::RequestParts {
          27  +
            uri, headers, body, ..
          28  +
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          29  +
        /* ServerHttpBoundProtocolGenerator.kt:873 */
          30  +
        ::aws_smithy_legacy_http_server::protocol::content_type_header_classifier_smithy(
          31  +
            &headers, None,
          32  +
        )?;
          33  +
        /* ServerHttpBoundProtocolGenerator.kt:896 */
          34  +
        input.build()
          35  +
        /* ServerHttpBoundProtocolGenerator.kt:424 */
          36  +
    })
          37  +
    /* ServerHttpBoundProtocolGenerator.kt:408 */
          38  +
}
          39  +
          40  +
/* RustType.kt:534 */
          41  +
#[allow(clippy::unnecessary_wraps)]
          42  +
/* ServerHttpBoundProtocolGenerator.kt:445 */
          43  +
pub fn ser_response_code_required_http_response(
          44  +
    #[allow(unused_variables)] output: crate::output::ResponseCodeRequiredOutput,
          45  +
) -> std::result::Result<
          46  +
    ::aws_smithy_legacy_http_server::response::Response,
          47  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          48  +
> {
          49  +
    /* ServerHttpBoundProtocolGenerator.kt:457 */
          50  +
    Ok({
          51  +
        /* RustType.kt:534 */
          52  +
        #[allow(unused_mut)]
          53  +
        /* ServerHttpBoundProtocolGenerator.kt:547 */
          54  +
        let mut builder = ::http::Response::builder();
          55  +
        /* ServerHttpBoundProtocolGenerator.kt:633 */
          56  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
          57  +
            builder,
          58  +
            ::http::header::CONTENT_TYPE,
          59  +
            "application/json",
          60  +
        );
          61  +
        /* ServerHttpBoundProtocolGenerator.kt:737 */
          62  +
        let status = output.response_code
          63  +
        /* ServerHttpBoundProtocolGenerator.kt:737 */;
          64  +
        /* ServerHttpBoundProtocolGenerator.kt:742 */
          65  +
        let http_status: u16 = status.try_into().map_err(::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection::InvalidHttpStatusCode)?;
          66  +
        builder = builder.status(http_status);
          67  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
          68  +
        let payload =
          69  +
            /* HttpBoundProtocolPayloadGenerator.kt:235 */crate::protocol_serde::shape_response_code_required_output::ser_response_code_required_output_output_output(&output)?
          70  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */;
          71  +
        /* ServerHttpBoundProtocolGenerator.kt:699 */
          72  +
        let content_length = payload.len();
          73  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
          74  +
            builder,
          75  +
            ::http::header::CONTENT_LENGTH,
          76  +
            content_length,
          77  +
        );
          78  +
        /* ServerHttpBoundProtocolGenerator.kt:603 */
          79  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
          80  +
        /* ServerHttpBoundProtocolGenerator.kt:611 */
          81  +
        builder.body(body)?
          82  +
        /* ServerHttpBoundProtocolGenerator.kt:457 */
          83  +
    })
          84  +
    /* ServerHttpBoundProtocolGenerator.kt:445 */
          85  +
}

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

@@ -0,1 +0,25 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
           3  +
pub fn ser_response_code_required_output_output_output(
           4  +
    value: &crate::output::ResponseCodeRequiredOutput,
           5  +
) -> ::std::result::Result<String, ::aws_smithy_types::error::operation::SerializationError> {
           6  +
    /* JsonSerializerGenerator.kt:218 */
           7  +
    let mut out = ::std::string::String::new();
           8  +
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
           9  +
    /* JsonSerializerGenerator.kt:375 */
          10  +
    crate::protocol_serde::shape_response_code_required_output::ser_response_code_required_output_output(&mut object, value)?;
          11  +
    /* JsonSerializerGenerator.kt:227 */
          12  +
    object.finish();
          13  +
    Ok(out)
          14  +
    /* JsonSerializerGenerator.kt:213 */
          15  +
}
          16  +
          17  +
/* JsonSerializerGenerator.kt:358 */
          18  +
pub fn ser_response_code_required_output_output(
          19  +
    #[allow(unused_variables)] object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
          20  +
    #[allow(unused_variables)] input: &crate::output::ResponseCodeRequiredOutput,
          21  +
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          22  +
    /* JsonSerializerGenerator.kt:372 */
          23  +
    Ok(())
          24  +
    /* JsonSerializerGenerator.kt:358 */
          25  +
}

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

@@ -0,1 +0,78 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:398 */
           3  +
pub(crate) fn de_simple_list<'a, I>(
           4  +
    tokens: &mut ::std::iter::Peekable<I>,
           5  +
) -> ::std::result::Result<
           6  +
    Option<::std::vec::Vec<::std::string::String>>,
           7  +
    ::aws_smithy_json::deserialize::error::DeserializeError,
           8  +
>
           9  +
where
          10  +
    I: Iterator<
          11  +
        Item = Result<
          12  +
            ::aws_smithy_json::deserialize::Token<'a>,
          13  +
            ::aws_smithy_json::deserialize::error::DeserializeError,
          14  +
        >,
          15  +
    >,
          16  +
{
          17  +
    /* JsonParserGenerator.kt:712 */
          18  +
    match tokens.next().transpose()? {
          19  +
        /* JsonParserGenerator.kt:713 */
          20  +
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
          21  +
        Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => {
          22  +
            /* JsonParserGenerator.kt:407 */
          23  +
            let mut items = Vec::new();
          24  +
            /* JsonParserGenerator.kt:408 */
          25  +
            loop {
          26  +
                /* JsonParserGenerator.kt:409 */
          27  +
                match tokens.peek() {
          28  +
                    /* JsonParserGenerator.kt:410 */
          29  +
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
          30  +
                        /* JsonParserGenerator.kt:411 */
          31  +
                        tokens.next().transpose().unwrap();
          32  +
                        break;
          33  +
                        /* JsonParserGenerator.kt:410 */
          34  +
                    }
          35  +
                    /* JsonParserGenerator.kt:413 */
          36  +
                    _ => {
          37  +
                        /* JsonParserGenerator.kt:419 */
          38  +
                        let value =
          39  +
                            /* JsonParserGenerator.kt:354 */::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?.map(|s|
          40  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          41  +
                                    /* JsonParserGenerator.kt:348 */u.into_owned()
          42  +
                                /* JsonParserGenerator.kt:339 */)
          43  +
                            /* JsonParserGenerator.kt:354 */).transpose()?
          44  +
                        /* JsonParserGenerator.kt:419 */;
          45  +
                        /* JsonParserGenerator.kt:422 */
          46  +
                        if let Some(value) = value {
          47  +
                            items.push(value);
          48  +
                        }
          49  +
                        /* JsonParserGenerator.kt:430 */
          50  +
                        else {
          51  +
                            return Err(
          52  +
                                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
          53  +
                                    "dense list cannot contain null values",
          54  +
                                ),
          55  +
                            );
          56  +
                        }
          57  +
                        /* JsonParserGenerator.kt:413 */
          58  +
                    } /* JsonParserGenerator.kt:409 */
          59  +
                }
          60  +
                /* JsonParserGenerator.kt:408 */
          61  +
            }
          62  +
            /* JsonParserGenerator.kt:446 */
          63  +
            Ok(Some(items))
          64  +
            /* JsonParserGenerator.kt:713 */
          65  +
        }
          66  +
        /* JsonParserGenerator.kt:722 */
          67  +
        _ => {
          68  +
            /* JsonParserGenerator.kt:723 */
          69  +
            Err(
          70  +
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
          71  +
                    "expected start array or null",
          72  +
                ),
          73  +
            )
          74  +
            /* JsonParserGenerator.kt:722 */
          75  +
        } /* JsonParserGenerator.kt:712 */
          76  +
    }
          77  +
    /* JsonParserGenerator.kt:398 */
          78  +
}

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

@@ -0,1 +0,87 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:460 */
           3  +
pub(crate) fn de_simple_map<'a, I>(
           4  +
    tokens: &mut ::std::iter::Peekable<I>,
           5  +
) -> ::std::result::Result<
           6  +
    Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
           7  +
    ::aws_smithy_json::deserialize::error::DeserializeError,
           8  +
>
           9  +
where
          10  +
    I: Iterator<
          11  +
        Item = Result<
          12  +
            ::aws_smithy_json::deserialize::Token<'a>,
          13  +
            ::aws_smithy_json::deserialize::error::DeserializeError,
          14  +
        >,
          15  +
    >,
          16  +
{
          17  +
    /* JsonParserGenerator.kt:712 */
          18  +
    match tokens.next().transpose()? {
          19  +
        /* JsonParserGenerator.kt:713 */
          20  +
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
          21  +
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
          22  +
            /* JsonParserGenerator.kt:469 */
          23  +
            let mut map = ::std::collections::HashMap::new();
          24  +
            /* JsonParserGenerator.kt:684 */
          25  +
            loop {
          26  +
                /* JsonParserGenerator.kt:685 */
          27  +
                match tokens.next().transpose()? {
          28  +
                    /* JsonParserGenerator.kt:686 */
          29  +
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
          30  +
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
          31  +
                        /* JsonParserGenerator.kt:471 */
          32  +
                        let key =
          33  +
                            /* JsonParserGenerator.kt:339 */key.to_unescaped().map(|u|
          34  +
                                /* JsonParserGenerator.kt:348 */u.into_owned()
          35  +
                            /* JsonParserGenerator.kt:339 */)
          36  +
                        /* JsonParserGenerator.kt:471 */?;
          37  +
                        /* JsonParserGenerator.kt:474 */
          38  +
                        let value =
          39  +
                            /* JsonParserGenerator.kt:354 */::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?.map(|s|
          40  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          41  +
                                    /* JsonParserGenerator.kt:348 */u.into_owned()
          42  +
                                /* JsonParserGenerator.kt:339 */)
          43  +
                            /* JsonParserGenerator.kt:354 */).transpose()?
          44  +
                        /* JsonParserGenerator.kt:474 */;
          45  +
                        /* JsonParserGenerator.kt:481 */
          46  +
                        match value {
          47  +
                            Some(value) => {
          48  +
                                map.insert(key, value);
          49  +
                            }
          50  +
                            None => {
          51  +
                                return Err(
          52  +
                                    ::aws_smithy_json::deserialize::error::DeserializeError::custom(
          53  +
                                        "dense map cannot contain null values",
          54  +
                                    ),
          55  +
                                )
          56  +
                            }
          57  +
                        }
          58  +
                        /* JsonParserGenerator.kt:686 */
          59  +
                    }
          60  +
                    /* JsonParserGenerator.kt:695 */
          61  +
                    other => {
          62  +
                        return Err(
          63  +
                            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
          64  +
                                format!("expected object key or end object, found: {other:?}"),
          65  +
                            ),
          66  +
                        )
          67  +
                    } /* JsonParserGenerator.kt:685 */
          68  +
                }
          69  +
                /* JsonParserGenerator.kt:684 */
          70  +
            }
          71  +
            /* JsonParserGenerator.kt:504 */
          72  +
            Ok(Some(map))
          73  +
            /* JsonParserGenerator.kt:713 */
          74  +
        }
          75  +
        /* JsonParserGenerator.kt:722 */
          76  +
        _ => {
          77  +
            /* JsonParserGenerator.kt:723 */
          78  +
            Err(
          79  +
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
          80  +
                    "expected start object or null",
          81  +
                ),
          82  +
            )
          83  +
            /* JsonParserGenerator.kt:722 */
          84  +
        } /* JsonParserGenerator.kt:712 */
          85  +
    }
          86  +
    /* JsonParserGenerator.kt:460 */
          87  +
}

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

@@ -0,1 +0,303 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:534 */
           3  +
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ServerHttpBoundProtocolGenerator.kt:408 */
           5  +
pub async fn de_simple_scalar_properties_http_request<B>(
           6  +
    #[allow(unused_variables)] request: ::http::Request<B>,
           7  +
) -> std::result::Result<
           8  +
    crate::input::SimpleScalarPropertiesInput,
           9  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
          10  +
>
          11  +
where
          12  +
    B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
          13  +
    B::Data: Send,
          14  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection:
          15  +
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
          16  +
{
          17  +
    /* ServerHttpBoundProtocolGenerator.kt:424 */
          18  +
    Ok({
          19  +
        /* RustType.kt:534 */
          20  +
        #[allow(unused_mut)]
          21  +
        /* ServerHttpBoundProtocolGenerator.kt:759 */
          22  +
        let mut input = crate::input::simple_scalar_properties_input::Builder::default();
          23  +
        /* RustType.kt:534 */
          24  +
        #[allow(unused_variables)]
          25  +
        /* ServerHttpBoundProtocolGenerator.kt:764 */
          26  +
        let ::aws_smithy_runtime_api::http::RequestParts {
          27  +
            uri, headers, body, ..
          28  +
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          29  +
        /* ServerHttpBoundProtocolGenerator.kt:801 */
          30  +
        let bytes = ::hyper::body::to_bytes(body).await?;
          31  +
        /* ServerHttpBoundProtocolGenerator.kt:825 */
          32  +
        if !bytes.is_empty() {
          33  +
            /* ServerHttpBoundProtocolGenerator.kt:826 */
          34  +
            ::aws_smithy_legacy_http_server::protocol::content_type_header_classifier_smithy(
          35  +
                &headers,
          36  +
                Some("application/json"),
          37  +
            )?;
          38  +
            input =
          39  +
                crate::protocol_serde::shape_simple_scalar_properties::de_simple_scalar_properties(
          40  +
                    bytes.as_ref(),
          41  +
                    input,
          42  +
                )?;
          43  +
            /* ServerHttpBoundProtocolGenerator.kt:825 */
          44  +
        }
          45  +
        /* ServerHttpBoundProtocolGenerator.kt:856 */
          46  +
        if let Some(value) =
          47  +
            crate::protocol_serde::shape_simple_scalar_properties_input::de_foo_header(&headers)?
          48  +
        {
          49  +
            input = input.set_foo(Some(value))
          50  +
        }
          51  +
        /* ServerHttpBoundProtocolGenerator.kt:896 */
          52  +
        input.build()
          53  +
        /* ServerHttpBoundProtocolGenerator.kt:424 */
          54  +
    })
          55  +
    /* ServerHttpBoundProtocolGenerator.kt:408 */
          56  +
}
          57  +
          58  +
/* RustType.kt:534 */
          59  +
#[allow(clippy::unnecessary_wraps)]
          60  +
/* ServerHttpBoundProtocolGenerator.kt:445 */
          61  +
pub fn ser_simple_scalar_properties_http_response(
          62  +
    #[allow(unused_variables)] output: crate::output::SimpleScalarPropertiesOutput,
          63  +
) -> std::result::Result<
          64  +
    ::aws_smithy_legacy_http_server::response::Response,
          65  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          66  +
> {
          67  +
    /* ServerHttpBoundProtocolGenerator.kt:457 */
          68  +
    Ok({
          69  +
        /* RustType.kt:534 */
          70  +
        #[allow(unused_mut)]
          71  +
        /* ServerHttpBoundProtocolGenerator.kt:547 */
          72  +
        let mut builder = ::http::Response::builder();
          73  +
        /* ServerHttpBoundProtocolGenerator.kt:665 */
          74  +
        builder = crate::protocol_serde::shape_simple_scalar_properties::ser_simple_scalar_properties_headers(&output, builder)?;
          75  +
        /* ServerHttpBoundProtocolGenerator.kt:633 */
          76  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
          77  +
            builder,
          78  +
            ::http::header::CONTENT_TYPE,
          79  +
            "application/json",
          80  +
        );
          81  +
        /* ServerHttpBoundProtocolGenerator.kt:718 */
          82  +
        let http_status: u16 = 200;
          83  +
        builder = builder.status(http_status);
          84  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
          85  +
        let payload =
          86  +
            /* HttpBoundProtocolPayloadGenerator.kt:235 */crate::protocol_serde::shape_simple_scalar_properties_output::ser_simple_scalar_properties_output_output_output(&output)?
          87  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */;
          88  +
        /* ServerHttpBoundProtocolGenerator.kt:699 */
          89  +
        let content_length = payload.len();
          90  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
          91  +
            builder,
          92  +
            ::http::header::CONTENT_LENGTH,
          93  +
            content_length,
          94  +
        );
          95  +
        /* ServerHttpBoundProtocolGenerator.kt:603 */
          96  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
          97  +
        /* ServerHttpBoundProtocolGenerator.kt:611 */
          98  +
        builder.body(body)?
          99  +
        /* ServerHttpBoundProtocolGenerator.kt:457 */
         100  +
    })
         101  +
    /* ServerHttpBoundProtocolGenerator.kt:445 */
         102  +
}
         103  +
         104  +
/* JsonParserGenerator.kt:148 */
         105  +
pub(crate) fn de_simple_scalar_properties(
         106  +
    value: &[u8],
         107  +
    mut builder: crate::input::simple_scalar_properties_input::Builder,
         108  +
) -> ::std::result::Result<
         109  +
    crate::input::simple_scalar_properties_input::Builder,
         110  +
    ::aws_smithy_json::deserialize::error::DeserializeError,
         111  +
> {
         112  +
    /* JsonParserGenerator.kt:153 */
         113  +
    let mut tokens_owned =
         114  +
        ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value))
         115  +
            .peekable();
         116  +
    let tokens = &mut tokens_owned;
         117  +
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
         118  +
    /* JsonParserGenerator.kt:684 */
         119  +
    loop {
         120  +
        /* JsonParserGenerator.kt:685 */
         121  +
        match tokens.next().transpose()? {
         122  +
            /* JsonParserGenerator.kt:686 */
         123  +
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
         124  +
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
         125  +
                /* JsonParserGenerator.kt:260 */
         126  +
                match key.to_unescaped()?.as_ref() {
         127  +
                    /* JsonParserGenerator.kt:262 */
         128  +
                    "byteValue" => {
         129  +
                        /* JsonParserGenerator.kt:272 */
         130  +
                        builder = builder.set_byte_value(
         131  +
                            /* JsonParserGenerator.kt:365 */
         132  +
                            ::aws_smithy_json::deserialize::token::expect_number_or_null(
         133  +
                                tokens.next(),
         134  +
                            )?
         135  +
                            .map(i8::try_from)
         136  +
                            .transpose()?, /* JsonParserGenerator.kt:272 */
         137  +
                        );
         138  +
                        /* JsonParserGenerator.kt:262 */
         139  +
                    }
         140  +
                    /* JsonParserGenerator.kt:262 */
         141  +
                    "DoubleDribble" => {
         142  +
                        /* JsonParserGenerator.kt:272 */
         143  +
                        builder = builder.set_double_value(
         144  +
                            /* JsonParserGenerator.kt:363 */
         145  +
                            ::aws_smithy_json::deserialize::token::expect_number_or_null(
         146  +
                                tokens.next(),
         147  +
                            )?
         148  +
                            .map(|v| v.to_f64_lossy()), /* JsonParserGenerator.kt:272 */
         149  +
                        );
         150  +
                        /* JsonParserGenerator.kt:262 */
         151  +
                    }
         152  +
                    /* JsonParserGenerator.kt:262 */
         153  +
                    "falseBooleanValue" => {
         154  +
                        /* JsonParserGenerator.kt:272 */
         155  +
                        builder = builder.set_false_boolean_value(
         156  +
                            /* JsonParserGenerator.kt:298 */
         157  +
                            ::aws_smithy_json::deserialize::token::expect_bool_or_null(
         158  +
                                tokens.next(),
         159  +
                            )?, /* JsonParserGenerator.kt:272 */
         160  +
                        );
         161  +
                        /* JsonParserGenerator.kt:262 */
         162  +
                    }
         163  +
                    /* JsonParserGenerator.kt:262 */
         164  +
                    "floatValue" => {
         165  +
                        /* JsonParserGenerator.kt:272 */
         166  +
                        builder = builder.set_float_value(
         167  +
                            /* JsonParserGenerator.kt:361 */
         168  +
                            ::aws_smithy_json::deserialize::token::expect_number_or_null(
         169  +
                                tokens.next(),
         170  +
                            )?
         171  +
                            .map(|v| v.to_f32_lossy()), /* JsonParserGenerator.kt:272 */
         172  +
                        );
         173  +
                        /* JsonParserGenerator.kt:262 */
         174  +
                    }
         175  +
                    /* JsonParserGenerator.kt:262 */
         176  +
                    "integerValue" => {
         177  +
                        /* JsonParserGenerator.kt:272 */
         178  +
                        builder = builder.set_integer_value(
         179  +
                            /* JsonParserGenerator.kt:365 */
         180  +
                            ::aws_smithy_json::deserialize::token::expect_number_or_null(
         181  +
                                tokens.next(),
         182  +
                            )?
         183  +
                            .map(i32::try_from)
         184  +
                            .transpose()?, /* JsonParserGenerator.kt:272 */
         185  +
                        );
         186  +
                        /* JsonParserGenerator.kt:262 */
         187  +
                    }
         188  +
                    /* JsonParserGenerator.kt:262 */
         189  +
                    "longValue" => {
         190  +
                        /* JsonParserGenerator.kt:272 */
         191  +
                        builder = builder.set_long_value(
         192  +
                            /* JsonParserGenerator.kt:365 */
         193  +
                            ::aws_smithy_json::deserialize::token::expect_number_or_null(
         194  +
                                tokens.next(),
         195  +
                            )?
         196  +
                            .map(i64::try_from)
         197  +
                            .transpose()?, /* JsonParserGenerator.kt:272 */
         198  +
                        );
         199  +
                        /* JsonParserGenerator.kt:262 */
         200  +
                    }
         201  +
                    /* JsonParserGenerator.kt:262 */
         202  +
                    "shortValue" => {
         203  +
                        /* JsonParserGenerator.kt:272 */
         204  +
                        builder = builder.set_short_value(
         205  +
                            /* JsonParserGenerator.kt:365 */
         206  +
                            ::aws_smithy_json::deserialize::token::expect_number_or_null(
         207  +
                                tokens.next(),
         208  +
                            )?
         209  +
                            .map(i16::try_from)
         210  +
                            .transpose()?, /* JsonParserGenerator.kt:272 */
         211  +
                        );
         212  +
                        /* JsonParserGenerator.kt:262 */
         213  +
                    }
         214  +
                    /* JsonParserGenerator.kt:262 */
         215  +
                    "stringValue" => {
         216  +
                        /* JsonParserGenerator.kt:272 */
         217  +
                        builder = builder.set_string_value(
         218  +
                            /* JsonParserGenerator.kt:354 */
         219  +
                            ::aws_smithy_json::deserialize::token::expect_string_or_null(
         220  +
                                tokens.next(),
         221  +
                            )?
         222  +
                            .map(|s|
         223  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
         224  +
                                    /* JsonParserGenerator.kt:348 */u.into_owned()
         225  +
                                /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
         226  +
                            .transpose()?, /* JsonParserGenerator.kt:272 */
         227  +
                        );
         228  +
                        /* JsonParserGenerator.kt:262 */
         229  +
                    }
         230  +
                    /* JsonParserGenerator.kt:262 */
         231  +
                    "trueBooleanValue" => {
         232  +
                        /* JsonParserGenerator.kt:272 */
         233  +
                        builder = builder.set_true_boolean_value(
         234  +
                            /* JsonParserGenerator.kt:298 */
         235  +
                            ::aws_smithy_json::deserialize::token::expect_bool_or_null(
         236  +
                                tokens.next(),
         237  +
                            )?, /* JsonParserGenerator.kt:272 */
         238  +
                        );
         239  +
                        /* JsonParserGenerator.kt:262 */
         240  +
                    }
         241  +
                    /* JsonParserGenerator.kt:290 */
         242  +
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
         243  +
                }
         244  +
                /* JsonParserGenerator.kt:686 */
         245  +
            }
         246  +
            /* JsonParserGenerator.kt:695 */
         247  +
            other => {
         248  +
                return Err(
         249  +
                    ::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
         250  +
                        "expected object key or end object, found: {other:?}"
         251  +
                    )),
         252  +
                )
         253  +
            } /* JsonParserGenerator.kt:685 */
         254  +
        }
         255  +
        /* JsonParserGenerator.kt:684 */
         256  +
    }
         257  +
    /* JsonParserGenerator.kt:250 */
         258  +
    if tokens.next().is_some() {
         259  +
        /* JsonParserGenerator.kt:251 */
         260  +
        return Err(
         261  +
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
         262  +
                "found more JSON tokens after completing parsing",
         263  +
            ),
         264  +
        );
         265  +
        /* JsonParserGenerator.kt:250 */
         266  +
    }
         267  +
    /* JsonParserGenerator.kt:163 */
         268  +
    Ok(builder)
         269  +
    /* JsonParserGenerator.kt:148 */
         270  +
}
         271  +
         272  +
/* HttpBindingGenerator.kt:565 */
         273  +
pub fn ser_simple_scalar_properties_headers(
         274  +
    input: &crate::output::SimpleScalarPropertiesOutput,
         275  +
    mut builder: ::http::response::Builder,
         276  +
) -> std::result::Result<::http::response::Builder, ::aws_smithy_types::error::operation::BuildError>
         277  +
{
         278  +
    /* HttpBindingGenerator.kt:615 */
         279  +
    if let ::std::option::Option::Some(inner_1) = &input.foo {
         280  +
        /* HttpBindingGenerator.kt:727 */
         281  +
        let formatted_2 = inner_1.as_str();
         282  +
        /* HttpBindingGenerator.kt:728 */
         283  +
        if !formatted_2.is_empty() {
         284  +
            /* HttpBindingGenerator.kt:729 */
         285  +
            let header_value = formatted_2;
         286  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         287  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         288  +
                    "foo",
         289  +
                    format!(
         290  +
                        "`{}` cannot be used as a header value: {}",
         291  +
                        &header_value, err
         292  +
                    ),
         293  +
                )
         294  +
            })?;
         295  +
            builder = builder.header("X-Foo", header_value);
         296  +
            /* HttpBindingGenerator.kt:728 */
         297  +
        }
         298  +
        /* HttpBindingGenerator.kt:615 */
         299  +
    }
         300  +
    /* HttpBindingGenerator.kt:578 */
         301  +
    Ok(builder)
         302  +
    /* HttpBindingGenerator.kt:565 */
         303  +
}