Server Test Python

Server Test Python

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943 (ignoring whitespace)

Files changed:

tmp-codegen-diff/codegen-server-test-python/json_rpc11/rust-server-codegen-python/src/protocol_serde/shape_foo_error.rs

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

tmp-codegen-diff/codegen-server-test-python/json_rpc11/rust-server-codegen-python/src/protocol_serde/shape_fractional_seconds.rs

@@ -1,1 +87,124 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:516 */
    2      3   
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ServerHttpBoundProtocolGenerator.kt:383 */
    3      5   
pub async fn de_fractional_seconds_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::FractionalSecondsInput,
    7      9   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection,
    8     10   
>
    9     11   
where
   10     12   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11     13   
    B::Data: Send,
   12     14   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection:
   13     15   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     16   
{
          17  +
    /* ServerHttpBoundProtocolGenerator.kt:399 */
   15     18   
    Ok({
          19  +
        /* RustType.kt:516 */
   16     20   
        #[allow(unused_mut)]
          21  +
        /* ServerHttpBoundProtocolGenerator.kt:723 */
   17     22   
        let mut input = crate::input::fractional_seconds_input_internal::Builder::default();
          23  +
        /* RustType.kt:516 */
   18     24   
        #[allow(unused_variables)]
          25  +
        /* ServerHttpBoundProtocolGenerator.kt:728 */
   19     26   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     27   
            uri, headers, body, ..
   21     28   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          29  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   22     30   
        input.build()
          31  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   23     32   
    })
          33  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   24     34   
}
   25     35   
          36  +
/* RustType.kt:516 */
   26     37   
#[allow(clippy::unnecessary_wraps)]
          38  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   27     39   
pub fn ser_fractional_seconds_http_response(
   28     40   
    #[allow(unused_variables)] output: crate::output::FractionalSecondsOutput,
   29     41   
) -> std::result::Result<
   30     42   
    ::aws_smithy_http_server::response::Response,
   31     43   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   32     44   
> {
          45  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   33     46   
    Ok({
          47  +
        /* RustType.kt:516 */
   34     48   
        #[allow(unused_mut)]
          49  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   35     50   
        let mut builder = ::http::Response::builder();
          51  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   36     52   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   37     53   
            builder,
   38     54   
            ::http::header::CONTENT_TYPE,
   39     55   
            "application/x-amz-json-1.1",
   40     56   
        );
          57  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   41     58   
        let http_status: u16 = 200;
   42     59   
        builder = builder.status(http_status);
          60  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
   43     61   
        let payload =
   44         -
            crate::protocol_serde::shape_fractional_seconds_output::ser_fractional_seconds_output_output_output(&output)?
   45         -
        ;
          62  +
            /* HttpBoundProtocolPayloadGenerator.kt:237 */crate::protocol_serde::shape_fractional_seconds_output::ser_fractional_seconds_output_output_output(&output)?
          63  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
          64  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   46     65   
        let content_length = payload.len();
   47     66   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   48     67   
            builder,
   49     68   
            ::http::header::CONTENT_LENGTH,
   50     69   
            content_length,
   51     70   
        );
          71  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   52     72   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          73  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   53     74   
        builder.body(body)?
          75  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   54     76   
    })
          77  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   55     78   
}
   56     79   
          80  +
/* RustType.kt:516 */
   57     81   
#[allow(clippy::unnecessary_wraps)]
          82  +
/* ServerHttpBoundProtocolGenerator.kt:447 */
   58     83   
pub fn ser_fractional_seconds_http_error(
   59     84   
    error: &crate::error::FractionalSecondsError,
   60     85   
) -> std::result::Result<
   61     86   
    ::aws_smithy_http_server::response::Response,
   62     87   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   63     88   
> {
          89  +
    /* ServerHttpBoundProtocolGenerator.kt:452 */
   64     90   
    Ok({
          91  +
        /* ServerHttpBoundProtocolGenerator.kt:468 */
   65     92   
        match error {
          93  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
   66     94   
            crate::error::FractionalSecondsError::InternalServerError(output) => {
          95  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
   67     96   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
          97  +
                /* RustType.kt:516 */
   68     98   
                #[allow(unused_mut)]
          99  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
   69    100   
                let mut builder = ::http::Response::builder();
         101  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   70    102   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   71    103   
                    builder,
   72    104   
                    ::http::header::CONTENT_TYPE,
   73    105   
                    "application/x-amz-json-1.1",
   74    106   
                );
         107  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
   75    108   
                let content_length = payload.len();
   76    109   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   77    110   
                    builder,
   78    111   
                    ::http::header::CONTENT_LENGTH,
   79    112   
                    content_length,
   80    113   
                );
         114  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
   81    115   
                builder
   82    116   
                    .status(500)
   83    117   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         118  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
         119  +
            } /* ServerHttpBoundProtocolGenerator.kt:468 */
   84    120   
        }
   85         -
        }
         121  +
        /* ServerHttpBoundProtocolGenerator.kt:452 */
   86    122   
    })
         123  +
    /* ServerHttpBoundProtocolGenerator.kt:447 */
   87    124   
}

tmp-codegen-diff/codegen-server-test-python/json_rpc11/rust-server-codegen-python/src/protocol_serde/shape_fractional_seconds_output.rs

@@ -1,1 +25,36 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
    2      3   
pub fn ser_fractional_seconds_output_output_output(
    3      4   
    value: &crate::output::FractionalSecondsOutput,
    4      5   
) -> ::std::result::Result<String, ::aws_smithy_types::error::operation::SerializationError> {
           6  +
    /* JsonSerializerGenerator.kt:218 */
    5      7   
    let mut out = ::std::string::String::new();
    6      8   
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
           9  +
    /* JsonSerializerGenerator.kt:375 */
    7     10   
    crate::protocol_serde::shape_fractional_seconds_output::ser_fractional_seconds_output_output(
    8     11   
        &mut object,
    9     12   
        value,
   10     13   
    )?;
          14  +
    /* JsonSerializerGenerator.kt:227 */
   11     15   
    object.finish();
   12     16   
    Ok(out)
          17  +
    /* JsonSerializerGenerator.kt:213 */
   13     18   
}
   14     19   
          20  +
/* JsonSerializerGenerator.kt:358 */
   15     21   
pub fn ser_fractional_seconds_output_output(
   16     22   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   17     23   
    input: &crate::output::FractionalSecondsOutput,
   18     24   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          25  +
    /* JsonSerializerGenerator.kt:382 */
   19     26   
    if let Some(var_1) = &input.datetime {
          27  +
        /* JsonSerializerGenerator.kt:448 */
   20     28   
        object
   21     29   
            .key("datetime")
   22     30   
            .date_time(var_1, ::aws_smithy_types::date_time::Format::DateTime)?;
          31  +
        /* JsonSerializerGenerator.kt:382 */
   23     32   
    }
          33  +
    /* JsonSerializerGenerator.kt:372 */
   24     34   
    Ok(())
          35  +
    /* JsonSerializerGenerator.kt:358 */
   25     36   
}

tmp-codegen-diff/codegen-server-test-python/json_rpc11/rust-server-codegen-python/src/protocol_serde/shape_greeting_struct.rs

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

tmp-codegen-diff/codegen-server-test-python/json_rpc11/rust-server-codegen-python/src/protocol_serde/shape_greeting_with_errors.rs

@@ -1,1 +148,209 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:516 */
    2      3   
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ServerHttpBoundProtocolGenerator.kt:383 */
    3      5   
pub async fn de_greeting_with_errors_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::GreetingWithErrorsInput,
    7      9   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection,
    8     10   
>
    9     11   
where
   10     12   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11     13   
    B::Data: Send,
   12     14   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection:
   13     15   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     16   
{
          17  +
    /* ServerHttpBoundProtocolGenerator.kt:399 */
   15     18   
    Ok({
          19  +
        /* RustType.kt:516 */
   16     20   
        #[allow(unused_mut)]
          21  +
        /* ServerHttpBoundProtocolGenerator.kt:723 */
   17     22   
        let mut input = crate::input::greeting_with_errors_input_internal::Builder::default();
          23  +
        /* RustType.kt:516 */
   18     24   
        #[allow(unused_variables)]
          25  +
        /* ServerHttpBoundProtocolGenerator.kt:728 */
   19     26   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     27   
            uri, headers, body, ..
   21     28   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          29  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   22     30   
        input.build()
          31  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   23     32   
    })
          33  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   24     34   
}
   25     35   
          36  +
/* RustType.kt:516 */
   26     37   
#[allow(clippy::unnecessary_wraps)]
          38  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   27     39   
pub fn ser_greeting_with_errors_http_response(
   28     40   
    #[allow(unused_variables)] output: crate::output::GreetingWithErrorsOutput,
   29     41   
) -> std::result::Result<
   30     42   
    ::aws_smithy_http_server::response::Response,
   31     43   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   32     44   
> {
          45  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   33     46   
    Ok({
          47  +
        /* RustType.kt:516 */
   34     48   
        #[allow(unused_mut)]
          49  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   35     50   
        let mut builder = ::http::Response::builder();
          51  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   36     52   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   37     53   
            builder,
   38     54   
            ::http::header::CONTENT_TYPE,
   39     55   
            "application/x-amz-json-1.1",
   40     56   
        );
          57  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   41     58   
        let http_status: u16 = 200;
   42     59   
        builder = builder.status(http_status);
          60  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
   43     61   
        let payload =
   44         -
            crate::protocol_serde::shape_greeting_with_errors_output::ser_greeting_with_errors_output_output_output(&output)?
   45         -
        ;
          62  +
            /* HttpBoundProtocolPayloadGenerator.kt:237 */crate::protocol_serde::shape_greeting_with_errors_output::ser_greeting_with_errors_output_output_output(&output)?
          63  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
          64  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   46     65   
        let content_length = payload.len();
   47     66   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   48     67   
            builder,
   49     68   
            ::http::header::CONTENT_LENGTH,
   50     69   
            content_length,
   51     70   
        );
          71  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   52     72   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          73  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   53     74   
        builder.body(body)?
          75  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   54     76   
    })
          77  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   55     78   
}
   56     79   
          80  +
/* RustType.kt:516 */
   57     81   
#[allow(clippy::unnecessary_wraps)]
          82  +
/* ServerHttpBoundProtocolGenerator.kt:447 */
   58     83   
pub fn ser_greeting_with_errors_http_error(
   59     84   
    error: &crate::error::GreetingWithErrorsError,
   60     85   
) -> std::result::Result<
   61     86   
    ::aws_smithy_http_server::response::Response,
   62     87   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   63     88   
> {
          89  +
    /* ServerHttpBoundProtocolGenerator.kt:452 */
   64     90   
    Ok({
          91  +
        /* ServerHttpBoundProtocolGenerator.kt:468 */
   65     92   
        match error {
          93  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
   66     94   
            crate::error::GreetingWithErrorsError::InvalidGreeting(output) => {
          95  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
   67     96   
                let payload =
   68     97   
                    crate::protocol_serde::shape_invalid_greeting::ser_invalid_greeting_error(
   69     98   
                        output,
   70     99   
                    )?;
         100  +
                /* RustType.kt:516 */
   71    101   
                #[allow(unused_mut)]
         102  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
   72    103   
                let mut builder = ::http::Response::builder();
         104  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   73    105   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   74    106   
                    builder,
   75    107   
                    ::http::header::CONTENT_TYPE,
   76    108   
                    "application/x-amz-json-1.1",
   77    109   
                );
         110  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
   78    111   
                let content_length = payload.len();
   79    112   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   80    113   
                    builder,
   81    114   
                    ::http::header::CONTENT_LENGTH,
   82    115   
                    content_length,
   83    116   
                );
         117  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
   84    118   
                builder
   85    119   
                    .status(400)
   86    120   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         121  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
   87    122   
            }
         123  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
   88    124   
            crate::error::GreetingWithErrorsError::ComplexError(output) => {
         125  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
   89    126   
                let payload =
   90    127   
                    crate::protocol_serde::shape_complex_error::ser_complex_error_error(output)?;
         128  +
                /* RustType.kt:516 */
   91    129   
                #[allow(unused_mut)]
         130  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
   92    131   
                let mut builder = ::http::Response::builder();
         132  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   93    133   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   94    134   
                    builder,
   95    135   
                    ::http::header::CONTENT_TYPE,
   96    136   
                    "application/x-amz-json-1.1",
   97    137   
                );
         138  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
   98    139   
                let content_length = payload.len();
   99    140   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  100    141   
                    builder,
  101    142   
                    ::http::header::CONTENT_LENGTH,
  102    143   
                    content_length,
  103    144   
                );
         145  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  104    146   
                builder
  105    147   
                    .status(400)
  106    148   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         149  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
  107    150   
            }
         151  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
  108    152   
            crate::error::GreetingWithErrorsError::FooError(output) => {
         153  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
  109    154   
                let payload = crate::protocol_serde::shape_foo_error::ser_foo_error_error(output)?;
         155  +
                /* RustType.kt:516 */
  110    156   
                #[allow(unused_mut)]
         157  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
  111    158   
                let mut builder = ::http::Response::builder();
         159  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  112    160   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  113    161   
                    builder,
  114    162   
                    ::http::header::CONTENT_TYPE,
  115    163   
                    "application/x-amz-json-1.1",
  116    164   
                );
         165  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  117    166   
                let content_length = payload.len();
  118    167   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  119    168   
                    builder,
  120    169   
                    ::http::header::CONTENT_LENGTH,
  121    170   
                    content_length,
  122    171   
                );
         172  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  123    173   
                builder
  124    174   
                    .status(500)
  125    175   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         176  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
  126    177   
            }
         178  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
  127    179   
            crate::error::GreetingWithErrorsError::InternalServerError(output) => {
         180  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
  128    181   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
         182  +
                /* RustType.kt:516 */
  129    183   
                #[allow(unused_mut)]
         184  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
  130    185   
                let mut builder = ::http::Response::builder();
         186  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  131    187   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  132    188   
                    builder,
  133    189   
                    ::http::header::CONTENT_TYPE,
  134    190   
                    "application/x-amz-json-1.1",
  135    191   
                );
         192  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  136    193   
                let content_length = payload.len();
  137    194   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  138    195   
                    builder,
  139    196   
                    ::http::header::CONTENT_LENGTH,
  140    197   
                    content_length,
  141    198   
                );
         199  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  142    200   
                builder
  143    201   
                    .status(500)
  144    202   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         203  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
         204  +
            } /* ServerHttpBoundProtocolGenerator.kt:468 */
  145    205   
        }
  146         -
        }
         206  +
        /* ServerHttpBoundProtocolGenerator.kt:452 */
  147    207   
    })
         208  +
    /* ServerHttpBoundProtocolGenerator.kt:447 */
  148    209   
}

tmp-codegen-diff/codegen-server-test-python/json_rpc11/rust-server-codegen-python/src/protocol_serde/shape_greeting_with_errors_output.rs

@@ -1,1 +20,31 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
    2      3   
pub fn ser_greeting_with_errors_output_output_output(
    3      4   
    value: &crate::output::GreetingWithErrorsOutput,
    4      5   
) -> ::std::result::Result<String, ::aws_smithy_types::error::operation::SerializationError> {
           6  +
    /* JsonSerializerGenerator.kt:218 */
    5      7   
    let mut out = ::std::string::String::new();
    6      8   
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
           9  +
    /* JsonSerializerGenerator.kt:375 */
    7     10   
    crate::protocol_serde::shape_greeting_with_errors_output::ser_greeting_with_errors_output_output(&mut object, value)?;
          11  +
    /* JsonSerializerGenerator.kt:227 */
    8     12   
    object.finish();
    9     13   
    Ok(out)
          14  +
    /* JsonSerializerGenerator.kt:213 */
   10     15   
}
   11     16   
          17  +
/* JsonSerializerGenerator.kt:358 */
   12     18   
pub fn ser_greeting_with_errors_output_output(
   13     19   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   14     20   
    input: &crate::output::GreetingWithErrorsOutput,
   15     21   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          22  +
    /* JsonSerializerGenerator.kt:382 */
   16     23   
    if let Some(var_1) = &input.greeting {
          24  +
        /* JsonSerializerGenerator.kt:423 */
   17     25   
        object.key("greeting").string(var_1.as_str());
          26  +
        /* JsonSerializerGenerator.kt:382 */
   18     27   
    }
          28  +
    /* JsonSerializerGenerator.kt:372 */
   19     29   
    Ok(())
          30  +
    /* JsonSerializerGenerator.kt:358 */
   20     31   
}

