Server Test

Server Test

rev. 03e6e47f15dfd569240d570d98975ebba692c405 (ignoring whitespace)

Files changed:

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

@@ -0,1 +0,27 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub fn ser_map_with_enum_key_op_output_output_output(
           3  +
    value: &crate::output::MapWithEnumKeyOpOutput,
           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_map_with_enum_key_op_output::ser_map_with_enum_key_op_output_output(&mut object, value)?;
           8  +
    object.finish();
           9  +
    Ok(out)
          10  +
}
          11  +
          12  +
pub fn ser_map_with_enum_key_op_output_output(
          13  +
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
          14  +
    input: &crate::output::MapWithEnumKeyOpOutput,
          15  +
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          16  +
    if let Some(var_1) = &input.map {
          17  +
        #[allow(unused_mut)]
          18  +
        let mut object_2 = object.key("map").start_object();
          19  +
        for (key_3, value_4) in var_1 {
          20  +
            {
          21  +
                object_2.key(key_3.as_str()).string(value_4.as_str());
          22  +
            }
          23  +
        }
          24  +
        object_2.finish();
          25  +
    }
          26  +
    Ok(())
          27  +
}

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

@@ -0,1 +0,96 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
#[allow(clippy::unnecessary_wraps)]
           3  +
pub async fn de_null_in_non_sparse_http_request<B>(
           4  +
    #[allow(unused_variables)] request: ::http::Request<B>,
           5  +
) -> std::result::Result<
           6  +
    crate::input::NullInNonSparseInput,
           7  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::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::rest_json_1::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::null_in_non_sparse_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  +
        ::aws_smithy_legacy_http_server::protocol::content_type_header_classifier_smithy(
          23  +
            &headers, None,
          24  +
        )?;
          25  +
        input.build()
          26  +
    })
          27  +
}
          28  +
          29  +
#[allow(clippy::unnecessary_wraps)]
          30  +
pub fn ser_null_in_non_sparse_http_response(
          31  +
    #[allow(unused_variables)] output: crate::output::NullInNonSparseOutput,
          32  +
) -> std::result::Result<
          33  +
    ::aws_smithy_legacy_http_server::response::Response,
          34  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          35  +
> {
          36  +
    Ok({
          37  +
        #[allow(unused_mut)]
          38  +
        let mut builder = ::http::Response::builder();
          39  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
          40  +
            builder,
          41  +
            ::http::header::CONTENT_TYPE,
          42  +
            "application/json",
          43  +
        );
          44  +
        let http_status: u16 = 200;
          45  +
        builder = builder.status(http_status);
          46  +
        let payload =
          47  +
            crate::protocol_serde::shape_null_in_non_sparse_output::ser_null_in_non_sparse_output_output_output(&output)?
          48  +
        ;
          49  +
        let content_length = payload.len();
          50  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
          51  +
            builder,
          52  +
            ::http::header::CONTENT_LENGTH,
          53  +
            content_length,
          54  +
        );
          55  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
          56  +
        builder.body(body)?
          57  +
    })
          58  +
}
          59  +
          60  +
#[allow(clippy::unnecessary_wraps)]
          61  +
pub fn ser_null_in_non_sparse_http_error(
          62  +
    error: &crate::error::NullInNonSparseError,
          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  +
    Ok({
          68  +
        match error {
          69  +
            crate::error::NullInNonSparseError::ExtraError(output) => {
          70  +
                let payload =
          71  +
                    crate::protocol_serde::shape_extra_error::ser_extra_error_error(output)?;
          72  +
                #[allow(unused_mut)]
          73  +
                let mut builder = ::http::Response::builder();
          74  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
          75  +
                    builder,
          76  +
                    ::http::header::CONTENT_TYPE,
          77  +
                    "application/json",
          78  +
                );
          79  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
          80  +
                    builder,
          81  +
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
          82  +
                    "ExtraError",
          83  +
                );
          84  +
                let content_length = payload.len();
          85  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
          86  +
                    builder,
          87  +
                    ::http::header::CONTENT_LENGTH,
          88  +
                    content_length,
          89  +
                );
          90  +
                builder
          91  +
                    .status(500)
          92  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
          93  +
            }
          94  +
        }
          95  +
    })
          96  +
}

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