tmp-codegen-diff/codegen-server-test-python/json_rpc11/rust-server-codegen-python/src/protocol_serde/shape_host_with_path_operation.rs

@@ -1,1 +85,124 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:516 */
    2      3   
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ServerHttpBoundProtocolGenerator.kt:383 */
    3      5   
pub async fn de_host_with_path_operation_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::HostWithPathOperationInput,
    7      9   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection,
    8     10   
>
    9     11   
where
   10     12   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11     13   
    B::Data: Send,
   12     14   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection:
   13     15   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     16   
{
          17  +
    /* ServerHttpBoundProtocolGenerator.kt:399 */
   15     18   
    Ok({
          19  +
        /* RustType.kt:516 */
   16     20   
        #[allow(unused_mut)]
          21  +
        /* ServerHttpBoundProtocolGenerator.kt:723 */
   17     22   
        let mut input = crate::input::host_with_path_operation_input_internal::Builder::default();
          23  +
        /* RustType.kt:516 */
   18     24   
        #[allow(unused_variables)]
          25  +
        /* ServerHttpBoundProtocolGenerator.kt:728 */
   19     26   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     27   
            uri, headers, body, ..
   21     28   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          29  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   22     30   
        input.build()
          31  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   23     32   
    })
          33  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   24     34   
}
   25     35   
          36  +
/* RustType.kt:516 */
   26     37   
#[allow(clippy::unnecessary_wraps)]
          38  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   27     39   
pub fn ser_host_with_path_operation_http_response(
   28     40   
    #[allow(unused_variables)] output: crate::output::HostWithPathOperationOutput,
   29     41   
) -> std::result::Result<
   30     42   
    ::aws_smithy_http_server::response::Response,
   31     43   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   32     44   
> {
          45  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   33     46   
    Ok({
          47  +
        /* RustType.kt:516 */
   34     48   
        #[allow(unused_mut)]
          49  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   35     50   
        let mut builder = ::http::Response::builder();
          51  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   36     52   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   37     53   
            builder,
   38     54   
            ::http::header::CONTENT_TYPE,
   39     55   
            "application/x-amz-json-1.1",
   40     56   
        );
          57  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   41     58   
        let http_status: u16 = 200;
   42     59   
        builder = builder.status(http_status);
   43         -
        let payload = "";
          60  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
          61  +
        let payload =
          62  +
            /* HttpBoundProtocolPayloadGenerator.kt:235 */""
          63  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
          64  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   44     65   
        let content_length = payload.len();
   45     66   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   46     67   
            builder,
   47     68   
            ::http::header::CONTENT_LENGTH,
   48     69   
            content_length,
   49     70   
        );
          71  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   50     72   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          73  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   51     74   
        builder.body(body)?
          75  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   52     76   
    })
          77  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   53     78   
}
   54     79   
          80  +
/* RustType.kt:516 */
   55     81   
#[allow(clippy::unnecessary_wraps)]
          82  +
/* ServerHttpBoundProtocolGenerator.kt:447 */
   56     83   
pub fn ser_host_with_path_operation_http_error(
   57     84   
    error: &crate::error::HostWithPathOperationError,
   58     85   
) -> std::result::Result<
   59     86   
    ::aws_smithy_http_server::response::Response,
   60     87   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   61     88   
> {
          89  +
    /* ServerHttpBoundProtocolGenerator.kt:452 */
   62     90   
    Ok({
          91  +
        /* ServerHttpBoundProtocolGenerator.kt:468 */
   63     92   
        match error {
          93  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
   64     94   
            crate::error::HostWithPathOperationError::InternalServerError(output) => {
          95  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
   65     96   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
          97  +
                /* RustType.kt:516 */
   66     98   
                #[allow(unused_mut)]
          99  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
   67    100   
                let mut builder = ::http::Response::builder();
         101  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   68    102   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   69    103   
                    builder,
   70    104   
                    ::http::header::CONTENT_TYPE,
   71    105   
                    "application/x-amz-json-1.1",
   72    106   
                );
         107  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
   73    108   
                let content_length = payload.len();
   74    109   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   75    110   
                    builder,
   76    111   
                    ::http::header::CONTENT_LENGTH,
   77    112   
                    content_length,
   78    113   
                );
         114  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
   79    115   
                builder
   80    116   
                    .status(500)
   81    117   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         118  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
         119  +
            } /* ServerHttpBoundProtocolGenerator.kt:468 */
   82    120   
        }
   83         -
        }
         121  +
        /* ServerHttpBoundProtocolGenerator.kt:452 */
   84    122   
    })
         123  +
    /* ServerHttpBoundProtocolGenerator.kt:447 */
   85    124   
}

tmp-codegen-diff/codegen-server-test-python/json_rpc11/rust-server-codegen-python/src/protocol_serde/shape_internal_server_error.rs

@@ -1,1 +24,36 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
    2      3   
pub fn ser_internal_server_error_error(
    3      4   
    value: &crate::error::InternalServerError,
    4      5   
) -> ::std::result::Result<String, ::aws_smithy_types::error::operation::SerializationError> {
           6  +
    /* JsonSerializerGenerator.kt:218 */
    5      7   
    let mut out = ::std::string::String::new();
    6      8   
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
           9  +
    /* JsonSerializerGenerator.kt:375 */
    7     10   
    crate::protocol_serde::shape_internal_server_error::ser_internal_server_error(
    8     11   
        &mut object,
    9     12   
        value,
   10     13   
    )?;
          14  +
    /* ServerAwsJson.kt:95 */
   11     15   
    object.key("__type").string("InternalServerError");
          16  +
    /* JsonSerializerGenerator.kt:227 */
   12     17   
    object.finish();
   13     18   
    Ok(out)
          19  +
    /* JsonSerializerGenerator.kt:213 */
   14     20   
}
   15     21   
          22  +
/* JsonSerializerGenerator.kt:358 */
   16     23   
pub fn ser_internal_server_error(
   17     24   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   18     25   
    input: &crate::error::InternalServerError,
   19     26   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          27  +
    /* SerializerUtil.kt:42 */
   20     28   
    {
          29  +
        /* JsonSerializerGenerator.kt:423 */
   21     30   
        object.key("message").string(input.message.as_str());
          31  +
        /* SerializerUtil.kt:42 */
   22     32   
    }
          33  +
    /* JsonSerializerGenerator.kt:372 */
   23     34   
    Ok(())
          35  +
    /* JsonSerializerGenerator.kt:358 */
   24     36   
}

tmp-codegen-diff/codegen-server-test-python/json_rpc11/rust-server-codegen-python/src/protocol_serde/shape_invalid_greeting.rs

@@ -1,1 +21,33 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
    2      3   
pub fn ser_invalid_greeting_error(
    3      4   
    value: &crate::error::InvalidGreeting,
    4      5   
) -> ::std::result::Result<String, ::aws_smithy_types::error::operation::SerializationError> {
           6  +
    /* JsonSerializerGenerator.kt:218 */
    5      7   
    let mut out = ::std::string::String::new();
    6      8   
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
           9  +
    /* JsonSerializerGenerator.kt:375 */
    7     10   
    crate::protocol_serde::shape_invalid_greeting::ser_invalid_greeting(&mut object, value)?;
          11  +
    /* ServerAwsJson.kt:95 */
    8     12   
    object.key("__type").string("InvalidGreeting");
          13  +
    /* JsonSerializerGenerator.kt:227 */
    9     14   
    object.finish();
   10     15   
    Ok(out)
          16  +
    /* JsonSerializerGenerator.kt:213 */
   11     17   
}
   12     18   
          19  +
/* JsonSerializerGenerator.kt:358 */
   13     20   
pub fn ser_invalid_greeting(
   14     21   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   15     22   
    input: &crate::error::InvalidGreeting,
   16     23   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          24  +
    /* JsonSerializerGenerator.kt:382 */
   17     25   
    if let Some(var_1) = &input.message {
          26  +
        /* JsonSerializerGenerator.kt:423 */
   18     27   
        object.key("Message").string(var_1.as_str());
          28  +
        /* JsonSerializerGenerator.kt:382 */
   19     29   
    }
          30  +
    /* JsonSerializerGenerator.kt:372 */
   20     31   
    Ok(())
          32  +
    /* JsonSerializerGenerator.kt:358 */
   21     33   
}

tmp-codegen-diff/codegen-server-test-python/json_rpc11/rust-server-codegen-python/src/protocol_serde/shape_json_enums.rs

@@ -1,1 +197,294 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:516 */
    2      3   
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ServerHttpBoundProtocolGenerator.kt:383 */
    3      5   
pub async fn de_json_enums_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::JsonEnumsInput,
    7      9   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection,
    8     10   
>
    9     11   
where
   10     12   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11     13   
    B::Data: Send,
   12     14   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection:
   13     15   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     16   
{
          17  +
    /* ServerHttpBoundProtocolGenerator.kt:399 */
   15     18   
    Ok({
          19  +
        /* RustType.kt:516 */
   16     20   
        #[allow(unused_mut)]
          21  +
        /* ServerHttpBoundProtocolGenerator.kt:723 */
   17     22   
        let mut input = crate::input::json_enums_input_internal::Builder::default();
          23  +
        /* RustType.kt:516 */
   18     24   
        #[allow(unused_variables)]
          25  +
        /* ServerHttpBoundProtocolGenerator.kt:728 */
   19     26   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     27   
            uri, headers, body, ..
   21     28   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          29  +
        /* ServerHttpBoundProtocolGenerator.kt:745 */
   22     30   
        let bytes = ::hyper::body::to_bytes(body).await?;
          31  +
        /* ServerHttpBoundProtocolGenerator.kt:768 */
   23     32   
        if !bytes.is_empty() {
          33  +
            /* ServerHttpBoundProtocolGenerator.kt:769 */
   24     34   
            ::aws_smithy_http_server::protocol::content_type_header_classifier_smithy(
   25     35   
                &headers,
   26     36   
                Some("application/x-amz-json-1.1"),
   27     37   
            )?;
   28     38   
            input = crate::protocol_serde::shape_json_enums::de_json_enums(bytes.as_ref(), input)?;
          39  +
            /* ServerHttpBoundProtocolGenerator.kt:768 */
   29     40   
        }
          41  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   30     42   
        input.build()?
          43  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   31     44   
    })
          45  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   32     46   
}
   33     47   
          48  +
/* RustType.kt:516 */
   34     49   
#[allow(clippy::unnecessary_wraps)]
          50  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   35     51   
pub fn ser_json_enums_http_response(
   36     52   
    #[allow(unused_variables)] output: crate::output::JsonEnumsOutput,
   37     53   
) -> std::result::Result<
   38     54   
    ::aws_smithy_http_server::response::Response,
   39     55   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   40     56   
> {
          57  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   41     58   
    Ok({
          59  +
        /* RustType.kt:516 */
   42     60   
        #[allow(unused_mut)]
          61  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   43     62   
        let mut builder = ::http::Response::builder();
          63  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   44     64   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   45     65   
            builder,
   46     66   
            ::http::header::CONTENT_TYPE,
   47     67   
            "application/x-amz-json-1.1",
   48     68   
        );
          69  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   49     70   
        let http_status: u16 = 200;
   50     71   
        builder = builder.status(http_status);
          72  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
   51     73   
        let payload =
   52         -
            crate::protocol_serde::shape_json_enums_output::ser_json_enums_output_output_output(
   53         -
                &output,
   54         -
            )?;
          74  +
            /* HttpBoundProtocolPayloadGenerator.kt:237 */crate::protocol_serde::shape_json_enums_output::ser_json_enums_output_output_output(&output)?
          75  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
          76  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   55     77   
        let content_length = payload.len();
   56     78   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   57     79   
            builder,
   58     80   
            ::http::header::CONTENT_LENGTH,
   59     81   
            content_length,
   60     82   
        );
          83  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   61     84   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          85  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   62     86   
        builder.body(body)?
          87  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   63     88   
    })
          89  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   64     90   
}
   65     91   
          92  +
/* RustType.kt:516 */
   66     93   
#[allow(clippy::unnecessary_wraps)]
          94  +
/* ServerHttpBoundProtocolGenerator.kt:447 */
   67     95   
pub fn ser_json_enums_http_error(
   68     96   
    error: &crate::error::JsonEnumsError,
   69     97   
) -> std::result::Result<
   70     98   
    ::aws_smithy_http_server::response::Response,
   71     99   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   72    100   
> {
         101  +
    /* ServerHttpBoundProtocolGenerator.kt:452 */
   73    102   
    Ok({
         103  +
        /* ServerHttpBoundProtocolGenerator.kt:468 */
   74    104   
        match error {
         105  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
   75    106   
            crate::error::JsonEnumsError::ValidationException(output) => {
         107  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
   76    108   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
         109  +
                /* RustType.kt:516 */
   77    110   
                #[allow(unused_mut)]
         111  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
   78    112   
                let mut builder = ::http::Response::builder();
         113  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   79    114   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   80    115   
                    builder,
   81    116   
                    ::http::header::CONTENT_TYPE,
   82    117   
                    "application/x-amz-json-1.1",
   83    118   
                );
         119  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
   84    120   
                let content_length = payload.len();
   85    121   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   86    122   
                    builder,
   87    123   
                    ::http::header::CONTENT_LENGTH,
   88    124   
                    content_length,
   89    125   
                );
         126  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
   90    127   
                builder
   91    128   
                    .status(400)
   92    129   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         130  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
   93    131   
            }
         132  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
   94    133   
            crate::error::JsonEnumsError::InternalServerError(output) => {
         134  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
   95    135   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
         136  +
                /* RustType.kt:516 */
   96    137   
                #[allow(unused_mut)]
         138  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
   97    139   
                let mut builder = ::http::Response::builder();
         140  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   98    141   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   99    142   
                    builder,
  100    143   
                    ::http::header::CONTENT_TYPE,
  101    144   
                    "application/x-amz-json-1.1",
  102    145   
                );
         146  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  103    147   
                let content_length = payload.len();
  104    148   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  105    149   
                    builder,
  106    150   
                    ::http::header::CONTENT_LENGTH,
  107    151   
                    content_length,
  108    152   
                );
         153  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  109    154   
                builder
  110    155   
                    .status(500)
  111    156   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         157  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
         158  +
            } /* ServerHttpBoundProtocolGenerator.kt:468 */
  112    159   
        }
  113         -
        }
         160  +
        /* ServerHttpBoundProtocolGenerator.kt:452 */
  114    161   
    })
         162  +
    /* ServerHttpBoundProtocolGenerator.kt:447 */
  115    163   
}
  116    164   
         165  +
/* JsonParserGenerator.kt:148 */
  117    166   
pub(crate) fn de_json_enums(
  118    167   
    value: &[u8],
  119    168   
    mut builder: crate::input::json_enums_input_internal::Builder,
  120    169   
) -> ::std::result::Result<
  121    170   
    crate::input::json_enums_input_internal::Builder,
  122    171   
    ::aws_smithy_json::deserialize::error::DeserializeError,
  123    172   
> {
         173  +
    /* JsonParserGenerator.kt:153 */
  124    174   
    let mut tokens_owned =
  125    175   
        ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value))
  126    176   
            .peekable();
  127    177   
    let tokens = &mut tokens_owned;
  128    178   
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
         179  +
    /* JsonParserGenerator.kt:684 */
  129    180   
    loop {
         181  +
        /* JsonParserGenerator.kt:685 */
  130    182   
        match tokens.next().transpose()? {
         183  +
            /* JsonParserGenerator.kt:686 */
  131    184   
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
  132    185   
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
         186  +
                /* JsonParserGenerator.kt:260 */
  133    187   
                match key.to_unescaped()?.as_ref() {
         188  +
                    /* JsonParserGenerator.kt:262 */
  134    189   
                    "fooEnum1" => {
         190  +
                        /* JsonParserGenerator.kt:272 */
  135    191   
                        builder = builder.set_foo_enum1(
         192  +
                            /* JsonParserGenerator.kt:354 */
  136    193   
                            ::aws_smithy_json::deserialize::token::expect_string_or_null(
  137    194   
                                tokens.next(),
  138    195   
                            )?
  139         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  140         -
                            .transpose()?,
         196  +
                            .map(|s|
         197  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
         198  +
                                    /* JsonParserGenerator.kt:343 */u.into_owned()
         199  +
                                /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
         200  +
                            .transpose()?, /* JsonParserGenerator.kt:272 */
  141    201   
                        );
         202  +
                        /* JsonParserGenerator.kt:262 */
  142    203   
                    }
         204  +
                    /* JsonParserGenerator.kt:262 */
  143    205   
                    "fooEnum2" => {
         206  +
                        /* JsonParserGenerator.kt:272 */
  144    207   
                        builder = builder.set_foo_enum2(
         208  +
                            /* JsonParserGenerator.kt:354 */
  145    209   
                            ::aws_smithy_json::deserialize::token::expect_string_or_null(
  146    210   
                                tokens.next(),
  147    211   
                            )?
  148         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  149         -
                            .transpose()?,
         212  +
                            .map(|s|
         213  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
         214  +
                                    /* JsonParserGenerator.kt:343 */u.into_owned()
         215  +
                                /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
         216  +
                            .transpose()?, /* JsonParserGenerator.kt:272 */
  150    217   
                        );
         218  +
                        /* JsonParserGenerator.kt:262 */
  151    219   
                    }
         220  +
                    /* JsonParserGenerator.kt:262 */
  152    221   
                    "fooEnum3" => {
         222  +
                        /* JsonParserGenerator.kt:272 */
  153    223   
                        builder = builder.set_foo_enum3(
         224  +
                            /* JsonParserGenerator.kt:354 */
  154    225   
                            ::aws_smithy_json::deserialize::token::expect_string_or_null(
  155    226   
                                tokens.next(),
  156    227   
                            )?
  157         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  158         -
                            .transpose()?,
         228  +
                            .map(|s|
         229  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
         230  +
                                    /* JsonParserGenerator.kt:343 */u.into_owned()
         231  +
                                /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
         232  +
                            .transpose()?, /* JsonParserGenerator.kt:272 */
  159    233   
                        );
         234  +
                        /* JsonParserGenerator.kt:262 */
  160    235   
                    }
         236  +
                    /* JsonParserGenerator.kt:262 */
  161    237   
                    "fooEnumList" => {
  162         -
                        builder = builder.set_foo_enum_list(
  163         -
                            crate::protocol_serde::shape_foo_enum_list::de_foo_enum_list(tokens)?,
         238  +
                        /* JsonParserGenerator.kt:272 */
         239  +
                        builder =
         240  +
                            builder.set_foo_enum_list(
         241  +
                                /* JsonParserGenerator.kt:451 */
         242  +
                                crate::protocol_serde::shape_foo_enum_list::de_foo_enum_list(
         243  +
                                    tokens,
         244  +
                                )?, /* JsonParserGenerator.kt:272 */
  164    245   
                            );
         246  +
                        /* JsonParserGenerator.kt:262 */
  165    247   
                    }
         248  +
                    /* JsonParserGenerator.kt:262 */
  166    249   
                    "fooEnumSet" => {
         250  +
                        /* JsonParserGenerator.kt:272 */
  167    251   
                        builder = builder.set_foo_enum_set(
  168         -
                            crate::protocol_serde::shape_foo_enum_set::de_foo_enum_set(tokens)?,
  169         -
                        );
         252  +
                            /* JsonParserGenerator.kt:451 */crate::protocol_serde::shape_foo_enum_set::de_foo_enum_set(tokens)?
         253  +
                        /* JsonParserGenerator.kt:272 */);
         254  +
                        /* JsonParserGenerator.kt:262 */
  170    255   
                    }
         256  +
                    /* JsonParserGenerator.kt:262 */
  171    257   
                    "fooEnumMap" => {
         258  +
                        /* JsonParserGenerator.kt:272 */
  172    259   
                        builder = builder.set_foo_enum_map(
  173         -
                            crate::protocol_serde::shape_foo_enum_map::de_foo_enum_map(tokens)?,
  174         -
                        );
         260  +
                            /* JsonParserGenerator.kt:509 */crate::protocol_serde::shape_foo_enum_map::de_foo_enum_map(tokens)?
         261  +
                        /* JsonParserGenerator.kt:272 */);
         262  +
                        /* JsonParserGenerator.kt:262 */
  175    263   
                    }
  176         -
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
         264  +
                    /* JsonParserGenerator.kt:290 */
         265  +
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
  177    266   
                }
         267  +
                /* JsonParserGenerator.kt:686 */
  178    268   
            }
         269  +
            /* JsonParserGenerator.kt:695 */
  179    270   
            other => {
  180    271   
                return Err(
  181    272   
                    ::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  182    273   
                        "expected object key or end object, found: {:?}",
  183    274   
                        other
  184    275   
                    )),
  185    276   
                )
         277  +
            } /* JsonParserGenerator.kt:685 */
  186    278   
        }
         279  +
        /* JsonParserGenerator.kt:684 */
  187    280   
    }
  188         -
    }
         281  +
    /* JsonParserGenerator.kt:250 */
  189    282   
    if tokens.next().is_some() {
         283  +
        /* JsonParserGenerator.kt:251 */
  190    284   
        return Err(
  191    285   
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
  192    286   
                "found more JSON tokens after completing parsing",
  193    287   
            ),
  194    288   
        );
         289  +
        /* JsonParserGenerator.kt:250 */
  195    290   
    }
         291  +
    /* JsonParserGenerator.kt:163 */
  196    292   
    Ok(builder)
         293  +
    /* JsonParserGenerator.kt:148 */
  197    294   
}

tmp-codegen-diff/codegen-server-test-python/json_rpc11/rust-server-codegen-python/src/protocol_serde/shape_json_enums_output.rs

@@ -1,1 +57,102 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
    2      3   
pub fn ser_json_enums_output_output_output(
    3      4   
    value: &crate::output::JsonEnumsOutput,
    4      5   
) -> ::std::result::Result<String, ::aws_smithy_types::error::operation::SerializationError> {
           6  +
    /* JsonSerializerGenerator.kt:218 */
    5      7   
    let mut out = ::std::string::String::new();
    6      8   
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
           9  +
    /* JsonSerializerGenerator.kt:375 */
    7     10   
    crate::protocol_serde::shape_json_enums_output::ser_json_enums_output_output(
    8     11   
        &mut object,
    9     12   
        value,
   10     13   
    )?;
          14  +
    /* JsonSerializerGenerator.kt:227 */
   11     15   
    object.finish();
   12     16   
    Ok(out)
          17  +
    /* JsonSerializerGenerator.kt:213 */
   13     18   
}
   14     19   
          20  +
/* JsonSerializerGenerator.kt:358 */
   15     21   
pub fn ser_json_enums_output_output(
   16     22   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   17     23   
    input: &crate::output::JsonEnumsOutput,
   18     24   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          25  +
    /* JsonSerializerGenerator.kt:382 */
   19     26   
    if let Some(var_1) = &input.foo_enum1 {
          27  +
        /* JsonSerializerGenerator.kt:423 */
   20     28   
        object.key("fooEnum1").string(var_1.as_str());
          29  +
        /* JsonSerializerGenerator.kt:382 */
   21     30   
    }
          31  +
    /* JsonSerializerGenerator.kt:382 */
   22     32   
    if let Some(var_2) = &input.foo_enum2 {
          33  +
        /* JsonSerializerGenerator.kt:423 */
   23     34   
        object.key("fooEnum2").string(var_2.as_str());
          35  +
        /* JsonSerializerGenerator.kt:382 */
   24     36   
    }
          37  +
    /* JsonSerializerGenerator.kt:382 */
   25     38   
    if let Some(var_3) = &input.foo_enum3 {
          39  +
        /* JsonSerializerGenerator.kt:423 */
   26     40   
        object.key("fooEnum3").string(var_3.as_str());
          41  +
        /* JsonSerializerGenerator.kt:382 */
   27     42   
    }
          43  +
    /* JsonSerializerGenerator.kt:382 */
   28     44   
    if let Some(var_4) = &input.foo_enum_list {
          45  +
        /* JsonSerializerGenerator.kt:484 */
   29     46   
        let mut array_5 = object.key("fooEnumList").start_array();
          47  +
        /* JsonSerializerGenerator.kt:524 */
   30     48   
        for item_6 in var_4 {
          49  +
            /* SerializerUtil.kt:42 */
   31     50   
            {
          51  +
                /* JsonSerializerGenerator.kt:423 */
   32     52   
                array_5.value().string(item_6.as_str());
          53  +
                /* SerializerUtil.kt:42 */
   33     54   
            }
          55  +
            /* JsonSerializerGenerator.kt:524 */
   34     56   
        }
          57  +
        /* JsonSerializerGenerator.kt:486 */
   35     58   
        array_5.finish();
          59  +
        /* JsonSerializerGenerator.kt:382 */
   36     60   
    }
          61  +
    /* JsonSerializerGenerator.kt:382 */
   37     62   
    if let Some(var_7) = &input.foo_enum_set {
          63  +
        /* JsonSerializerGenerator.kt:484 */
   38     64   
        let mut array_8 = object.key("fooEnumSet").start_array();
          65  +
        /* JsonSerializerGenerator.kt:524 */
   39     66   
        for item_9 in var_7 {
          67  +
            /* SerializerUtil.kt:42 */
   40     68   
            {
          69  +
                /* JsonSerializerGenerator.kt:423 */
   41     70   
                array_8.value().string(item_9.as_str());
          71  +
                /* SerializerUtil.kt:42 */
   42     72   
            }
          73  +
            /* JsonSerializerGenerator.kt:524 */
   43     74   
        }
          75  +
        /* JsonSerializerGenerator.kt:486 */
   44     76   
        array_8.finish();
          77  +
        /* JsonSerializerGenerator.kt:382 */
   45     78   
    }
          79  +
    /* JsonSerializerGenerator.kt:382 */
   46     80   
    if let Some(var_10) = &input.foo_enum_map {
          81  +
        /* JsonSerializerGenerator.kt:495 */
   47     82   
        #[allow(unused_mut)]
          83  +
        /* JsonSerializerGenerator.kt:496 */
   48     84   
        let mut object_11 = object.key("fooEnumMap").start_object();
          85  +
        /* JsonSerializerGenerator.kt:537 */
   49     86   
        for (key_12, value_13) in var_10 {
          87  +
            /* SerializerUtil.kt:42 */
   50     88   
            {
          89  +
                /* JsonSerializerGenerator.kt:423 */
   51     90   
                object_11.key(key_12.as_str()).string(value_13.as_str());
          91  +
                /* SerializerUtil.kt:42 */
   52     92   
            }
          93  +
            /* JsonSerializerGenerator.kt:537 */
   53     94   
        }
          95  +
        /* JsonSerializerGenerator.kt:515 */
   54     96   
        object_11.finish();
          97  +
        /* JsonSerializerGenerator.kt:382 */
   55     98   
    }
          99  +
    /* JsonSerializerGenerator.kt:372 */
   56    100   
    Ok(())
         101  +
    /* JsonSerializerGenerator.kt:358 */
   57    102   
}

tmp-codegen-diff/codegen-server-test-python/json_rpc11/rust-server-codegen-python/src/protocol_serde/shape_json_unions.rs

@@ -1,1 +161,227 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:516 */
    2      3   
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ServerHttpBoundProtocolGenerator.kt:383 */
    3      5   
pub async fn de_json_unions_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::JsonUnionsInput,
    7      9   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection,
    8     10   
>
    9     11   
where
   10     12   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11     13   
    B::Data: Send,
   12     14   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection:
   13     15   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     16   
{
          17  +
    /* ServerHttpBoundProtocolGenerator.kt:399 */
   15     18   
    Ok({
          19  +
        /* RustType.kt:516 */
   16     20   
        #[allow(unused_mut)]
          21  +
        /* ServerHttpBoundProtocolGenerator.kt:723 */
   17     22   
        let mut input = crate::input::json_unions_input_internal::Builder::default();
          23  +
        /* RustType.kt:516 */
   18     24   
        #[allow(unused_variables)]
          25  +
        /* ServerHttpBoundProtocolGenerator.kt:728 */
   19     26   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     27   
            uri, headers, body, ..
   21     28   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          29  +
        /* ServerHttpBoundProtocolGenerator.kt:745 */
   22     30   
        let bytes = ::hyper::body::to_bytes(body).await?;
          31  +
        /* ServerHttpBoundProtocolGenerator.kt:768 */
   23     32   
        if !bytes.is_empty() {
          33  +
            /* ServerHttpBoundProtocolGenerator.kt:769 */
   24     34   
            ::aws_smithy_http_server::protocol::content_type_header_classifier_smithy(
   25     35   
                &headers,
   26     36   
                Some("application/x-amz-json-1.1"),
   27     37   
            )?;
   28     38   
            input =
   29     39   
                crate::protocol_serde::shape_json_unions::de_json_unions(bytes.as_ref(), input)?;
          40  +
            /* ServerHttpBoundProtocolGenerator.kt:768 */
   30     41   
        }
          42  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   31     43   
        input.build()?
          44  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   32     45   
    })
          46  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   33     47   
}
   34     48   
          49  +
/* RustType.kt:516 */
   35     50   
#[allow(clippy::unnecessary_wraps)]
          51  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   36     52   
pub fn ser_json_unions_http_response(
   37     53   
    #[allow(unused_variables)] output: crate::output::JsonUnionsOutput,
   38     54   
) -> std::result::Result<
   39     55   
    ::aws_smithy_http_server::response::Response,
   40     56   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   41     57   
> {
          58  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   42     59   
    Ok({
          60  +
        /* RustType.kt:516 */
   43     61   
        #[allow(unused_mut)]
          62  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   44     63   
        let mut builder = ::http::Response::builder();
          64  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   45     65   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   46     66   
            builder,
   47     67   
            ::http::header::CONTENT_TYPE,
   48     68   
            "application/x-amz-json-1.1",
   49     69   
        );
          70  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   50     71   
        let http_status: u16 = 200;
   51     72   
        builder = builder.status(http_status);
          73  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
   52     74   
        let payload =
   53         -
            crate::protocol_serde::shape_json_unions_output::ser_json_unions_output_output_output(
   54         -
                &output,
   55         -
            )?;
          75  +
            /* HttpBoundProtocolPayloadGenerator.kt:237 */crate::protocol_serde::shape_json_unions_output::ser_json_unions_output_output_output(&output)?
          76  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
          77  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   56     78   
        let content_length = payload.len();
   57     79   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   58     80   
            builder,
   59     81   
            ::http::header::CONTENT_LENGTH,
   60     82   
            content_length,
   61     83   
        );
          84  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   62     85   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          86  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   63     87   
        builder.body(body)?
          88  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   64     89   
    })
          90  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   65     91   
}
   66     92   
          93  +
/* RustType.kt:516 */
   67     94   
#[allow(clippy::unnecessary_wraps)]
          95  +
/* ServerHttpBoundProtocolGenerator.kt:447 */
   68     96   
pub fn ser_json_unions_http_error(
   69     97   
    error: &crate::error::JsonUnionsError,
   70     98   
) -> std::result::Result<
   71     99   
    ::aws_smithy_http_server::response::Response,
   72    100   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   73    101   