@@ -0,1 +0,48 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub fn ser_null_in_non_sparse_output_output_output(
           3  +
    value: &crate::output::NullInNonSparseOutput,
           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_null_in_non_sparse_output::ser_null_in_non_sparse_output_output(
           8  +
        &mut object,
           9  +
        value,
          10  +
    )?;
          11  +
    object.finish();
          12  +
    Ok(out)
          13  +
}
          14  +
          15  +
pub fn ser_null_in_non_sparse_output_output(
          16  +
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
          17  +
    input: &crate::output::NullInNonSparseOutput,
          18  +
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          19  +
    if let Some(var_1) = &input.list {
          20  +
        let mut array_2 = object.key("list").start_array();
          21  +
        for item_3 in var_1 {
          22  +
            {
          23  +
                array_2.value().string(item_3.as_str());
          24  +
            }
          25  +
        }
          26  +
        array_2.finish();
          27  +
    }
          28  +
    if let Some(var_4) = &input.map {
          29  +
        #[allow(unused_mut)]
          30  +
        let mut object_5 = object.key("map").start_object();
          31  +
        for (key_6, value_7) in var_4 {
          32  +
            {
          33  +
                object_5.key(key_6.as_str()).string(value_7.as_str());
          34  +
            }
          35  +
        }
          36  +
        object_5.finish();
          37  +
    }
          38  +
    if let Some(var_8) = &input.union {
          39  +
        #[allow(unused_mut)]
          40  +
        let mut object_9 = object.key("union").start_object();
          41  +
        crate::protocol_serde::shape_single_element_union::ser_single_element_union(
          42  +
            &mut object_9,
          43  +
            var_8,
          44  +
        )?;
          45  +
        object_9.finish();
          46  +
    }
          47  +
    Ok(())
          48  +
}

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

@@ -0,1 +0,149 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
#[allow(clippy::unnecessary_wraps)]
           3  +
pub async fn de_primitive_int_header_http_request<B>(
           4  +
    #[allow(unused_variables)] request: ::http::Request<B>,
           5  +
) -> std::result::Result<
           6  +
    crate::input::PrimitiveIntHeaderInput,
           7  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::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::rest_json_1::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::primitive_int_header_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  +
        ::aws_smithy_legacy_http_server::protocol::content_type_header_classifier_smithy(
          23  +
            &headers, None,
          24  +
        )?;
          25  +
        input.build()
          26  +
    })
          27  +
}
          28  +
          29  +
#[allow(clippy::unnecessary_wraps)]
          30  +
pub fn ser_primitive_int_header_http_response(
          31  +
    #[allow(unused_variables)] output: crate::output::PrimitiveIntHeaderOutput,
          32  +
) -> std::result::Result<
          33  +
    ::aws_smithy_legacy_http_server::response::Response,
          34  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          35  +
> {
          36  +
    Ok({
          37  +
        #[allow(unused_mut)]
          38  +
        let mut builder = ::http::Response::builder();
          39  +
        builder =
          40  +
            crate::protocol_serde::shape_primitive_int_header::ser_primitive_int_header_headers(
          41  +
                &output, builder,
          42  +
            )?;
          43  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
          44  +
            builder,
          45  +
            ::http::header::CONTENT_TYPE,
          46  +
            "application/json",
          47  +
        );
          48  +
        let http_status: u16 = 200;
          49  +
        builder = builder.status(http_status);
          50  +
        let payload =
          51  +
            crate::protocol_serde::shape_primitive_int_header_output::ser_primitive_int_header_output_output_output(&output)?
          52  +
        ;
          53  +
        let content_length = payload.len();
          54  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
          55  +
            builder,
          56  +
            ::http::header::CONTENT_LENGTH,
          57  +
            content_length,
          58  +
        );
          59  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
          60  +
        builder.body(body)?
          61  +
    })
          62  +
}
          63  +
          64  +
#[allow(clippy::unnecessary_wraps)]
          65  +
pub fn ser_primitive_int_header_http_error(
          66  +
    error: &crate::error::PrimitiveIntHeaderError,
          67  +
) -> std::result::Result<
          68  +
    ::aws_smithy_legacy_http_server::response::Response,
          69  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          70  +