> {
         102  +
    /* ServerHttpBoundProtocolGenerator.kt:452 */
   74    103   
    Ok({
         104  +
        /* ServerHttpBoundProtocolGenerator.kt:468 */
   75    105   
        match error {
         106  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
   76    107   
            crate::error::JsonUnionsError::ValidationException(output) => {
         108  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
   77    109   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
         110  +
                /* RustType.kt:516 */
   78    111   
                #[allow(unused_mut)]
         112  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
   79    113   
                let mut builder = ::http::Response::builder();
         114  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   80    115   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   81    116   
                    builder,
   82    117   
                    ::http::header::CONTENT_TYPE,
   83    118   
                    "application/x-amz-json-1.1",
   84    119   
                );
         120  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
   85    121   
                let content_length = payload.len();
   86    122   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   87    123   
                    builder,
   88    124   
                    ::http::header::CONTENT_LENGTH,
   89    125   
                    content_length,
   90    126   
                );
         127  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
   91    128   
                builder
   92    129   
                    .status(400)
   93    130   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         131  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
   94    132   
            }
         133  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
   95    134   
            crate::error::JsonUnionsError::InternalServerError(output) => {
         135  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
   96    136   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
         137  +
                /* RustType.kt:516 */
   97    138   
                #[allow(unused_mut)]
         139  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
   98    140   
                let mut builder = ::http::Response::builder();
         141  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   99    142   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  100    143   
                    builder,
  101    144   
                    ::http::header::CONTENT_TYPE,
  102    145   
                    "application/x-amz-json-1.1",
  103    146   
                );
         147  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  104    148   
                let content_length = payload.len();
  105    149   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  106    150   
                    builder,
  107    151   
                    ::http::header::CONTENT_LENGTH,
  108    152   
                    content_length,
  109    153   
                );
         154  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  110    155   
                builder
  111    156   
                    .status(500)
  112    157   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         158  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
         159  +
            } /* ServerHttpBoundProtocolGenerator.kt:468 */
  113    160   
        }
  114         -
        }
         161  +
        /* ServerHttpBoundProtocolGenerator.kt:452 */
  115    162   
    })
         163  +
    /* ServerHttpBoundProtocolGenerator.kt:447 */
  116    164   
}
  117    165   
         166  +
/* JsonParserGenerator.kt:148 */
  118    167   
pub(crate) fn de_json_unions(
  119    168   
    value: &[u8],
  120    169   
    mut builder: crate::input::json_unions_input_internal::Builder,
  121    170   
) -> ::std::result::Result<
  122    171   
    crate::input::json_unions_input_internal::Builder,
  123    172   
    ::aws_smithy_json::deserialize::error::DeserializeError,
  124    173   
> {
         174  +
    /* JsonParserGenerator.kt:153 */
  125    175   
    let mut tokens_owned =
  126    176   
        ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value))
  127    177   
            .peekable();
  128    178   
    let tokens = &mut tokens_owned;
  129    179   
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
         180  +
    /* JsonParserGenerator.kt:684 */
  130    181   
    loop {
         182  +
        /* JsonParserGenerator.kt:685 */
  131    183   
        match tokens.next().transpose()? {
         184  +
            /* JsonParserGenerator.kt:686 */
  132    185   
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
  133    186   
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
         187  +
                /* JsonParserGenerator.kt:260 */
  134    188   
                match key.to_unescaped()?.as_ref() {
         189  +
                    /* JsonParserGenerator.kt:262 */
  135    190   
                    "contents" => {
         191  +
                        /* JsonParserGenerator.kt:272 */
  136    192   
                        builder = builder.set_contents(
  137         -
                            crate::protocol_serde::shape_my_union::de_my_union(tokens)?,
  138         -
                        );
         193  +
                            /* JsonParserGenerator.kt:660 */crate::protocol_serde::shape_my_union::de_my_union(tokens)?
         194  +
                        /* JsonParserGenerator.kt:272 */);
         195  +
                        /* JsonParserGenerator.kt:262 */
  139    196   
                    }
  140         -
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
         197  +
                    /* JsonParserGenerator.kt:290 */
         198  +
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
  141    199   
                }
         200  +
                /* JsonParserGenerator.kt:686 */
  142    201   
            }
         202  +
            /* JsonParserGenerator.kt:695 */
  143    203   
            other => {
  144    204   
                return Err(
  145    205   
                    ::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  146    206   
                        "expected object key or end object, found: {:?}",
  147    207   
                        other
  148    208   
                    )),
  149    209   
                )
         210  +
            } /* JsonParserGenerator.kt:685 */
  150    211   
        }
         212  +
        /* JsonParserGenerator.kt:684 */
  151    213   
    }
  152         -
    }
         214  +
    /* JsonParserGenerator.kt:250 */
  153    215   
    if tokens.next().is_some() {
         216  +
        /* JsonParserGenerator.kt:251 */
  154    217   
        return Err(
  155    218   
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
  156    219   
                "found more JSON tokens after completing parsing",
  157    220   
            ),
  158    221   
        );
         222  +
        /* JsonParserGenerator.kt:250 */
  159    223   
    }
         224  +
    /* JsonParserGenerator.kt:163 */
  160    225   
    Ok(builder)
         226  +
    /* JsonParserGenerator.kt:148 */
  161    227   
}

tmp-codegen-diff/codegen-server-test-python/json_rpc11/rust-server-codegen-python/src/protocol_serde/shape_json_unions_output.rs

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

tmp-codegen-diff/codegen-server-test-python/json_rpc11/rust-server-codegen-python/src/protocol_serde/shape_kitchen_sink.rs

@@ -1,1 +455,759 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:516 */
    2      3   
pub(crate) fn de_kitchen_sink<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<crate::model::KitchenSink>,
    6      7   
    ::aws_smithy_json::deserialize::error::DeserializeError,
    7      8   
>
    8      9   
where
    9     10   
    I: Iterator<
   10     11   
        Item = Result<
   11     12   
            ::aws_smithy_json::deserialize::Token<'a>,
   12     13   
            ::aws_smithy_json::deserialize::error::DeserializeError,
   13     14   
        >,
   14     15   
    >,
   15     16   
{
          17  +
    /* JsonParserGenerator.kt:712 */
   16     18   
    match tokens.next().transpose()? {
          19  +
        /* JsonParserGenerator.kt:713 */
   17     20   
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   18     21   
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
          22  +
            /* RustType.kt:516 */
   19     23   
            #[allow(unused_mut)]
          24  +
            /* JsonParserGenerator.kt:526 */
   20     25   
            let mut builder = crate::model::kitchen_sink_internal::Builder::default();
          26  +
            /* JsonParserGenerator.kt:684 */
   21     27   
            loop {
          28  +
                /* JsonParserGenerator.kt:685 */
   22     29   
                match tokens.next().transpose()? {
          30  +
                    /* JsonParserGenerator.kt:686 */
   23     31   
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   24     32   
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
          33  +
                        /* JsonParserGenerator.kt:260 */
   25     34   
                        match key.to_unescaped()?.as_ref() {
          35  +
                            /* JsonParserGenerator.kt:262 */
   26     36   
                            "Blob" => {
          37  +
                                /* JsonParserGenerator.kt:272 */
   27     38   
                                builder = builder.set_blob(
   28         -
                                    ::aws_smithy_json::deserialize::token::expect_blob_or_null(
   29         -
                                        tokens.next(),
   30         -
                                    )?
   31         -
                                    .map(::aws_smithy_http_server_python::types::Blob::from),
   32         -
                                );
          39  +
                                    /* JsonParserGenerator.kt:326 */::aws_smithy_json::deserialize::token::expect_blob_or_null(tokens.next())?
          40  +
                                    /* PythonServerProtocolLoader.kt:48 */.map(::aws_smithy_http_server_python::types::Blob::from)
          41  +
                                /* JsonParserGenerator.kt:272 */);
          42  +
                                /* JsonParserGenerator.kt:262 */
   33     43   
                            }
          44  +
                            /* JsonParserGenerator.kt:262 */
   34     45   
                            "Boolean" => {
          46  +
                                /* JsonParserGenerator.kt:272 */
   35     47   
                                builder = builder.set_boolean(
          48  +
                                    /* JsonParserGenerator.kt:298 */
   36     49   
                                    ::aws_smithy_json::deserialize::token::expect_bool_or_null(
   37     50   
                                        tokens.next(),
   38         -
                                    )?,
          51  +
                                    )?, /* JsonParserGenerator.kt:272 */
   39     52   
                                );
          53  +
                                /* JsonParserGenerator.kt:262 */
   40     54   
                            }
          55  +
                            /* JsonParserGenerator.kt:262 */
   41     56   
                            "Double" => {
          57  +
                                /* JsonParserGenerator.kt:272 */
   42     58   
                                builder = builder.set_double(
          59  +
                                    /* JsonParserGenerator.kt:363 */
   43     60   
                                    ::aws_smithy_json::deserialize::token::expect_number_or_null(
   44     61   
                                        tokens.next(),
   45     62   
                                    )?
   46         -
                                    .map(|v| v.to_f64_lossy()),
          63  +
                                    .map(|v| v.to_f64_lossy()), /* JsonParserGenerator.kt:272 */
   47     64   
                                );
          65  +
                                /* JsonParserGenerator.kt:262 */
   48     66   
                            }
          67  +
                            /* JsonParserGenerator.kt:262 */
   49     68   
                            "EmptyStruct" => {
          69  +
                                /* JsonParserGenerator.kt:272 */
   50     70   
                                builder = builder.set_empty_struct(
          71  +
                                    /* JsonParserGenerator.kt:544 */
   51     72   
                                    crate::protocol_serde::shape_empty_struct::de_empty_struct(
   52     73   
                                        tokens,
   53         -
                                    )?,
          74  +
                                    )?, /* JsonParserGenerator.kt:272 */
   54     75   
                                );
          76  +
                                /* JsonParserGenerator.kt:262 */
   55     77   
                            }
          78  +
                            /* JsonParserGenerator.kt:262 */
   56     79   
                            "Float" => {
          80  +
                                /* JsonParserGenerator.kt:272 */
   57     81   
                                builder = builder.set_float(
          82  +
                                    /* JsonParserGenerator.kt:361 */
   58     83   
                                    ::aws_smithy_json::deserialize::token::expect_number_or_null(
   59     84   
                                        tokens.next(),
   60     85   
                                    )?
   61         -
                                    .map(|v| v.to_f32_lossy()),
          86  +
                                    .map(|v| v.to_f32_lossy()), /* JsonParserGenerator.kt:272 */
   62     87   
                                );
          88  +
                                /* JsonParserGenerator.kt:262 */
   63     89   
                            }
          90  +
                            /* JsonParserGenerator.kt:262 */
   64     91   
                            "HttpdateTimestamp" => {
          92  +
                                /* JsonParserGenerator.kt:272 */
   65     93   
                                builder = builder.set_httpdate_timestamp(
   66         -
                                    ::aws_smithy_json::deserialize::token::expect_timestamp_or_null(tokens.next(), ::aws_smithy_types::date_time::Format::HttpDate)?
   67         -
                                    .map(::aws_smithy_http_server_python::types::DateTime::from)
   68         -
                                );
          94  +
                                    /* JsonParserGenerator.kt:384 */::aws_smithy_json::deserialize::token::expect_timestamp_or_null(tokens.next(), ::aws_smithy_types::date_time::Format::HttpDate)?
          95  +
                                    /* PythonServerProtocolLoader.kt:44 */.map(::aws_smithy_http_server_python::types::DateTime::from)
          96  +
                                /* JsonParserGenerator.kt:272 */);
          97  +
                                /* JsonParserGenerator.kt:262 */
   69     98   
                            }
          99  +
                            /* JsonParserGenerator.kt:262 */
   70    100   
                            "Integer" => {
         101  +
                                /* JsonParserGenerator.kt:272 */
   71    102   
                                builder = builder.set_integer(
         103  +
                                    /* JsonParserGenerator.kt:365 */
   72    104   
                                    ::aws_smithy_json::deserialize::token::expect_number_or_null(
   73    105   
                                        tokens.next(),
   74    106   
                                    )?
   75    107   
                                    .map(i32::try_from)
   76         -
                                    .transpose()?,
         108  +
                                    .transpose()?, /* JsonParserGenerator.kt:272 */
   77    109   
                                );
         110  +
                                /* JsonParserGenerator.kt:262 */
   78    111   
                            }
         112  +
                            /* JsonParserGenerator.kt:262 */
   79    113   
                            "Iso8601Timestamp" => {
         114  +
                                /* JsonParserGenerator.kt:272 */
   80    115   
                                builder = builder.set_iso8601_timestamp(
   81         -
                                    ::aws_smithy_json::deserialize::token::expect_timestamp_or_null(tokens.next(), ::aws_smithy_types::date_time::Format::DateTime)?
   82         -
                                    .map(::aws_smithy_http_server_python::types::DateTime::from)
   83         -
                                );
         116  +
                                    /* JsonParserGenerator.kt:384 */::aws_smithy_json::deserialize::token::expect_timestamp_or_null(tokens.next(), ::aws_smithy_types::date_time::Format::DateTime)?
         117  +
                                    /* PythonServerProtocolLoader.kt:44 */.map(::aws_smithy_http_server_python::types::DateTime::from)
         118  +
                                /* JsonParserGenerator.kt:272 */);
         119  +
                                /* JsonParserGenerator.kt:262 */
   84    120   
                            }
         121  +
                            /* JsonParserGenerator.kt:262 */
   85    122   
                            "JsonValue" => {
         123  +
                                /* JsonParserGenerator.kt:272 */
   86    124   
                                builder = builder.set_json_value(
   87         -
                                    ::aws_smithy_json::deserialize::token::expect_string_or_null(
   88         -
                                        tokens.next(),
   89         -
                                    )?
   90         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   91         -
                                    .transpose()?,
   92         -
                                );
   93         -
                            }
         125  +
                                    /* JsonParserGenerator.kt:354 */::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?.map(|s|
         126  +
                                        /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
         127  +
                                            /* JsonParserGenerator.kt:348 */u.into_owned()
         128  +
                                        /* JsonParserGenerator.kt:339 */)
         129  +
                                    /* JsonParserGenerator.kt:354 */).transpose()?
         130  +
                                /* JsonParserGenerator.kt:272 */);
         131  +
                                /* JsonParserGenerator.kt:262 */
         132  +
                            }
         133  +
                            /* JsonParserGenerator.kt:262 */
   94    134   
                            "ListOfLists" => {
         135  +
                                /* JsonParserGenerator.kt:272 */
   95    136   
                                builder = builder.set_list_of_lists(
   96         -
                                    crate::protocol_serde::shape_list_of_list_of_strings::de_list_of_list_of_strings(tokens)?
   97         -
                                );
         137  +
                                    /* JsonParserGenerator.kt:451 */crate::protocol_serde::shape_list_of_list_of_strings::de_list_of_list_of_strings(tokens)?
         138  +
                                /* JsonParserGenerator.kt:272 */);
         139  +
                                /* JsonParserGenerator.kt:262 */
   98    140   
                            }
         141  +
                            /* JsonParserGenerator.kt:262 */
   99    142   
                            "ListOfMapsOfStrings" => {
         143  +
                                /* JsonParserGenerator.kt:272 */
  100    144   
                                builder = builder.set_list_of_maps_of_strings(
  101         -
                                    crate::protocol_serde::shape_list_of_maps_of_strings::de_list_of_maps_of_strings(tokens)?
  102         -
                                );
         145  +
                                    /* JsonParserGenerator.kt:451 */crate::protocol_serde::shape_list_of_maps_of_strings::de_list_of_maps_of_strings(tokens)?
         146  +
                                /* JsonParserGenerator.kt:272 */);
         147  +
                                /* JsonParserGenerator.kt:262 */
  103    148   
                            }
         149  +
                            /* JsonParserGenerator.kt:262 */
  104    150   
                            "ListOfStrings" => {
         151  +
                                /* JsonParserGenerator.kt:272 */
  105    152   
                                builder = builder.set_list_of_strings(
  106         -
                                    crate::protocol_serde::shape_list_of_strings::de_list_of_strings(tokens)?
  107         -
                                );
         153  +
                                    /* JsonParserGenerator.kt:451 */crate::protocol_serde::shape_list_of_strings::de_list_of_strings(tokens)?
         154  +
                                /* JsonParserGenerator.kt:272 */);
         155  +
                                /* JsonParserGenerator.kt:262 */
  108    156   
                            }
         157  +
                            /* JsonParserGenerator.kt:262 */
  109    158   
                            "ListOfStructs" => {
         159  +
                                /* JsonParserGenerator.kt:272 */
  110    160   
                                builder = builder.set_list_of_structs(
  111         -
                                    crate::protocol_serde::shape_list_of_structs::de_list_of_structs(tokens)?
  112         -
                                );
         161  +
                                    /* JsonParserGenerator.kt:451 */crate::protocol_serde::shape_list_of_structs::de_list_of_structs(tokens)?
         162  +
                                /* JsonParserGenerator.kt:272 */);
         163  +
                                /* JsonParserGenerator.kt:262 */
  113    164   
                            }
         165  +
                            /* JsonParserGenerator.kt:262 */
  114    166   
                            "Long" => {
         167  +
                                /* JsonParserGenerator.kt:272 */
  115    168   
                                builder = builder.set_long(
         169  +
                                    /* JsonParserGenerator.kt:365 */
  116    170   
                                    ::aws_smithy_json::deserialize::token::expect_number_or_null(
  117    171   
                                        tokens.next(),
  118    172   
                                    )?
  119    173   
                                    .map(i64::try_from)
  120         -
                                    .transpose()?,
         174  +
                                    .transpose()?, /* JsonParserGenerator.kt:272 */
  121    175   
                                );
         176  +
                                /* JsonParserGenerator.kt:262 */
  122    177   
                            }
         178  +
                            /* JsonParserGenerator.kt:262 */
  123    179   
                            "MapOfListsOfStrings" => {
         180  +
                                /* JsonParserGenerator.kt:272 */
  124    181   
                                builder = builder.set_map_of_lists_of_strings(
  125         -
                                    crate::protocol_serde::shape_map_of_lists_of_strings::de_map_of_lists_of_strings(tokens)?
  126         -
                                );
         182  +
                                    /* JsonParserGenerator.kt:509 */crate::protocol_serde::shape_map_of_lists_of_strings::de_map_of_lists_of_strings(tokens)?
         183  +
                                /* JsonParserGenerator.kt:272 */);
         184  +
                                /* JsonParserGenerator.kt:262 */
  127    185   
                            }
         186  +
                            /* JsonParserGenerator.kt:262 */
  128    187   
                            "MapOfMaps" => {
         188  +
                                /* JsonParserGenerator.kt:272 */
  129    189   
                                builder = builder.set_map_of_maps(
  130         -
                                    crate::protocol_serde::shape_map_of_map_of_strings::de_map_of_map_of_strings(tokens)?
  131         -
                                );
         190  +
                                    /* JsonParserGenerator.kt:509 */crate::protocol_serde::shape_map_of_map_of_strings::de_map_of_map_of_strings(tokens)?
         191  +
                                /* JsonParserGenerator.kt:272 */);
         192  +
                                /* JsonParserGenerator.kt:262 */
  132    193   
                            }
         194  +
                            /* JsonParserGenerator.kt:262 */
  133    195   
                            "MapOfStrings" => {
         196  +
                                /* JsonParserGenerator.kt:272 */
  134    197   
                                builder = builder.set_map_of_strings(
         198  +
                                    /* JsonParserGenerator.kt:509 */
  135    199   
                                    crate::protocol_serde::shape_map_of_strings::de_map_of_strings(
  136    200   
                                        tokens,
  137         -
                                    )?,
         201  +
                                    )?, /* JsonParserGenerator.kt:272 */
  138    202   
                                );
         203  +
                                /* JsonParserGenerator.kt:262 */
  139    204   
                            }
         205  +
                            /* JsonParserGenerator.kt:262 */
  140    206   
                            "MapOfStructs" => {
         207  +
                                /* JsonParserGenerator.kt:272 */
  141    208   
                                builder = builder.set_map_of_structs(
         209  +
                                    /* JsonParserGenerator.kt:509 */
  142    210   
                                    crate::protocol_serde::shape_map_of_structs::de_map_of_structs(
  143    211   
                                        tokens,
  144         -
                                    )?,
         212  +
                                    )?, /* JsonParserGenerator.kt:272 */
  145    213   
                                );
         214  +
                                /* JsonParserGenerator.kt:262 */
  146    215   
                            }
         216  +
                            /* JsonParserGenerator.kt:262 */
  147    217   
                            "RecursiveList" => {
         218  +
                                /* JsonParserGenerator.kt:272 */
  148    219   
                                builder = builder.set_recursive_list(
  149         -
                                    crate::protocol_serde::shape_list_of_kitchen_sinks::de_list_of_kitchen_sinks(tokens)?
  150         -
                                );
         220  +
                                    /* JsonParserGenerator.kt:451 */crate::protocol_serde::shape_list_of_kitchen_sinks::de_list_of_kitchen_sinks(tokens)?
         221  +
                                /* JsonParserGenerator.kt:272 */);
         222  +
                                /* JsonParserGenerator.kt:262 */
  151    223   
                            }
         224  +
                            /* JsonParserGenerator.kt:262 */
  152    225   
                            "RecursiveMap" => {
         226  +
                                /* JsonParserGenerator.kt:272 */
  153    227   
                                builder = builder.set_recursive_map(
  154         -
                                    crate::protocol_serde::shape_map_of_kitchen_sinks::de_map_of_kitchen_sinks(tokens)?
  155         -
                                );
         228  +
                                    /* JsonParserGenerator.kt:509 */crate::protocol_serde::shape_map_of_kitchen_sinks::de_map_of_kitchen_sinks(tokens)?
         229  +
                                /* JsonParserGenerator.kt:272 */);
         230  +
                                /* JsonParserGenerator.kt:262 */
  156    231   
                            }
         232  +
                            /* JsonParserGenerator.kt:262 */
  157    233   
                            "RecursiveStruct" => {
         234  +
                                /* JsonParserGenerator.kt:272 */
  158    235   
                                builder = builder.set_recursive_struct(
         236  +
                                    /* JsonParserGenerator.kt:544 */
  159    237   
                                    crate::protocol_serde::shape_kitchen_sink::de_kitchen_sink(
  160    238   
                                        tokens,
  161    239   
                                    )?
  162         -
                                    .map(Box::new),
         240  +
                                    /* JsonParserGenerator.kt:314 */
         241  +
                                    .map(Box::new), /* JsonParserGenerator.kt:272 */
  163    242   
                                );
         243  +
                                /* JsonParserGenerator.kt:262 */
  164    244   
                            }
         245  +
                            /* JsonParserGenerator.kt:262 */
  165    246   
                            "SimpleStruct" => {
         247  +
                                /* JsonParserGenerator.kt:272 */
  166    248   
                                builder = builder.set_simple_struct(
         249  +
                                    /* JsonParserGenerator.kt:544 */
  167    250   
                                    crate::protocol_serde::shape_simple_struct::de_simple_struct(
  168    251   
                                        tokens,
  169         -
                                    )?,
         252  +
                                    )?, /* JsonParserGenerator.kt:272 */
  170    253   
                                );
         254  +
                                /* JsonParserGenerator.kt:262 */
  171    255   
                            }
         256  +
                            /* JsonParserGenerator.kt:262 */
  172    257   
                            "String" => {
         258  +
                                /* JsonParserGenerator.kt:272 */
  173    259   
                                builder = builder.set_string(
  174         -
                                    ::aws_smithy_json::deserialize::token::expect_string_or_null(
  175         -
                                        tokens.next(),
  176         -
                                    )?
  177         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  178         -
                                    .transpose()?,
  179         -
                                );
  180         -
                            }
         260  +
                                    /* JsonParserGenerator.kt:354 */::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?.map(|s|
         261  +
                                        /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
         262  +
                                            /* JsonParserGenerator.kt:348 */u.into_owned()
         263  +
                                        /* JsonParserGenerator.kt:339 */)
         264  +
                                    /* JsonParserGenerator.kt:354 */).transpose()?
         265  +
                                /* JsonParserGenerator.kt:272 */);
         266  +
                                /* JsonParserGenerator.kt:262 */
         267  +
                            }
         268  +
                            /* JsonParserGenerator.kt:262 */
  181    269   
                            "StructWithJsonName" => {
         270  +
                                /* JsonParserGenerator.kt:272 */
  182    271   
                                builder = builder.set_struct_with_json_name(
  183         -
                                    crate::protocol_serde::shape_struct_with_json_name::de_struct_with_json_name(tokens)?
  184         -
                                );
         272  +
                                    /* JsonParserGenerator.kt:544 */crate::protocol_serde::shape_struct_with_json_name::de_struct_with_json_name(tokens)?
         273  +
                                /* JsonParserGenerator.kt:272 */);
         274  +
                                /* JsonParserGenerator.kt:262 */
  185    275   
                            }
         276  +
                            /* JsonParserGenerator.kt:262 */
  186    277   
                            "Timestamp" => {
         278  +
                                /* JsonParserGenerator.kt:272 */
  187    279   
                                builder = builder.set_timestamp(
  188         -
                                    ::aws_smithy_json::deserialize::token::expect_timestamp_or_null(tokens.next(), ::aws_smithy_types::date_time::Format::EpochSeconds)?
  189         -
                                    .map(::aws_smithy_http_server_python::types::DateTime::from)
  190         -
                                );
         280  +
                                    /* JsonParserGenerator.kt:384 */::aws_smithy_json::deserialize::token::expect_timestamp_or_null(tokens.next(), ::aws_smithy_types::date_time::Format::EpochSeconds)?
         281  +
                                    /* PythonServerProtocolLoader.kt:44 */.map(::aws_smithy_http_server_python::types::DateTime::from)
         282  +
                                /* JsonParserGenerator.kt:272 */);
         283  +
                                /* JsonParserGenerator.kt:262 */
  191    284   
                            }
         285  +
                            /* JsonParserGenerator.kt:262 */
  192    286   
                            "UnixTimestamp" => {
         287  +
                                /* JsonParserGenerator.kt:272 */
  193    288   
                                builder = builder.set_unix_timestamp(
  194         -
                                    ::aws_smithy_json::deserialize::token::expect_timestamp_or_null(tokens.next(), ::aws_smithy_types::date_time::Format::EpochSeconds)?
  195         -
                                    .map(::aws_smithy_http_server_python::types::DateTime::from)
  196         -
                                );
         289  +
                                    /* JsonParserGenerator.kt:384 */::aws_smithy_json::deserialize::token::expect_timestamp_or_null(tokens.next(), ::aws_smithy_types::date_time::Format::EpochSeconds)?
         290  +
                                    /* PythonServerProtocolLoader.kt:44 */.map(::aws_smithy_http_server_python::types::DateTime::from)
         291  +
                                /* JsonParserGenerator.kt:272 */);
         292  +
                                /* JsonParserGenerator.kt:262 */
  197    293   
                            }
  198         -
                            _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
         294  +
                            /* JsonParserGenerator.kt:290 */
         295  +
                            _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
  199    296   
                        }
         297  +
                        /* JsonParserGenerator.kt:686 */
  200    298   
                    }
         299  +
                    /* JsonParserGenerator.kt:695 */
  201    300   
                    other => {
  202    301   
                        return Err(
  203    302   
                            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
  204    303   
                                format!("expected object key or end object, found: {:?}", other),
  205    304   
                            ),
  206    305   
                        )
         306  +
                    } /* JsonParserGenerator.kt:685 */
  207    307   
                }
         308  +
                /* JsonParserGenerator.kt:684 */
  208    309   
            }
  209         -
            }
         310  +
            /* JsonParserGenerator.kt:540 */
  210    311   
            Ok(Some(builder.build()))
         312  +
            /* JsonParserGenerator.kt:713 */
  211    313   
        }
  212         -
        _ => Err(
         314  +
        /* JsonParserGenerator.kt:722 */
         315  +
        _ => {
         316  +
            /* JsonParserGenerator.kt:723 */
         317  +
            Err(
  213    318   
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
  214    319   
                    "expected start object or null",
  215    320   
                ),
  216         -
        ),
         321  +
            )
         322  +
            /* JsonParserGenerator.kt:722 */
         323  +
        } /* JsonParserGenerator.kt:712 */
  217    324   
    }
         325  +
    /* JsonParserGenerator.kt:516 */
  218    326   
}
  219    327   
         328  +
/* JsonSerializerGenerator.kt:358 */
  220    329   
pub fn ser_kitchen_sink(
  221    330   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
  222    331   
    input: &crate::model::KitchenSink,
  223    332   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
         333  +
    /* JsonSerializerGenerator.kt:382 */
  224    334   
    if let Some(var_1) = &input.blob {
         335  +
        /* JsonSerializerGenerator.kt:439 */
  225    336   
        object
  226    337   
            .key("Blob")
  227    338   
            .string_unchecked(&::aws_smithy_types::base64::encode(var_1));
         339  +
        /* JsonSerializerGenerator.kt:382 */
  228    340   
    }
         341  +
    /* JsonSerializerGenerator.kt:382 */
  229    342   
    if let Some(var_2) = &input.boolean {
         343  +
        /* JsonSerializerGenerator.kt:424 */
  230    344   
        object.key("Boolean").boolean(*var_2);
         345  +
        /* JsonSerializerGenerator.kt:382 */
  231    346   
    }
         347  +
    /* JsonSerializerGenerator.kt:382 */
  232    348   
    if let Some(var_3) = &input.double {
         349  +
        /* JsonSerializerGenerator.kt:432 */
  233    350   
        object.key("Double").number(
  234    351   
            #[allow(clippy::useless_conversion)]
  235    352   
            ::aws_smithy_types::Number::Float((*var_3).into()),
  236    353   
        );
         354  +
        /* JsonSerializerGenerator.kt:382 */
  237    355   
    }
         356  +
    /* JsonSerializerGenerator.kt:382 */
  238    357   
    if let Some(var_4) = &input.empty_struct {
         358  +
        /* JsonSerializerGenerator.kt:495 */
  239    359   
        #[allow(unused_mut)]
         360  +
        /* JsonSerializerGenerator.kt:496 */
  240    361   
        let mut object_5 = object.key("EmptyStruct").start_object();
         362  +
        /* JsonSerializerGenerator.kt:375 */
  241    363   
        crate::protocol_serde::shape_empty_struct::ser_empty_struct(&mut object_5, var_4)?;
         364  +
        /* JsonSerializerGenerator.kt:515 */
  242    365   
        object_5.finish();
         366  +
        /* JsonSerializerGenerator.kt:382 */
  243    367   
    }
         368  +
    /* JsonSerializerGenerator.kt:382 */
  244    369   
    if let Some(var_6) = &input.float {
         370  +
        /* JsonSerializerGenerator.kt:432 */
  245    371   
        object.key("Float").number(
  246    372   
            #[allow(clippy::useless_conversion)]
  247    373   
            ::aws_smithy_types::Number::Float((*var_6).into()),
  248    374   
        );
         375  +
        /* JsonSerializerGenerator.kt:382 */
  249    376   
    }
         377  +
    /* JsonSerializerGenerator.kt:382 */
  250    378   
    if let Some(var_7) = &input.httpdate_timestamp {
         379  +
        /* JsonSerializerGenerator.kt:448 */
  251    380   
        object
  252    381   
            .key("HttpdateTimestamp")
  253    382   
            .date_time(var_7, ::aws_smithy_types::date_time::Format::HttpDate)?;
         383  +
        /* JsonSerializerGenerator.kt:382 */
  254    384   
    }
         385  +
    /* JsonSerializerGenerator.kt:382 */
  255    386   
    if let Some(var_8) = &input.integer {
         387  +
        /* JsonSerializerGenerator.kt:432 */
  256    388   
        object.key("Integer").number(
  257    389   
            #[allow(clippy::useless_conversion)]
  258    390   
            ::aws_smithy_types::Number::NegInt((*var_8).into()),
  259    391   
        );
         392  +
        /* JsonSerializerGenerator.kt:382 */
  260    393   
    }
         394  +
    /* JsonSerializerGenerator.kt:382 */
  261    395   
    if let Some(var_9) = &input.iso8601_timestamp {
         396  +
        /* JsonSerializerGenerator.kt:448 */
  262    397   
        object
  263    398   
            .key("Iso8601Timestamp")
  264    399   
            .date_time(var_9, ::aws_smithy_types::date_time::Format::DateTime)?;
         400  +
        /* JsonSerializerGenerator.kt:382 */
  265    401   
    }
         402  +
    /* JsonSerializerGenerator.kt:382 */
  266    403   
    if let Some(var_10) = &input.json_value {
         404  +
        /* JsonSerializerGenerator.kt:423 */
  267    405   
        object.key("JsonValue").string(var_10.as_str());
         406  +
        /* JsonSerializerGenerator.kt:382 */
  268    407   
    }
         408  +
    /* JsonSerializerGenerator.kt:382 */
  269    409   
    if let Some(var_11) = &input.list_of_lists {
         410  +
        /* JsonSerializerGenerator.kt:484 */
  270    411   
        let mut array_12 = object.key("ListOfLists").start_array();
         412  +
        /* JsonSerializerGenerator.kt:524 */
  271    413   
        for item_13 in var_11 {
         414  +
            /* SerializerUtil.kt:42 */
  272    415   
            {
         416  +
                /* JsonSerializerGenerator.kt:484 */
  273    417   
                let mut array_14 = array_12.value().start_array();
         418  +
                /* JsonSerializerGenerator.kt:524 */
  274    419   
                for item_15 in item_13 {
         420  +
                    /* SerializerUtil.kt:42 */
  275    421   
                    {
         422  +
                        /* JsonSerializerGenerator.kt:423 */
  276    423   
                        array_14.value().string(item_15.as_str());
         424  +
                        /* SerializerUtil.kt:42 */
  277    425   
                    }
         426  +
                    /* JsonSerializerGenerator.kt:524 */
  278    427   
                }
         428  +
                /* JsonSerializerGenerator.kt:486 */
  279    429   
                array_14.finish();
         430  +
                /* SerializerUtil.kt:42 */
  280    431   
            }
         432  +
            /* JsonSerializerGenerator.kt:524 */
  281    433   
        }
         434  +
        /* JsonSerializerGenerator.kt:486 */
  282    435   
        array_12.finish();
         436  +
        /* JsonSerializerGenerator.kt:382 */
  283    437   
    }
         438  +
    /* JsonSerializerGenerator.kt:382 */
  284    439   
    if let Some(var_16) = &input.list_of_maps_of_strings {
         440  +
        /* JsonSerializerGenerator.kt:484 */
  285    441   
        let mut array_17 = object.key("ListOfMapsOfStrings").start_array();
         442  +
        /* JsonSerializerGenerator.kt:524 */
  286    443   
        for item_18 in var_16 {
         444  +
            /* SerializerUtil.kt:42 */
  287    445   
            {
         446  +
                /* JsonSerializerGenerator.kt:495 */
  288    447   
                #[allow(unused_mut)]
         448  +
                /* JsonSerializerGenerator.kt:496 */
  289    449   
                let mut object_19 = array_17.value().start_object();
         450  +
                /* JsonSerializerGenerator.kt:537 */
  290    451   
                for (key_20, value_21) in item_18 {
         452  +
                    /* SerializerUtil.kt:42 */
  291    453   
                    {
         454  +
                        /* JsonSerializerGenerator.kt:423 */
  292    455   
                        object_19.key(key_20.as_str()).string(value_21.as_str());
         456  +
                        /* SerializerUtil.kt:42 */
  293    457   
                    }
         458  +
                    /* JsonSerializerGenerator.kt:537 */
  294    459   
                }
         460  +
                /* JsonSerializerGenerator.kt:515 */
  295    461   
                object_19.finish();
         462  +
                /* SerializerUtil.kt:42 */
  296    463   
            }
         464  +
            /* JsonSerializerGenerator.kt:524 */
  297    465   
        }
         466  +
        /* JsonSerializerGenerator.kt:486 */
  298    467   
        array_17.finish();
         468  +
        /* JsonSerializerGenerator.kt:382 */
  299    469   
    }
         470  +
    /* JsonSerializerGenerator.kt:382 */
  300    471   
    if let Some(var_22) = &input.list_of_strings {
         472  +
        /* JsonSerializerGenerator.kt:484 */
  301    473   
        let mut array_23 = object.key("ListOfStrings").start_array();
         474  +
        /* JsonSerializerGenerator.kt:524 */
  302    475   
        for item_24 in var_22 {
         476  +
            /* SerializerUtil.kt:42 */
  303    477   
            {
         478  +
                /* JsonSerializerGenerator.kt:423 */
  304    479   
                array_23.value().string(item_24.as_str());
         480  +
                /* SerializerUtil.kt:42 */
  305    481   
            }
         482  +
            /* JsonSerializerGenerator.kt:524 */
  306    483   
        }
         484  +
        /* JsonSerializerGenerator.kt:486 */
  307    485   
        array_23.finish();
         486  +
        /* JsonSerializerGenerator.kt:382 */
  308    487   
    }
         488  +
    /* JsonSerializerGenerator.kt:382 */
  309    489   
    if let Some(var_25) = &input.list_of_structs {
         490  +
        /* JsonSerializerGenerator.kt:484 */
  310    491   
        let mut array_26 = object.key("ListOfStructs").start_array();
         492  +
        /* JsonSerializerGenerator.kt:524 */
  311    493   
        for item_27 in var_25 {
         494  +
            /* SerializerUtil.kt:42 */
  312    495   
            {
         496  +
                /* JsonSerializerGenerator.kt:495 */
  313    497   
                #[allow(unused_mut)]
         498  +
                /* JsonSerializerGenerator.kt:496 */
  314    499   
                let mut object_28 = array_26.value().start_object();
         500  +
                /* JsonSerializerGenerator.kt:375 */
  315    501   
                crate::protocol_serde::shape_simple_struct::ser_simple_struct(
  316    502   
                    &mut object_28,
  317    503   
                    item_27,
  318    504   
                )?;
         505  +
                /* JsonSerializerGenerator.kt:515 */
  319    506   
                object_28.finish();
         507  +
                /* SerializerUtil.kt:42 */
  320    508   
            }
         509  +
            /* JsonSerializerGenerator.kt:524 */
  321    510   
        }
         511  +
        /* JsonSerializerGenerator.kt:486 */
  322    512   
        array_26.finish();
         513  +
        /* JsonSerializerGenerator.kt:382 */
  323    514   
    }
         515  +
    /* JsonSerializerGenerator.kt:382 */
  324    516   
    if let Some(var_29) = &input.long {
         517  +
        /* JsonSerializerGenerator.kt:432 */
  325    518   
        object.key("Long").number(
  326    519   
            #[allow(clippy::useless_conversion)]
  327    520   
            ::aws_smithy_types::Number::NegInt((*var_29).into()),
  328    521   
        );
         522  +
        /* JsonSerializerGenerator.kt:382 */
  329    523   
    }
         524  +
    /* JsonSerializerGenerator.kt:382 */
  330    525   
    if let Some(var_30) = &input.map_of_lists_of_strings {
         526  +
        /* JsonSerializerGenerator.kt:495 */
  331    527   
        #[allow(unused_mut)]
         528  +
        /* JsonSerializerGenerator.kt:496 */
  332    529   
        let mut object_31 = object.key("MapOfListsOfStrings").start_object();
         530  +
        /* JsonSerializerGenerator.kt:537 */
  333    531   
        for (key_32, value_33) in var_30 {
         532  +
            /* SerializerUtil.kt:42 */
  334    533   
            {
         534  +
                /* JsonSerializerGenerator.kt:484 */
  335    535   
                let mut array_34 = object_31.key(key_32.as_str()).start_array();
         536  +
                /* JsonSerializerGenerator.kt:524 */
  336    537   
                for item_35 in value_33 {
         538  +
                    /* SerializerUtil.kt:42 */
  337    539   
                    {
         540  +
                        /* JsonSerializerGenerator.kt:423 */
  338    541   
                        array_34.value().string(item_35.as_str());
         542  +
                        /* SerializerUtil.kt:42 */
  339    543   
                    }
         544  +
                    /* JsonSerializerGenerator.kt:524 */
  340    545   
                }
         546  +
                /* JsonSerializerGenerator.kt:486 */
  341    547   
                array_34.finish();
         548  +
                /* SerializerUtil.kt:42 */
  342    549   
            }
         550  +
            /* JsonSerializerGenerator.kt:537 */
  343    551   
        }
         552  +
        /* JsonSerializerGenerator.kt:515 */
  344    553   
        object_31.finish();
         554  +
        /* JsonSerializerGenerator.kt:382 */
  345    555   
    }
         556  +
    /* JsonSerializerGenerator.kt:382 */
  346    557   
    if let Some(var_36) = &input.map_of_maps {
         558  +
        /* JsonSerializerGenerator.kt:495 */
  347    559   
        #[allow(unused_mut)]
         560  +
        /* JsonSerializerGenerator.kt:496 */
  348    561   
        let mut object_37 = object.key("MapOfMaps").start_object();
         562  +
        /* JsonSerializerGenerator.kt:537 */
  349    563   
        for (key_38, value_39) in var_36 {
         564  +
            /* SerializerUtil.kt:42 */
  350    565   
            {
         566  +
                /* JsonSerializerGenerator.kt:495 */
  351    567   
                #[allow(unused_mut)]
         568  +
                /* JsonSerializerGenerator.kt:496 */
  352    569   
                let mut object_40 = object_37.key(key_38.as_str()).start_object();
         570  +
                /* JsonSerializerGenerator.kt:537 */
  353    571   
                for (key_41, value_42) in value_39 {
         572  +
                    /* SerializerUtil.kt:42 */
  354    573   
                    {
         574  +
                        /* JsonSerializerGenerator.kt:423 */
  355    575   
                        object_40.key(key_41.as_str()).string(value_42.as_str());
         576  +
                        /* SerializerUtil.kt:42 */
  356    577   
                    }
         578  +
                    /* JsonSerializerGenerator.kt:537 */
  357    579   
                }
         580  +
                /* JsonSerializerGenerator.kt:515 */
  358    581   
                object_40.finish();
         582  +
                /* SerializerUtil.kt:42 */
  359    583   
            }
         584  +
            /* JsonSerializerGenerator.kt:537 */
  360    585   
        }
         586  +
        /* JsonSerializerGenerator.kt:515 */
  361    587   
        object_37.finish();
         588  +
        /* JsonSerializerGenerator.kt:382 */
  362    589   
    }
         590  +
    /* JsonSerializerGenerator.kt:382 */
  363    591   
    if let Some(var_43) = &input.map_of_strings {
         592  +
        /* JsonSerializerGenerator.kt:495 */
  364    593   
        #[allow(unused_mut)]
         594  +
        /* JsonSerializerGenerator.kt:496 */
  365    595   
        let mut object_44 = object.key("MapOfStrings").start_object();
         596  +
        /* JsonSerializerGenerator.kt:537 */
  366    597   
        for (key_45, value_46) in var_43 {
         598  +
            /* SerializerUtil.kt:42 */
  367    599   
            {
         600  +
                /* JsonSerializerGenerator.kt:423 */
  368    601   
                object_44.key(key_45.as_str()).string(value_46.as_str());
         602  +
                /* SerializerUtil.kt:42 */
  369    603   
            }
         604  +
            /* JsonSerializerGenerator.kt:537 */
  370    605   
        }
         606  +
        /* JsonSerializerGenerator.kt:515 */
  371    607   
        object_44.finish();
         608  +
        /* JsonSerializerGenerator.kt:382 */
  372    609   
    }
         610  +
    /* JsonSerializerGenerator.kt:382 */
  373    611   
    if let Some(var_47) = &input.map_of_structs {
         612  +
        /* JsonSerializerGenerator.kt:495 */
  374    613   
        #[allow(unused_mut)]
         614  +
        /* JsonSerializerGenerator.kt:496 */
  375    615   
        let mut object_48 = object.key("MapOfStructs").start_object();
         616  +
        /* JsonSerializerGenerator.kt:537 */
  376    617   
        for (key_49, value_50) in var_47 {
         618  +
            /* SerializerUtil.kt:42 */
  377    619   
            {
         620  +
                /* JsonSerializerGenerator.kt:495 */
  378    621   
                #[allow(unused_mut)]
         622  +
                /* JsonSerializerGenerator.kt:496 */
  379    623   
                let mut object_51 = object_48.key(key_49.as_str()).start_object();
         624  +
                /* JsonSerializerGenerator.kt:375 */
  380    625   
                crate::protocol_serde::shape_simple_struct::ser_simple_struct(
  381    626   
                    &mut object_51,
  382    627   
                    value_50,
  383    628   
                )?;
         629  +
                /* JsonSerializerGenerator.kt:515 */
  384    630   
                object_51.finish();
         631  +
                /* SerializerUtil.kt:42 */
  385    632   
            }
         633  +
            /* JsonSerializerGenerator.kt:537 */
  386    634   
        }
         635  +
        /* JsonSerializerGenerator.kt:515 */
  387    636   
        object_48.finish();
         637  +
        /* JsonSerializerGenerator.kt:382 */
  388    638   
    }
         639  +
    /* JsonSerializerGenerator.kt:382 */
  389    640   
    if let Some(var_52) = &input.recursive_list {
         641  +
        /* JsonSerializerGenerator.kt:484 */
  390    642   
        let mut array_53 = object.key("RecursiveList").start_array();
         643  +
        /* JsonSerializerGenerator.kt:524 */
  391    644   
        for item_54 in var_52 {
         645  +
            /* SerializerUtil.kt:42 */
  392    646   
            {
         647  +
                /* JsonSerializerGenerator.kt:495 */
  393    648   
                #[allow(unused_mut)]
         649  +
                /* JsonSerializerGenerator.kt:496 */
  394    650   
                let mut object_55 = array_53.value().start_object();
         651  +
                /* JsonSerializerGenerator.kt:375 */
  395    652   
                crate::protocol_serde::shape_kitchen_sink::ser_kitchen_sink(
  396    653   
                    &mut object_55,
  397    654   
                    item_54,
  398    655   
                )?;
         656  +
                /* JsonSerializerGenerator.kt:515 */
  399    657   
                object_55.finish();
         658  +
                /* SerializerUtil.kt:42 */
  400    659   
            }
         660  +
            /* JsonSerializerGenerator.kt:524 */
  401    661   
        }
         662  +
        /* JsonSerializerGenerator.kt:486 */
  402    663   
        array_53.finish();
         664  +
        /* JsonSerializerGenerator.kt:382 */
  403    665   
    }
         666  +
    /* JsonSerializerGenerator.kt:382 */
  404    667   
    if let Some(var_56) = &input.recursive_map {
         668  +
        /* JsonSerializerGenerator.kt:495 */
  405    669   
        #[allow(unused_mut)]
         670  +
        /* JsonSerializerGenerator.kt:496 */
  406    671   
        let mut object_57 = object.key("RecursiveMap").start_object();
         672  +
        /* JsonSerializerGenerator.kt:537 */
  407    673   
        for (key_58, value_59) in var_56 {
         674  +
            /* SerializerUtil.kt:42 */
  408    675   
            {
         676  +
                /* JsonSerializerGenerator.kt:495 */
  409    677   
                #[allow(unused_mut)]
         678  +
                /* JsonSerializerGenerator.kt:496 */
  410    679   
                let mut object_60 = object_57.key(key_58.as_str()).start_object();
         680  +
                /* JsonSerializerGenerator.kt:375 */
  411    681   
                crate::protocol_serde::shape_kitchen_sink::ser_kitchen_sink(
  412    682   
                    &mut object_60,
  413    683   
                    value_59,
  414    684   
                )?;
         685  +
                /* JsonSerializerGenerator.kt:515 */
  415    686   
                object_60.finish();
         687  +
                /* SerializerUtil.kt:42 */
  416    688   
            }
         689  +
            /* JsonSerializerGenerator.kt:537 */
  417    690   
        }
         691  +
        /* JsonSerializerGenerator.kt:515 */
  418    692   
        object_57.finish();
         693  +
        /* JsonSerializerGenerator.kt:382 */
  419    694   
    }
         695  +
    /* JsonSerializerGenerator.kt:382 */
  420    696   
    if let Some(var_61) = &input.recursive_struct {
         697  +
        /* JsonSerializerGenerator.kt:495 */
  421    698   
        #[allow(unused_mut)]
         699  +
        /* JsonSerializerGenerator.kt:496 */
  422    700   
        let mut object_62 = object.key("RecursiveStruct").start_object();
         701  +
        /* JsonSerializerGenerator.kt:375 */
  423    702   
        crate::protocol_serde::shape_kitchen_sink::ser_kitchen_sink(&mut object_62, var_61)?;
         703  +
        /* JsonSerializerGenerator.kt:515 */
  424    704   
        object_62.finish();
         705  +
        /* JsonSerializerGenerator.kt:382 */
  425    706   
    }
         707  +
    /* JsonSerializerGenerator.kt:382 */
  426    708   
    if let Some(var_63) = &input.simple_struct {
         709  +
        /* JsonSerializerGenerator.kt:495 */
  427    710   
        #[allow(unused_mut)]
         711  +
        /* JsonSerializerGenerator.kt:496 */
  428    712   
        let mut object_64 = object.key("SimpleStruct").start_object();
         713  +
        /* JsonSerializerGenerator.kt:375 */
  429    714   
        crate::protocol_serde::shape_simple_struct::ser_simple_struct(&mut object_64, var_63)?;
         715  +
        /* JsonSerializerGenerator.kt:515 */
  430    716   
        object_64.finish();
         717  +
        /* JsonSerializerGenerator.kt:382 */
  431    718   
    }
         719  +
    /* JsonSerializerGenerator.kt:382 */
  432    720   
    if let Some(var_65) = &input.string {
         721  +
        /* JsonSerializerGenerator.kt:423 */
  433    722   
        object.key("String").string(var_65.as_str());
         723  +
        /* JsonSerializerGenerator.kt:382 */
  434    724   
    }
         725  +
    /* JsonSerializerGenerator.kt:382 */
  435    726   
    if let Some(var_66) = &input.struct_with_json_name {
         727  +
        /* JsonSerializerGenerator.kt:495 */
  436    728   
        #[allow(unused_mut)]
         729  +
        /* JsonSerializerGenerator.kt:496 */
  437    730   
        let mut object_67 = object.key("StructWithJsonName").start_object();
         731  +
        /* JsonSerializerGenerator.kt:375 */
  438    732   
        crate::protocol_serde::shape_struct_with_json_name::ser_struct_with_json_name(
  439    733   
            &mut object_67,
  440    734   
            var_66,
  441    735   
        )?;
         736  +
        /* JsonSerializerGenerator.kt:515 */
  442    737   
        object_67.finish();
         738  +
        /* JsonSerializerGenerator.kt:382 */
  443    739   
    }
         740  +
    /* JsonSerializerGenerator.kt:382 */
  444    741   
    if let Some(var_68) = &input.timestamp {
         742  +
        /* JsonSerializerGenerator.kt:448 */
  445    743   
        object
  446    744   
            .key("Timestamp")
  447    745   
            .date_time(var_68, ::aws_smithy_types::date_time::Format::EpochSeconds)?;
         746  +
        /* JsonSerializerGenerator.kt:382 */
  448    747   
    }
         748  +
    /* JsonSerializerGenerator.kt:382 */
  449    749   
    if let Some(var_69) = &input.unix_timestamp {
         750  +
        /* JsonSerializerGenerator.kt:448 */
  450    751   
        object
  451    752   
            .key("UnixTimestamp")
  452    753   
            .date_time(var_69, ::aws_smithy_types::date_time::Format::EpochSeconds)?;
         754  +
        /* JsonSerializerGenerator.kt:382 */
  453    755   
    }
         756  +
    /* JsonSerializerGenerator.kt:372 */
  454    757   
    Ok(())
         758  +
    /* JsonSerializerGenerator.kt:358 */
  455    759   
}