> {
          71  +
    Ok({
          72  +
        match error {
          73  +
            crate::error::PrimitiveIntHeaderError::ValidationException(output) => {
          74  +
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
          75  +
                #[allow(unused_mut)]
          76  +
                let mut builder = ::http::Response::builder();
          77  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
          78  +
                    builder,
          79  +
                    ::http::header::CONTENT_TYPE,
          80  +
                    "application/json",
          81  +
                );
          82  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
          83  +
                    builder,
          84  +
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
          85  +
                    "ValidationException",
          86  +
                );
          87  +
                let content_length = payload.len();
          88  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
          89  +
                    builder,
          90  +
                    ::http::header::CONTENT_LENGTH,
          91  +
                    content_length,
          92  +
                );
          93  +
                builder
          94  +
                    .status(400)
          95  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
          96  +
            }
          97  +
            crate::error::PrimitiveIntHeaderError::ExtraError(output) => {
          98  +
                let payload =
          99  +
                    crate::protocol_serde::shape_extra_error::ser_extra_error_error(output)?;
         100  +
                #[allow(unused_mut)]
         101  +
                let mut builder = ::http::Response::builder();
         102  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
         103  +
                    builder,
         104  +
                    ::http::header::CONTENT_TYPE,
         105  +
                    "application/json",
         106  +
                );
         107  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
         108  +
                    builder,
         109  +
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
         110  +
                    "ExtraError",
         111  +
                );
         112  +
                let content_length = payload.len();
         113  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
         114  +
                    builder,
         115  +
                    ::http::header::CONTENT_LENGTH,
         116  +
                    content_length,
         117  +
                );
         118  +
                builder
         119  +
                    .status(500)
         120  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
         121  +
            }
         122  +
        }
         123  +
    })
         124  +
}
         125  +
         126  +
pub fn ser_primitive_int_header_headers(
         127  +
    input: &crate::output::PrimitiveIntHeaderOutput,
         128  +
    mut builder: ::http::response::Builder,
         129  +
) -> std::result::Result<::http::response::Builder, ::aws_smithy_types::error::operation::BuildError>
         130  +
{
         131  +
    {
         132  +
        let mut encoder = ::aws_smithy_types::primitive::Encoder::from(input.field);
         133  +
        let formatted_1 = encoder.encode();
         134  +
        if !formatted_1.is_empty() {
         135  +
            let header_value = formatted_1;
         136  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         137  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         138  +
                    "field",
         139  +
                    format!(
         140  +
                        "`{}` cannot be used as a header value: {}",
         141  +
                        &header_value, err
         142  +
                    ),
         143  +
                )
         144  +
            })?;
         145  +
            builder = builder.header("x-field", header_value);
         146  +
        }
         147  +
    }
         148  +
    Ok(builder)
         149  +
}

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

@@ -0,1 +0,17 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub fn ser_primitive_int_header_output_output_output(
           3  +
    value: &crate::output::PrimitiveIntHeaderOutput,
           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_primitive_int_header_output::ser_primitive_int_header_output_output(&mut object, value)?;
           8  +
    object.finish();
           9  +
    Ok(out)
          10  +
}
          11  +
          12  +
pub fn ser_primitive_int_header_output_output(
          13  +
    #[allow(unused_variables)] object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
          14  +
    #[allow(unused_variables)] input: &crate::output::PrimitiveIntHeaderOutput,
          15  +
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          16  +
    Ok(())
          17  +
}

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

@@ -0,1 +0,154 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
#[allow(clippy::unnecessary_wraps)]
           3  +
pub async fn de_primitive_int_op_http_request<B>(
           4  +
    #[allow(unused_variables)] request: ::http::Request<B>,
           5  +
) -> std::result::Result<
           6  +
    crate::input::PrimitiveIntOpInput,
           7  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::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::rest_json_1::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::primitive_int_op_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/json"),
          27  +
            )?;
          28  +
            input = crate::protocol_serde::shape_primitive_int_op::de_primitive_int_op(
          29  +
                bytes.as_ref(),
          30  +
                input,
          31  +
            )?;
          32  +
        }
          33  +
        input.build()
          34  +
    })
          35  +
}
          36  +
          37  +
#[allow(clippy::unnecessary_wraps)]
          38  +
pub fn ser_primitive_int_op_http_response(
          39  +
    #[allow(unused_variables)] output: crate::output::PrimitiveIntOpOutput,
          40  +
) -> std::result::Result<
          41  +
    ::aws_smithy_legacy_http_server::response::Response,
          42  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          43  +
> {
          44  +
    Ok({
          45  +
        #[allow(unused_mut)]
          46  +
        let mut builder = ::http::Response::builder();
          47  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
          48  +
            builder,
          49  +
            ::http::header::CONTENT_TYPE,
          50  +
            "application/json",
          51  +
        );
          52  +
        let http_status: u16 = 200;
          53  +
        builder = builder.status(http_status);
          54  +
        let payload =
          55  +
            crate::protocol_serde::shape_primitive_int_op_output::ser_primitive_int_op_output_output_output(&output)?
          56  +
        ;
          57  +
        let content_length = payload.len();
          58  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
          59  +
            builder,
          60  +
            ::http::header::CONTENT_LENGTH,
          61  +
            content_length,
          62  +
        );
          63  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
          64  +
        builder.body(body)?
          65  +
    })
          66  +
}
          67  +
          68  +
#[allow(clippy::unnecessary_wraps)]
          69  +
pub fn ser_primitive_int_op_http_error(
          70  +
    error: &crate::error::PrimitiveIntOpError,
          71  +
) -> std::result::Result<
          72  +
    ::aws_smithy_legacy_http_server::response::Response,
          73  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          74  +
> {
          75  +
    Ok({
          76  +
        match error {
          77  +
            crate::error::PrimitiveIntOpError::ExtraError(output) => {
          78  +
                let payload =
          79  +
                    crate::protocol_serde::shape_extra_error::ser_extra_error_error(output)?;
          80  +
                #[allow(unused_mut)]
          81  +
                let mut builder = ::http::Response::builder();
          82  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
          83  +
                    builder,
          84  +
                    ::http::header::CONTENT_TYPE,
          85  +
                    "application/json",
          86  +
                );
          87  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
          88  +
                    builder,
          89  +
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
          90  +
                    "ExtraError",
          91  +
                );
          92  +
                let content_length = payload.len();
          93  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
          94  +
                    builder,
          95  +
                    ::http::header::CONTENT_LENGTH,
          96  +
                    content_length,
          97  +
                );
          98  +
                builder
          99  +
                    .status(500)
         100  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
         101  +
            }
         102  +
        }
         103  +
    })
         104  +
}
         105  +
         106  +
pub(crate) fn de_primitive_int_op(
         107  +
    value: &[u8],
         108  +
    mut builder: crate::input::primitive_int_op_input::Builder,
         109  +
) -> ::std::result::Result<
         110  +
    crate::input::primitive_int_op_input::Builder,
         111  +
    ::aws_smithy_json::deserialize::error::DeserializeError,
         112  +
> {
         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  +
    loop {
         119  +
        match tokens.next().transpose()? {
         120  +
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
         121  +
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
         122  +
                match key.to_unescaped()?.as_ref() {
         123  +
                    "value" => {
         124  +
                        if let Some(v) =
         125  +
                            ::aws_smithy_json::deserialize::token::expect_number_or_null(
         126  +
                                tokens.next(),
         127  +
                            )?
         128  +
                            .map(i32::try_from)
         129  +
                            .transpose()?
         130  +
                        {
         131  +
                            builder = builder.set_value(v);
         132  +
                        }
         133  +
                    }
         134  +
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
         135  +
                }
         136  +
            }
         137  +
            other => {
         138  +
                return Err(
         139  +
                    ::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
         140  +
                        "expected object key or end object, found: {other:?}"
         141  +
                    )),
         142  +
                )
         143  +
            }
         144  +
        }
         145  +
    }
         146  +
    if tokens.next().is_some() {
         147  +
        return Err(
         148  +
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
         149  +
                "found more JSON tokens after completing parsing",
         150  +
            ),
         151  +
        );
         152  +
    }
         153  +
    Ok(builder)
         154  +
}

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

@@ -0,1 +0,26 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub fn ser_primitive_int_op_output_output_output(
           3  +
    value: &crate::output::PrimitiveIntOpOutput,
           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_primitive_int_op_output::ser_primitive_int_op_output_output(
           8  +
        &mut object,
           9  +
        value,
          10  +
    )?;
          11  +
    object.finish();
          12  +
    Ok(out)
          13  +
}
          14  +
          15  +
pub fn ser_primitive_int_op_output_output(
          16  +
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
          17  +
    input: &crate::output::PrimitiveIntOpOutput,
          18  +
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          19  +
    {
          20  +
        object.key("value").number(
          21  +
            #[allow(clippy::useless_conversion)]
          22  +
            ::aws_smithy_types::Number::NegInt((input.value).into()),
          23  +
        );
          24  +
    }
          25  +
    Ok(())
          26  +
}

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