tmp-codegen-diff/codegen-server-test-python/json_rpc11/rust-server-codegen-python/src/protocol_serde/shape_kitchen_sink_operation.rs

@@ -1,1 +357,522 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:516 */
    2      3   
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ServerHttpBoundProtocolGenerator.kt:383 */
    3      5   
pub async fn de_kitchen_sink_operation_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::KitchenSinkOperationInput,
    7      9   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection,
    8     10   
>
    9     11   
where
   10     12   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11     13   
    B::Data: Send,
   12     14   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection:
   13     15   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     16   
{
          17  +
    /* ServerHttpBoundProtocolGenerator.kt:399 */
   15     18   
    Ok({
          19  +
        /* RustType.kt:516 */
   16     20   
        #[allow(unused_mut)]
          21  +
        /* ServerHttpBoundProtocolGenerator.kt:723 */
   17     22   
        let mut input = crate::input::kitchen_sink_operation_input_internal::Builder::default();
          23  +
        /* RustType.kt:516 */
   18     24   
        #[allow(unused_variables)]
          25  +
        /* ServerHttpBoundProtocolGenerator.kt:728 */
   19     26   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     27   
            uri, headers, body, ..
   21     28   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          29  +
        /* ServerHttpBoundProtocolGenerator.kt:745 */
   22     30   
        let bytes = ::hyper::body::to_bytes(body).await?;
          31  +
        /* ServerHttpBoundProtocolGenerator.kt:768 */
   23     32   
        if !bytes.is_empty() {
          33  +
            /* ServerHttpBoundProtocolGenerator.kt:769 */
   24     34   
            ::aws_smithy_http_server::protocol::content_type_header_classifier_smithy(
   25     35   
                &headers,
   26     36   
                Some("application/x-amz-json-1.1"),
   27     37   
            )?;
   28     38   
            input = crate::protocol_serde::shape_kitchen_sink_operation::de_kitchen_sink_operation(
   29     39   
                bytes.as_ref(),
   30     40   
                input,
   31     41   
            )?;
          42  +
            /* ServerHttpBoundProtocolGenerator.kt:768 */
   32     43   
        }
          44  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   33     45   
        input.build()
          46  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   34     47   
    })
          48  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   35     49   
}
   36     50   
          51  +