@@ -0,1 +0,110 @@
           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_precedence_http_request<B>(
           4  +
    #[allow(unused_variables)] request: ::http::Request<B>,
           5  +
) -> std::result::Result<
           6  +
    crate::input::QueryPrecedenceInput,
           7  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::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::rest_json_1::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_precedence_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 query_string = uri.query().unwrap_or("");
          23  +
        let pairs = ::form_urlencoded::parse(query_string.as_bytes());
          24  +
        let mut query_params: ::std::collections::HashMap<
          25  +
            ::std::string::String,
          26  +
            ::std::string::String,
          27  +
        > = ::std::collections::HashMap::new();
          28  +
        let mut foo_seen = false;
          29  +
        for (k, v) in pairs {
          30  +
            if !foo_seen && k == "bar" {
          31  +
                input = input.set_foo(crate::protocol_serde::shape_query_precedence_input::de_foo(
          32  +
                    &v,
          33  +
                )?);
          34  +
                foo_seen = true;
          35  +
            }
          36  +
            query_params
          37  +
                .entry(String::from(k))
          38  +
                .or_insert_with(|| String::from(v));
          39  +
        }
          40  +
        input = input.set_baz(Some(query_params));
          41  +
        input.build()
          42  +
    })
          43  +
}
          44  +
          45  +
#[allow(clippy::unnecessary_wraps)]
          46  +
pub fn ser_query_precedence_http_response(
          47  +
    #[allow(unused_variables)] output: crate::output::QueryPrecedenceOutput,
          48  +
) -> std::result::Result<
          49  +
    ::aws_smithy_legacy_http_server::response::Response,
          50  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          51  +
> {
          52  +
    Ok({
          53  +
        #[allow(unused_mut)]
          54  +
        let mut builder = ::http::Response::builder();
          55  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
          56  +
            builder,
          57  +
            ::http::header::CONTENT_TYPE,
          58  +
            "application/json",
          59  +
        );
          60  +
        let http_status: u16 = 200;
          61  +
        builder = builder.status(http_status);
          62  +
        let payload = "";
          63  +
        let content_length = payload.len();
          64  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
          65  +
            builder,
          66  +
            ::http::header::CONTENT_LENGTH,
          67  +
            content_length,
          68  +
        );
          69  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
          70  +
        builder.body(body)?
          71  +
    })
          72  +
}
          73  +
          74  +
#[allow(clippy::unnecessary_wraps)]
          75  +
pub fn ser_query_precedence_http_error(
          76  +
    error: &crate::error::QueryPrecedenceError,
          77  +
) -> std::result::Result<
          78  +
    ::aws_smithy_legacy_http_server::response::Response,
          79  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          80  +
> {
          81  +
    Ok({
          82  +
        match error {
          83  +
            crate::error::QueryPrecedenceError::ExtraError(output) => {
          84  +
                let payload =
          85  +
                    crate::protocol_serde::shape_extra_error::ser_extra_error_error(output)?;
          86  +
                #[allow(unused_mut)]
          87  +
                let mut builder = ::http::Response::builder();
          88  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
          89  +
                    builder,
          90  +
                    ::http::header::CONTENT_TYPE,
          91  +
                    "application/json",
          92  +
                );
          93  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
          94  +
                    builder,
          95  +
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
          96  +
                    "ExtraError",
          97  +
                );
          98  +
                let content_length = payload.len();
          99  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
         100  +
                    builder,
         101  +
                    ::http::header::CONTENT_LENGTH,
         102  +
                    content_length,
         103  +
                );
         104  +
                builder
         105  +
                    .status(500)
         106  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
         107  +
            }
         108  +
        }
         109  +
    })
         110  +
}

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

@@ -0,1 +0,10 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub fn de_foo(
           3  +
    value: &str,
           4  +
) -> std::result::Result<
           5  +
    ::std::option::Option<::std::string::String>,
           6  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
           7  +
> {
           8  +
    let value = value.to_owned();
           9  +
    Ok(Some(value))
          10  +
}

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

@@ -0,1 +0,12 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub fn ser_single_element_union(
           3  +
    object_9: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
           4  +
    input: &crate::model::SingleElementUnion,
           5  +
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
           6  +
    match input {
           7  +
        crate::model::SingleElementUnion::A(inner) => {
           8  +
            object_9.key("a").string(inner.as_str());
           9  +
        }
          10  +
    }
          11  +
    Ok(())
          12  +
}

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

@@ -0,1 +0,97 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
#[allow(clippy::unnecessary_wraps)]
           3  +