/* RustType.kt:516 */
   37     52   
#[allow(clippy::unnecessary_wraps)]
          53  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   38     54   
pub fn ser_kitchen_sink_operation_http_response(
   39     55   
    #[allow(unused_variables)] output: crate::output::KitchenSinkOperationOutput,
   40     56   
) -> std::result::Result<
   41     57   
    ::aws_smithy_http_server::response::Response,
   42     58   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   43     59   
> {
          60  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   44     61   
    Ok({
          62  +
        /* RustType.kt:516 */
   45     63   
        #[allow(unused_mut)]
          64  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   46     65   
        let mut builder = ::http::Response::builder();
          66  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   47     67   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   48     68   
            builder,
   49     69   
            ::http::header::CONTENT_TYPE,
   50     70   
            "application/x-amz-json-1.1",
   51     71   
        );
          72  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   52     73   
        let http_status: u16 = 200;
   53     74   
        builder = builder.status(http_status);
          75  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
   54     76   
        let payload =
   55         -
            crate::protocol_serde::shape_kitchen_sink_operation_output::ser_kitchen_sink_operation_output_output_output(&output)?
   56         -
        ;
          77  +
            /* HttpBoundProtocolPayloadGenerator.kt:237 */crate::protocol_serde::shape_kitchen_sink_operation_output::ser_kitchen_sink_operation_output_output_output(&output)?
          78  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
          79  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   57     80   
        let content_length = payload.len();
   58     81   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   59     82   
            builder,
   60     83   
            ::http::header::CONTENT_LENGTH,
   61     84   
            content_length,
   62     85   
        );
          86  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   63     87   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          88  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   64     89   
        builder.body(body)?
          90  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   65     91   
    })
          92  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   66     93   
}
   67     94   
          95  +
/* RustType.kt:516 */
   68     96   
#[allow(clippy::unnecessary_wraps)]
          97  +
/* ServerHttpBoundProtocolGenerator.kt:447 */
   69     98   
pub fn ser_kitchen_sink_operation_http_error(
   70     99   
    error: &crate::error::KitchenSinkOperationError,
   71    100   
) -> std::result::Result<
   72    101   
    ::aws_smithy_http_server::response::Response,
   73    102   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   74    103   
> {
         104  +
    /* ServerHttpBoundProtocolGenerator.kt:452 */
   75    105   
    Ok({
         106  +
        /* ServerHttpBoundProtocolGenerator.kt:468 */
   76    107   
        match error {
         108  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
   77    109   
            crate::error::KitchenSinkOperationError::ErrorWithMembers(output) => {
         110  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
   78    111   
                let payload =
   79    112   
                    crate::protocol_serde::shape_error_with_members::ser_error_with_members_error(
   80    113   
                        output,
   81    114   
                    )?;
         115  +
                /* RustType.kt:516 */
   82    116   
                #[allow(unused_mut)]
         117  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
   83    118   
                let mut builder = ::http::Response::builder();
         119  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   84    120   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   85    121   
                    builder,
   86    122   
                    ::http::header::CONTENT_TYPE,
   87    123   
                    "application/x-amz-json-1.1",
   88    124   
                );
         125  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
   89    126   
                let content_length = payload.len();
   90    127   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   91    128   
                    builder,
   92    129   
                    ::http::header::CONTENT_LENGTH,
   93    130   
                    content_length,
   94    131   
                );
         132  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
   95    133   
                builder
   96    134   
                    .status(400)
   97    135   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         136  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
   98    137   
            }
         138  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
   99    139   
            crate::error::KitchenSinkOperationError::ErrorWithoutMembers(output) => {
         140  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
  100    141   
                let payload = crate::protocol_serde::shape_error_without_members::ser_error_without_members_error(output)?;
         142  +
                /* RustType.kt:516 */
  101    143   
                #[allow(unused_mut)]
         144  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
  102    145   
                let mut builder = ::http::Response::builder();
         146  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  103    147   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  104    148   
                    builder,
  105    149   
                    ::http::header::CONTENT_TYPE,
  106    150   
                    "application/x-amz-json-1.1",
  107    151   
                );
         152  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  108    153   
                let content_length = payload.len();
  109    154   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  110    155   
                    builder,
  111    156   
                    ::http::header::CONTENT_LENGTH,
  112    157   
                    content_length,
  113    158   
                );
         159  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  114    160   
                builder
  115    161   
                    .status(500)
  116    162   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         163  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
  117    164   
            }
         165  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
  118    166   
            crate::error::KitchenSinkOperationError::InternalServerError(output) => {
         167  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
  119    168   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
         169  +
                /* RustType.kt:516 */
  120    170   
                #[allow(unused_mut)]
         171  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
  121    172   
                let mut builder = ::http::Response::builder();
         173  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  122    174   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  123    175   
                    builder,
  124    176   
                    ::http::header::CONTENT_TYPE,
  125    177   
                    "application/x-amz-json-1.1",
  126    178   
                );
         179  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  127    180   
                let content_length = payload.len();
  128    181   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  129    182   
                    builder,
  130    183   
                    ::http::header::CONTENT_LENGTH,
  131    184   
                    content_length,
  132    185   
                );
         186  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  133    187   
                builder
  134    188   
                    .status(500)
  135    189   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         190  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
         191  +
            } /* ServerHttpBoundProtocolGenerator.kt:468 */
  136    192   
        }
  137         -
        }
         193  +
        /* ServerHttpBoundProtocolGenerator.kt:452 */
  138    194   
    })
         195  +
    /* ServerHttpBoundProtocolGenerator.kt:447 */
  139    196   
}
  140    197   
         198  +
/* JsonParserGenerator.kt:148 */
  141    199   
pub(crate) fn de_kitchen_sink_operation(
  142    200   
    value: &[u8],
  143    201   
    mut builder: crate::input::kitchen_sink_operation_input_internal::Builder,
  144    202   
) -> ::std::result::Result<
  145    203   
    crate::input::kitchen_sink_operation_input_internal::Builder,
  146    204   
    ::aws_smithy_json::deserialize::error::DeserializeError,
  147    205   