pub async fn de_status_response_http_request<B>(
           4  +
    #[allow(unused_variables)] request: ::http::Request<B>,
           5  +
) -> std::result::Result<
           6  +
    crate::input::StatusResponseInput,
           7  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::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::rest_json_1::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::status_response_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  +
        ::aws_smithy_legacy_http_server::protocol::content_type_header_classifier_smithy(
          23  +
            &headers, None,
          24  +
        )?;
          25  +
        input.build()
          26  +
    })
          27  +
}
          28  +
          29  +
#[allow(clippy::unnecessary_wraps)]
          30  +
pub fn ser_status_response_http_response(
          31  +
    #[allow(unused_variables)] output: crate::output::StatusResponseOutput,
          32  +
) -> std::result::Result<
          33  +
    ::aws_smithy_legacy_http_server::response::Response,
          34  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          35  +
> {
          36  +
    Ok({
          37  +
        #[allow(unused_mut)]
          38  +
        let mut builder = ::http::Response::builder();
          39  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
          40  +
            builder,
          41  +
            ::http::header::CONTENT_TYPE,
          42  +
            "application/json",
          43  +
        );
          44  +
        let status = output.field;
          45  +
        let http_status: u16 = status.try_into().map_err(::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection::InvalidHttpStatusCode)?;
          46  +
        builder = builder.status(http_status);
          47  +
        let payload =
          48  +
            crate::protocol_serde::shape_status_response_output::ser_status_response_output_output_output(&output)?
          49  +
        ;
          50  +
        let content_length = payload.len();
          51  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
          52  +
            builder,
          53  +
            ::http::header::CONTENT_LENGTH,
          54  +
            content_length,
          55  +
        );
          56  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
          57  +
        builder.body(body)?
          58  +
    })
          59  +
}
          60  +
          61  +
#[allow(clippy::unnecessary_wraps)]
          62  +
pub fn ser_status_response_http_error(
          63  +
    error: &crate::error::StatusResponseError,
          64  +
) -> std::result::Result<
          65  +
    ::aws_smithy_legacy_http_server::response::Response,
          66  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          67  +
> {
          68  +
    Ok({
          69  +
        match error {
          70  +
            crate::error::StatusResponseError::ExtraError(output) => {
          71  +
                let payload =
          72  +
                    crate::protocol_serde::shape_extra_error::ser_extra_error_error(output)?;
          73  +
                #[allow(unused_mut)]
          74  +
                let mut builder = ::http::Response::builder();
          75  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
          76  +
                    builder,
          77  +
                    ::http::header::CONTENT_TYPE,
          78  +
                    "application/json",
          79  +
                );
          80  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
          81  +
                    builder,
          82  +
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
          83  +
                    "ExtraError",
          84  +
                );
          85  +
                let content_length = payload.len();
          86  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
          87  +
                    builder,
          88  +
                    ::http::header::CONTENT_LENGTH,
          89  +
                    content_length,
          90  +
                );
          91  +
                builder
          92  +
                    .status(500)
          93  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
          94  +
            }
          95  +
        }
          96  +
    })
          97  +
}

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

@@ -0,1 +0,20 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub fn ser_status_response_output_output_output(
           3  +
    value: &crate::output::StatusResponseOutput,
           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_status_response_output::ser_status_response_output_output(
           8  +
        &mut object,
           9  +
        value,
          10  +
    )?;
          11  +
    object.finish();
          12  +
    Ok(out)
          13  +
}
          14  +
          15  +
pub fn ser_status_response_output_output(
          16  +
    #[allow(unused_variables)] object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
          17  +
    #[allow(unused_variables)] input: &crate::output::StatusResponseOutput,
          18  +
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          19  +
    Ok(())
          20  +
}

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

@@ -0,1 +0,105 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
#[allow(clippy::unnecessary_wraps)]
           3  +
pub async fn de_string_payload_http_request<B>(
           4  +
    #[allow(unused_variables)] request: ::http::Request<B>,
           5  +
) -> std::result::Result<
           6  +
    crate::input::StringPayloadInput,
           7  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::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::rest_json_1::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::string_payload_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  +
        if let Some(value) = {
          23  +
            let bytes = ::hyper::body::to_bytes(body).await?;
          24  +
            if !bytes.is_empty() {
          25  +
                ::aws_smithy_legacy_http_server::protocol::content_type_header_classifier_smithy(
          26  +
                    &headers,
          27  +
                    Some("text/plain"),
          28  +
                )?;
          29  +
            }
          30  +
            crate::protocol_serde::shape_string_payload_input::de_payload_payload(&bytes)?
          31  +
        } {
          32  +
            input = input.set_payload(Some(value))
          33  +
        }
          34  +
        input.build()
          35  +
    })
          36  +
}
          37  +
          38  +