> {
         206  +
    /* JsonParserGenerator.kt:153 */
  148    207   
    let mut tokens_owned =
  149    208   
        ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value))
  150    209   
            .peekable();
  151    210   
    let tokens = &mut tokens_owned;
  152    211   
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
         212  +
    /* JsonParserGenerator.kt:684 */
  153    213   
    loop {
         214  +
        /* JsonParserGenerator.kt:685 */
  154    215   
        match tokens.next().transpose()? {
         216  +
            /* JsonParserGenerator.kt:686 */
  155    217   
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
  156    218   
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
         219  +
                /* JsonParserGenerator.kt:260 */
  157    220   
                match key.to_unescaped()?.as_ref() {
         221  +
                    /* JsonParserGenerator.kt:262 */
  158    222   
                    "Blob" => {
         223  +
                        /* JsonParserGenerator.kt:272 */
  159    224   
                        builder = builder.set_blob(
  160         -
                            ::aws_smithy_json::deserialize::token::expect_blob_or_null(
  161         -
                                tokens.next(),
  162         -
                            )?
  163         -
                            .map(::aws_smithy_http_server_python::types::Blob::from),
  164         -
                        );
         225  +
                            /* JsonParserGenerator.kt:326 */::aws_smithy_json::deserialize::token::expect_blob_or_null(tokens.next())?
         226  +
                            /* PythonServerProtocolLoader.kt:48 */.map(::aws_smithy_http_server_python::types::Blob::from)
         227  +
                        /* JsonParserGenerator.kt:272 */);
         228  +
                        /* JsonParserGenerator.kt:262 */
  165    229   
                    }
         230  +
                    /* JsonParserGenerator.kt:262 */
  166    231   
                    "Boolean" => {
         232  +
                        /* JsonParserGenerator.kt:272 */
  167    233   
                        builder = builder.set_boolean(
         234  +
                            /* JsonParserGenerator.kt:298 */
  168    235   
                            ::aws_smithy_json::deserialize::token::expect_bool_or_null(
  169    236   
                                tokens.next(),
  170         -
                            )?,
         237  +
                            )?, /* JsonParserGenerator.kt:272 */
  171    238   
                        );
         239  +
                        /* JsonParserGenerator.kt:262 */
  172    240   
                    }
         241  +
                    /* JsonParserGenerator.kt:262 */
  173    242   
                    "Double" => {
         243  +
                        /* JsonParserGenerator.kt:272 */
  174    244   
                        builder = builder.set_double(
         245  +
                            /* JsonParserGenerator.kt:363 */
  175    246   
                            ::aws_smithy_json::deserialize::token::expect_number_or_null(
  176    247   
                                tokens.next(),
  177    248   
                            )?
  178         -
                            .map(|v| v.to_f64_lossy()),
         249  +
                            .map(|v| v.to_f64_lossy()), /* JsonParserGenerator.kt:272 */
  179    250   
                        );
         251  +
                        /* JsonParserGenerator.kt:262 */
  180    252   
                    }
         253  +
                    /* JsonParserGenerator.kt:262 */
  181    254   
                    "EmptyStruct" => {
         255  +
                        /* JsonParserGenerator.kt:272 */
  182    256   
                        builder = builder.set_empty_struct(
  183         -
                            crate::protocol_serde::shape_empty_struct::de_empty_struct(tokens)?,
  184         -
                        );
         257  +
                            /* JsonParserGenerator.kt:544 */crate::protocol_serde::shape_empty_struct::de_empty_struct(tokens)?
         258  +
                        /* JsonParserGenerator.kt:272 */);
         259  +
                        /* JsonParserGenerator.kt:262 */
  185    260   
                    }
         261  +
                    /* JsonParserGenerator.kt:262 */
  186    262   
                    "Float" => {
         263  +
                        /* JsonParserGenerator.kt:272 */
  187    264   
                        builder = builder.set_float(
         265  +
                            /* JsonParserGenerator.kt:361 */
  188    266   
                            ::aws_smithy_json::deserialize::token::expect_number_or_null(
  189    267   
                                tokens.next(),
  190    268   
                            )?
  191         -
                            .map(|v| v.to_f32_lossy()),
         269  +
                            .map(|v| v.to_f32_lossy()), /* JsonParserGenerator.kt:272 */
  192    270   
                        );
         271  +
                        /* JsonParserGenerator.kt:262 */
  193    272   
                    }
         273  +
                    /* JsonParserGenerator.kt:262 */
  194    274   
                    "HttpdateTimestamp" => {
         275  +
                        /* JsonParserGenerator.kt:272 */
  195    276   
                        builder = builder.set_httpdate_timestamp(
  196         -
                            ::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
  197         -
                                tokens.next(),
  198         -
                                ::aws_smithy_types::date_time::Format::HttpDate,
  199         -
                            )?
  200         -
                            .map(::aws_smithy_http_server_python::types::DateTime::from),
  201         -
                        );
         277  +
                            /* JsonParserGenerator.kt:384 */::aws_smithy_json::deserialize::token::expect_timestamp_or_null(tokens.next(), ::aws_smithy_types::date_time::Format::HttpDate)?
         278  +
                            /* PythonServerProtocolLoader.kt:44 */.map(::aws_smithy_http_server_python::types::DateTime::from)
         279  +
                        /* JsonParserGenerator.kt:272 */);
         280  +
                        /* JsonParserGenerator.kt:262 */
  202    281   
                    }
         282  +
                    /* JsonParserGenerator.kt:262 */
  203    283   
                    "Integer" => {
         284  +
                        /* JsonParserGenerator.kt:272 */
  204    285   
                        builder = builder.set_integer(
         286  +
                            /* JsonParserGenerator.kt:365 */
  205    287   
                            ::aws_smithy_json::deserialize::token::expect_number_or_null(
  206    288   
                                tokens.next(),
  207    289   
                            )?
  208    290   
                            .map(i32::try_from)
  209         -
                            .transpose()?,
         291  +
                            .transpose()?, /* JsonParserGenerator.kt:272 */
  210    292   
                        );
         293  +
                        /* JsonParserGenerator.kt:262 */
  211    294   
                    }
         295  +
                    /* JsonParserGenerator.kt:262 */
  212    296   
                    "Iso8601Timestamp" => {
         297  +
                        /* JsonParserGenerator.kt:272 */
  213    298   
                        builder = builder.set_iso8601_timestamp(
  214         -
                            ::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
  215         -
                                tokens.next(),
  216         -
                                ::aws_smithy_types::date_time::Format::DateTime,
  217         -
                            )?
  218         -
                            .map(::aws_smithy_http_server_python::types::DateTime::from),
  219         -
                        );
         299  +
                            /* JsonParserGenerator.kt:384 */::aws_smithy_json::deserialize::token::expect_timestamp_or_null(tokens.next(), ::aws_smithy_types::date_time::Format::DateTime)?
         300  +
                            /* PythonServerProtocolLoader.kt:44 */.map(::aws_smithy_http_server_python::types::DateTime::from)
         301  +
                        /* JsonParserGenerator.kt:272 */);
         302  +
                        /* JsonParserGenerator.kt:262 */
  220    303   
                    }
         304  +
                    /* JsonParserGenerator.kt:262 */
  221    305   
                    "JsonValue" => {
         306  +
                        /* JsonParserGenerator.kt:272 */
  222    307   
                        builder = builder.set_json_value(
         308  +
                            /* JsonParserGenerator.kt:354 */
  223    309   
                            ::aws_smithy_json::deserialize::token::expect_string_or_null(
  224    310   
                                tokens.next(),
  225    311   
                            )?
  226         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  227         -
                            .transpose()?,
         312  +
                            .map(|s|
         313  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
         314  +
                                    /* JsonParserGenerator.kt:348 */u.into_owned()
         315  +
                                /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
         316  +
                            .transpose()?, /* JsonParserGenerator.kt:272 */
  228    317   
                        );
         318  +
                        /* JsonParserGenerator.kt:262 */
  229    319   
                    }
         320  +
                    /* JsonParserGenerator.kt:262 */
  230    321   
                    "ListOfLists" => {
         322  +
                        /* JsonParserGenerator.kt:272 */
  231    323   
                        builder = builder.set_list_of_lists(
  232         -
                            crate::protocol_serde::shape_list_of_list_of_strings::de_list_of_list_of_strings(tokens)?
  233         -
                        );
         324  +
                            /* JsonParserGenerator.kt:451 */crate::protocol_serde::shape_list_of_list_of_strings::de_list_of_list_of_strings(tokens)?
         325  +
                        /* JsonParserGenerator.kt:272 */);
         326  +
                        /* JsonParserGenerator.kt:262 */
  234    327   
                    }
         328  +
                    /* JsonParserGenerator.kt:262 */
  235    329   
                    "ListOfMapsOfStrings" => {
         330  +
                        /* JsonParserGenerator.kt:272 */
  236    331   
                        builder = builder.set_list_of_maps_of_strings(
  237         -
                            crate::protocol_serde::shape_list_of_maps_of_strings::de_list_of_maps_of_strings(tokens)?
  238         -
                        );
         332  +
                            /* JsonParserGenerator.kt:451 */crate::protocol_serde::shape_list_of_maps_of_strings::de_list_of_maps_of_strings(tokens)?
         333  +
                        /* JsonParserGenerator.kt:272 */);
         334  +
                        /* JsonParserGenerator.kt:262 */
  239    335   
                    }
         336  +
                    /* JsonParserGenerator.kt:262 */
  240    337   
                    "ListOfStrings" => {
         338  +
                        /* JsonParserGenerator.kt:272 */
  241    339   
                        builder = builder.set_list_of_strings(
         340  +
                            /* JsonParserGenerator.kt:451 */
  242    341   
                            crate::protocol_serde::shape_list_of_strings::de_list_of_strings(
  243    342   
                                tokens,
  244         -
                            )?,
         343  +
                            )?, /* JsonParserGenerator.kt:272 */
  245    344   
                        );
         345  +
                        /* JsonParserGenerator.kt:262 */
  246    346   
                    }
         347  +
                    /* JsonParserGenerator.kt:262 */
  247    348   
                    "ListOfStructs" => {
         349  +
                        /* JsonParserGenerator.kt:272 */
  248    350   
                        builder = builder.set_list_of_structs(
         351  +
                            /* JsonParserGenerator.kt:451 */
  249    352   
                            crate::protocol_serde::shape_list_of_structs::de_list_of_structs(
  250    353   
                                tokens,
  251         -
                            )?,
         354  +
                            )?, /* JsonParserGenerator.kt:272 */
  252    355   
                        );
         356  +
                        /* JsonParserGenerator.kt:262 */
  253    357   
                    }
         358  +
                    /* JsonParserGenerator.kt:262 */
  254    359   
                    "Long" => {
         360  +
                        /* JsonParserGenerator.kt:272 */
  255    361   
                        builder = builder.set_long(
         362  +
                            /* JsonParserGenerator.kt:365 */
  256    363   
                            ::aws_smithy_json::deserialize::token::expect_number_or_null(
  257    364   
                                tokens.next(),
  258    365   
                            )?
  259    366   
                            .map(i64::try_from)
  260         -
                            .transpose()?,
         367  +
                            .transpose()?, /* JsonParserGenerator.kt:272 */
  261    368   
                        );
         369  +
                        /* JsonParserGenerator.kt:262 */
  262    370   
                    }
         371  +
                    /* JsonParserGenerator.kt:262 */
  263    372   
                    "MapOfListsOfStrings" => {
         373  +
                        /* JsonParserGenerator.kt:272 */
  264    374   
                        builder = builder.set_map_of_lists_of_strings(
  265         -
                            crate::protocol_serde::shape_map_of_lists_of_strings::de_map_of_lists_of_strings(tokens)?
  266         -
                        );
         375  +
                            /* JsonParserGenerator.kt:509 */crate::protocol_serde::shape_map_of_lists_of_strings::de_map_of_lists_of_strings(tokens)?
         376  +
                        /* JsonParserGenerator.kt:272 */);
         377  +
                        /* JsonParserGenerator.kt:262 */
  267    378   
                    }
         379  +
                    /* JsonParserGenerator.kt:262 */
  268    380   
                    "MapOfMaps" => {
         381  +
                        /* JsonParserGenerator.kt:272 */
  269    382   
                        builder = builder.set_map_of_maps(
  270         -
                            crate::protocol_serde::shape_map_of_map_of_strings::de_map_of_map_of_strings(tokens)?
  271         -
                        );
         383  +
                            /* JsonParserGenerator.kt:509 */crate::protocol_serde::shape_map_of_map_of_strings::de_map_of_map_of_strings(tokens)?
         384  +
                        /* JsonParserGenerator.kt:272 */);
         385  +
                        /* JsonParserGenerator.kt:262 */
  272    386   
                    }
         387  +
                    /* JsonParserGenerator.kt:262 */
  273    388   
                    "MapOfStrings" => {
  274         -
                        builder = builder.set_map_of_strings(
  275         -
                            crate::protocol_serde::shape_map_of_strings::de_map_of_strings(tokens)?,
         389  +
                        /* JsonParserGenerator.kt:272 */
         390  +
                        builder =
         391  +
                            builder.set_map_of_strings(
         392  +
                                /* JsonParserGenerator.kt:509 */
         393  +
                                crate::protocol_serde::shape_map_of_strings::de_map_of_strings(
         394  +
                                    tokens,
         395  +
                                )?, /* JsonParserGenerator.kt:272 */
  276    396   
                            );
         397  +
                        /* JsonParserGenerator.kt:262 */
  277    398   
                    }
         399  +
                    /* JsonParserGenerator.kt:262 */
  278    400   
                    "MapOfStructs" => {
  279         -
                        builder = builder.set_map_of_structs(
  280         -
                            crate::protocol_serde::shape_map_of_structs::de_map_of_structs(tokens)?,
         401  +
                        /* JsonParserGenerator.kt:272 */
         402  +
                        builder =
         403  +
                            builder.set_map_of_structs(
         404  +
                                /* JsonParserGenerator.kt:509 */
         405  +
                                crate::protocol_serde::shape_map_of_structs::de_map_of_structs(
         406  +
                                    tokens,
         407  +
                                )?, /* JsonParserGenerator.kt:272 */
  281    408   
                            );
         409  +
                        /* JsonParserGenerator.kt:262 */
  282    410   
                    }
         411  +
                    /* JsonParserGenerator.kt:262 */
  283    412   
                    "RecursiveList" => {
         413  +
                        /* JsonParserGenerator.kt:272 */
  284    414   
                        builder = builder.set_recursive_list(
  285         -
                            crate::protocol_serde::shape_list_of_kitchen_sinks::de_list_of_kitchen_sinks(tokens)?
  286         -
                        );
         415  +
                            /* JsonParserGenerator.kt:451 */crate::protocol_serde::shape_list_of_kitchen_sinks::de_list_of_kitchen_sinks(tokens)?
         416  +
                        /* JsonParserGenerator.kt:272 */);
         417  +
                        /* JsonParserGenerator.kt:262 */
  287    418   
                    }
         419  +
                    /* JsonParserGenerator.kt:262 */
  288    420   
                    "RecursiveMap" => {
         421  +
                        /* JsonParserGenerator.kt:272 */
  289    422   
                        builder = builder.set_recursive_map(
  290         -
                            crate::protocol_serde::shape_map_of_kitchen_sinks::de_map_of_kitchen_sinks(tokens)?
  291         -
                        );
         423  +
                            /* JsonParserGenerator.kt:509 */crate::protocol_serde::shape_map_of_kitchen_sinks::de_map_of_kitchen_sinks(tokens)?
         424  +
                        /* JsonParserGenerator.kt:272 */);
         425  +
                        /* JsonParserGenerator.kt:262 */
  292    426   
                    }
         427  +
                    /* JsonParserGenerator.kt:262 */
  293    428   
                    "RecursiveStruct" => {
         429  +
                        /* JsonParserGenerator.kt:272 */
  294    430   
                        builder = builder.set_recursive_struct(
         431  +
                            /* JsonParserGenerator.kt:544 */
  295    432   
                            crate::protocol_serde::shape_kitchen_sink::de_kitchen_sink(tokens)?
  296         -
                                .map(Box::new),
         433  +
                                /* JsonParserGenerator.kt:314 */
         434  +
                                .map(Box::new), /* JsonParserGenerator.kt:272 */
  297    435   
                        );
         436  +
                        /* JsonParserGenerator.kt:262 */
  298    437   
                    }
         438  +
                    /* JsonParserGenerator.kt:262 */
  299    439   
                    "SimpleStruct" => {
  300         -
                        builder = builder.set_simple_struct(
  301         -
                            crate::protocol_serde::shape_simple_struct::de_simple_struct(tokens)?,
         440  +
                        /* JsonParserGenerator.kt:272 */
         441  +
                        builder =
         442  +
                            builder.set_simple_struct(
         443  +
                                /* JsonParserGenerator.kt:544 */
         444  +
                                crate::protocol_serde::shape_simple_struct::de_simple_struct(
         445  +
                                    tokens,
         446  +
                                )?, /* JsonParserGenerator.kt:272 */
  302    447   
                            );
         448  +
                        /* JsonParserGenerator.kt:262 */
  303    449   
                    }
         450  +
                    /* JsonParserGenerator.kt:262 */
  304    451   
                    "String" => {
         452  +
                        /* JsonParserGenerator.kt:272 */
  305    453   
                        builder = builder.set_string(
         454  +
                            /* JsonParserGenerator.kt:354 */
  306    455   
                            ::aws_smithy_json::deserialize::token::expect_string_or_null(
  307    456   
                                tokens.next(),
  308    457   
                            )?
  309         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  310         -
                            .transpose()?,
         458  +
                            .map(|s|
         459  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
         460  +
                                    /* JsonParserGenerator.kt:348 */u.into_owned()
         461  +
                                /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
         462  +
                            .transpose()?, /* JsonParserGenerator.kt:272 */
  311    463   
                        );
         464  +
                        /* JsonParserGenerator.kt:262 */
  312    465   
                    }
         466  +
                    /* JsonParserGenerator.kt:262 */
  313    467   
                    "StructWithJsonName" => {
         468  +
                        /* JsonParserGenerator.kt:272 */
  314    469   
                        builder = builder.set_struct_with_json_name(
  315         -
                            crate::protocol_serde::shape_struct_with_json_name::de_struct_with_json_name(tokens)?
  316         -
                        );
         470  +
                            /* JsonParserGenerator.kt:544 */crate::protocol_serde::shape_struct_with_json_name::de_struct_with_json_name(tokens)?
         471  +
                        /* JsonParserGenerator.kt:272 */);
         472  +
                        /* JsonParserGenerator.kt:262 */
  317    473   
                    }
         474  +
                    /* JsonParserGenerator.kt:262 */
  318    475   
                    "Timestamp" => {
         476  +
                        /* JsonParserGenerator.kt:272 */
  319    477   
                        builder = builder.set_timestamp(
  320         -
                            ::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
  321         -
                                tokens.next(),
  322         -
                                ::aws_smithy_types::date_time::Format::EpochSeconds,
  323         -
                            )?
  324         -
                            .map(::aws_smithy_http_server_python::types::DateTime::from),
  325         -
                        );
         478  +
                            /* JsonParserGenerator.kt:384 */::aws_smithy_json::deserialize::token::expect_timestamp_or_null(tokens.next(), ::aws_smithy_types::date_time::Format::EpochSeconds)?
         479  +
                            /* PythonServerProtocolLoader.kt:44 */.map(::aws_smithy_http_server_python::types::DateTime::from)
         480  +
                        /* JsonParserGenerator.kt:272 */);
         481  +
                        /* JsonParserGenerator.kt:262 */
  326    482   
                    }
         483  +
                    /* JsonParserGenerator.kt:262 */
  327    484   
                    "UnixTimestamp" => {
         485  +
                        /* JsonParserGenerator.kt:272 */
  328    486   
                        builder = builder.set_unix_timestamp(
  329         -
                            ::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
  330         -
                                tokens.next(),
  331         -
                                ::aws_smithy_types::date_time::Format::EpochSeconds,
  332         -
                            )?
  333         -
                            .map(::aws_smithy_http_server_python::types::DateTime::from),
  334         -
                        );
         487  +
                            /* JsonParserGenerator.kt:384 */::aws_smithy_json::deserialize::token::expect_timestamp_or_null(tokens.next(), ::aws_smithy_types::date_time::Format::EpochSeconds)?
         488  +
                            /* PythonServerProtocolLoader.kt:44 */.map(::aws_smithy_http_server_python::types::DateTime::from)
         489  +
                        /* JsonParserGenerator.kt:272 */);
         490  +
                        /* JsonParserGenerator.kt:262 */
  335    491   
                    }
  336         -
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
         492  +
                    /* JsonParserGenerator.kt:290 */
         493  +
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
  337    494   
                }
         495  +
                /* JsonParserGenerator.kt:686 */
  338    496   
            }
         497  +
            /* JsonParserGenerator.kt:695 */
  339    498   
            other => {
  340    499   
                return Err(
  341    500   
                    ::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  342    501   
                        "expected object key or end object, found: {:?}",
  343    502   
                        other
  344    503   
                    )),
  345    504   
                )
         505  +
            } /* JsonParserGenerator.kt:685 */
  346    506   
        }
         507  +
        /* JsonParserGenerator.kt:684 */
  347    508   
    }
  348         -
    }
         509  +
    /* JsonParserGenerator.kt:250 */
  349    510   
    if tokens.next().is_some() {
         511  +
        /* JsonParserGenerator.kt:251 */
  350    512   
        return Err(
  351    513   
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
  352    514   
                "found more JSON tokens after completing parsing",
  353    515   
            ),
  354    516   
        );
         517  +
        /* JsonParserGenerator.kt:250 */
  355    518   
    }
         519  +
    /* JsonParserGenerator.kt:163 */
  356    520   
    Ok(builder)
         521  +
    /* JsonParserGenerator.kt:148 */
  357    522   
}