#[allow(clippy::unnecessary_wraps)]
          39  +
pub fn ser_string_payload_http_response(
          40  +
    #[allow(unused_variables)] output: crate::output::StringPayloadOutput,
          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  +
    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  +
            "text/plain",
          52  +
        );
          53  +
        let http_status: u16 = 200;
          54  +
        builder = builder.status(http_status);
          55  +
        let payload = crate::protocol_serde::shape_string_payload_output::ser_payload_http_payload(
          56  +
            output.payload,
          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  +
#[allow(clippy::unnecessary_wraps)]
          70  +
pub fn ser_string_payload_http_error(
          71  +
    error: &crate::error::StringPayloadError,
          72  +
) -> std::result::Result<
          73  +
    ::aws_smithy_legacy_http_server::response::Response,
          74  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          75  +
> {
          76  +
    Ok({
          77  +
        match error {
          78  +
            crate::error::StringPayloadError::ExtraError(output) => {
          79  +
                let payload =
          80  +
                    crate::protocol_serde::shape_extra_error::ser_extra_error_error(output)?;
          81  +
                #[allow(unused_mut)]
          82  +
                let mut builder = ::http::Response::builder();
          83  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
          84  +
                    builder,
          85  +
                    ::http::header::CONTENT_TYPE,
          86  +
                    "text/plain",
          87  +
                );
          88  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
          89  +
                    builder,
          90  +
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
          91  +
                    "ExtraError",
          92  +
                );
          93  +
                let content_length = payload.len();
          94  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
          95  +
                    builder,
          96  +
                    ::http::header::CONTENT_LENGTH,
          97  +
                    content_length,
          98  +
                );
          99  +
                builder
         100  +
                    .status(500)
         101  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
         102  +
            }
         103  +
        }
         104  +
    })
         105  +
}

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

@@ -0,1 +0,14 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub(crate) fn de_payload_payload(
           3  +
    body: &[u8],
           4  +
) -> std::result::Result<
           5  +
    ::std::option::Option<::std::string::String>,
           6  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
           7  +
> {
           8  +
    (!body.is_empty())
           9  +
        .then(|| {
          10  +
            let body_str = std::str::from_utf8(body)?;
          11  +
            Ok(body_str.to_string())
          12  +
        })
          13  +
        .transpose()
          14  +
}

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

@@ -0,1 +0,10 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub fn ser_payload_http_payload(
           3  +
    payload: ::std::option::Option<::std::string::String>,
           4  +
) -> ::std::result::Result<::std::vec::Vec<u8>, ::aws_smithy_types::error::operation::BuildError> {
           5  +
    let payload = match payload {
           6  +
        Some(t) => t,
           7  +
        None => return Ok(Vec::new()),
           8  +
    };
           9  +
    Ok(payload.into_bytes())
          10  +
}

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

@@ -0,1 +0,35 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub fn ser_validation_exception_error(
           3  +
    value: &crate::error::ValidationException,
           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_validation_exception::ser_validation_exception(
           8  +
        &mut object,
           9  +
        value,
          10  +
    )?;
          11  +
    object.finish();
          12  +
    Ok(out)
          13  +
}
          14  +
          15  +
pub fn ser_validation_exception(
          16  +
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
          17  +
    input: &crate::error::ValidationException,
          18  +
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          19  +
    if let Some(var_1) = &input.field_list {
          20  +
        let mut array_2 = object.key("fieldList").start_array();
          21  +
        for item_3 in var_1 {
          22  +
            {
          23  +
                #[allow(unused_mut)]
          24  +
                let mut object_4 = array_2.value().start_object();
          25  +
                crate::protocol_serde::shape_validation_exception_field::ser_validation_exception_field(&mut object_4, item_3)?;
          26  +
                object_4.finish();
          27  +
            }
          28  +
        }
          29  +
        array_2.finish();
          30  +
    }
          31  +
    {
          32  +
        object.key("message").string(input.message.as_str());
          33  +
    }
          34  +
    Ok(())
          35  +
}