Server Test

Server Test

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943 (ignoring whitespace)

Files changed:

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

@@ -2,2 +61,62 @@
   22     22   
pub(crate) mod shape_operation_with_nested_structure;
   23     23   
   24     24   
pub(crate) mod shape_operation_with_required_members;
   25     25   
   26     26   
pub(crate) mod shape_put_with_content_encoding;
   27     27   
   28     28   
pub(crate) mod shape_simple_scalar_properties;
   29     29   
   30     30   
pub(crate) mod shape_complex_error;
   31     31   
          32  +
/* JsonParserGenerator.kt:227 */
   32     33   
pub(crate) fn or_empty_doc(data: &[u8]) -> &[u8] {
   33     34   
    if data.is_empty() {
   34     35   
        b"{}"
   35     36   
    } else {
   36     37   
        data
   37     38   
    }
   38     39   
}
   39     40   
   40     41   
pub(crate) mod shape_content_type_parameters_output;
   41     42   

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

@@ -1,1 +57,79 @@
    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_client_optional_defaults<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<crate::model::ClientOptionalDefaults>,
    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::client_optional_defaults::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   
                            "member" => {
          37  +
                                /* JsonParserGenerator.kt:276 */
   27     38   
                                if let Some(v) =
   28         -
                                    ::aws_smithy_json::deserialize::token::expect_number_or_null(
   29         -
                                        tokens.next(),
   30         -
                                    )?
          39  +
                                /* JsonParserGenerator.kt:365 */::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
   31     40   
                                                    .map(i32::try_from)
   32     41   
                                                    .transpose()?
   33         -
                                {
          42  +
                                /* JsonParserGenerator.kt:278 */{
   34     43   
                                                                            builder = builder.set_member(v);
   35     44   
                                                                        }
          45  +
                                /* JsonParserGenerator.kt:262 */
   36     46   
                            }
   37         -
                            _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
          47  +
                            /* JsonParserGenerator.kt:290 */
          48  +
                            _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
   38     49   
                        }
          50  +
                        /* JsonParserGenerator.kt:686 */
   39     51   
                    }
          52  +
                    /* JsonParserGenerator.kt:695 */
   40     53   
                    other => {
   41     54   
                        return Err(
   42     55   
                            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   43     56   
                                format!("expected object key or end object, found: {:?}", other),
   44     57   
                            ),
   45     58   
                        )
          59  +
                    } /* JsonParserGenerator.kt:685 */
   46     60   
                }
          61  +
                /* JsonParserGenerator.kt:684 */
   47     62   
            }
   48         -
            }
          63  +
            /* JsonParserGenerator.kt:540 */
   49     64   
            Ok(Some(builder.build()))
          65  +
            /* JsonParserGenerator.kt:713 */
   50     66   
        }
   51         -
        _ => Err(
          67  +
        /* JsonParserGenerator.kt:722 */
          68  +
        _ => {
          69  +
            /* JsonParserGenerator.kt:723 */
          70  +
            Err(
   52     71   
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   53     72   
                    "expected start object or null",
   54     73   
                ),
   55         -
        ),
          74  +
            )
          75  +
            /* JsonParserGenerator.kt:722 */
          76  +
        } /* JsonParserGenerator.kt:712 */
   56     77   
    }
          78  +
    /* JsonParserGenerator.kt:516 */
   57     79   
}

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

@@ -1,1 +32,50 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
    2      3   
pub fn ser_complex_error_error(
    3      4   
    value: &crate::error::ComplexError,
    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_complex_error::ser_complex_error(&mut object, value)?;
          11  +
    /* ServerAwsJson.kt:95 */
    8     12   
    object
    9     13   
        .key("__type")
   10     14   
        .string("aws.protocoltests.json10#ComplexError");
          15  +
    /* JsonSerializerGenerator.kt:227 */
   11     16   
    object.finish();
   12     17   
    Ok(out)
          18  +
    /* JsonSerializerGenerator.kt:213 */
   13     19   
}
   14     20   
          21  +
/* JsonSerializerGenerator.kt:358 */
   15     22   
pub fn ser_complex_error(
   16     23   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   17     24   
    input: &crate::error::ComplexError,
   18     25   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          26  +
    /* JsonSerializerGenerator.kt:382 */
   19     27   
    if let Some(var_1) = &input.top_level {
          28  +
        /* JsonSerializerGenerator.kt:423 */
   20     29   
        object.key("TopLevel").string(var_1.as_str());
          30  +
        /* JsonSerializerGenerator.kt:382 */
   21     31   
    }
          32  +
    /* JsonSerializerGenerator.kt:382 */
   22     33   
    if let Some(var_2) = &input.nested {
          34  +
        /* JsonSerializerGenerator.kt:495 */
   23     35   
        #[allow(unused_mut)]
          36  +
        /* JsonSerializerGenerator.kt:496 */
   24     37   
        let mut object_3 = object.key("Nested").start_object();
          38  +
        /* JsonSerializerGenerator.kt:375 */
   25     39   
        crate::protocol_serde::shape_complex_nested_error_data::ser_complex_nested_error_data(
   26     40   
            &mut object_3,
   27     41   
            var_2,
   28     42   
        )?;
          43  +
        /* JsonSerializerGenerator.kt:515 */
   29     44   
        object_3.finish();
          45  +
        /* JsonSerializerGenerator.kt:382 */
   30     46   
    }
          47  +
    /* JsonSerializerGenerator.kt:372 */
   31     48   
    Ok(())
          49  +
    /* JsonSerializerGenerator.kt:358 */
   32     50   
}

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

@@ -1,1 +10,16 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:358 */
    2      3   
pub fn ser_complex_nested_error_data(
    3      4   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4      5   
    input: &crate::model::ComplexNestedErrorData,
    5      6   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
           7  +
    /* JsonSerializerGenerator.kt:382 */
    6      8   
    if let Some(var_1) = &input.foo {
           9  +
        /* JsonSerializerGenerator.kt:423 */
    7     10   
        object.key("Foo").string(var_1.as_str());
          11  +
        /* JsonSerializerGenerator.kt:382 */
    8     12   
    }
          13  +
    /* JsonSerializerGenerator.kt:372 */
    9     14   
    Ok(())
          15  +
    /* JsonSerializerGenerator.kt:358 */
   10     16   
}

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

@@ -1,1 +116,162 @@
    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_content_type_parameters_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::ContentTypeParametersInput,
    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::content_type_parameters_input::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.0"),
   27     37   
            )?;
   28     38   
            input =
   29     39   
                crate::protocol_serde::shape_content_type_parameters::de_content_type_parameters(
   30     40   
                    bytes.as_ref(),
   31     41   
                    input,
   32     42   
                )?;
          43  +
            /* ServerHttpBoundProtocolGenerator.kt:768 */
   33     44   
        }
          45  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   34     46   
        input.build()
          47  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   35     48   
    })
          49  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   36     50   
}
   37     51   
          52  +
/* RustType.kt:516 */
   38     53   
#[allow(clippy::unnecessary_wraps)]
          54  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   39     55   
pub fn ser_content_type_parameters_http_response(
   40     56   
    #[allow(unused_variables)] output: crate::output::ContentTypeParametersOutput,
   41     57   
) -> std::result::Result<
   42     58   
    ::aws_smithy_http_server::response::Response,
   43     59   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   44     60   
> {
          61  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   45     62   
    Ok({
          63  +
        /* RustType.kt:516 */
   46     64   
        #[allow(unused_mut)]
          65  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   47     66   
        let mut builder = ::http::Response::builder();
          67  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   48     68   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   49     69   
            builder,
   50     70   
            ::http::header::CONTENT_TYPE,
   51     71   
            "application/x-amz-json-1.0",
   52     72   
        );
          73  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   53     74   
        let http_status: u16 = 200;
   54     75   
        builder = builder.status(http_status);
          76  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
   55     77   
        let payload =
   56         -
            crate::protocol_serde::shape_content_type_parameters_output::ser_content_type_parameters_output_output_output(&output)?
   57         -
        ;
          78  +
            /* HttpBoundProtocolPayloadGenerator.kt:237 */crate::protocol_serde::shape_content_type_parameters_output::ser_content_type_parameters_output_output_output(&output)?
          79  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
          80  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   58     81   
        let content_length = payload.len();
   59     82   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   60     83   
            builder,
   61     84   
            ::http::header::CONTENT_LENGTH,
   62     85   
            content_length,
   63     86   
        );
          87  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   64     88   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          89  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   65     90   
        builder.body(body)?
          91  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   66     92   
    })
          93  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   67     94   
}
   68     95   
          96  +
/* JsonParserGenerator.kt:148 */
   69     97   
pub(crate) fn de_content_type_parameters(
   70     98   
    value: &[u8],
   71     99   
    mut builder: crate::input::content_type_parameters_input::Builder,
   72    100   
) -> ::std::result::Result<
   73    101   
    crate::input::content_type_parameters_input::Builder,
   74    102   
    ::aws_smithy_json::deserialize::error::DeserializeError,
   75    103   
> {
         104  +
    /* JsonParserGenerator.kt:153 */
   76    105   
    let mut tokens_owned =
   77    106   
        ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value))
   78    107   
            .peekable();
   79    108   
    let tokens = &mut tokens_owned;
   80    109   
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
         110  +
    /* JsonParserGenerator.kt:684 */
   81    111   
    loop {
         112  +
        /* JsonParserGenerator.kt:685 */
   82    113   
        match tokens.next().transpose()? {
         114  +
            /* JsonParserGenerator.kt:686 */
   83    115   
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   84    116   
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
         117  +
                /* JsonParserGenerator.kt:260 */
   85    118   
                match key.to_unescaped()?.as_ref() {
         119  +
                    /* JsonParserGenerator.kt:262 */
   86    120   
                    "value" => {
         121  +
                        /* JsonParserGenerator.kt:272 */
   87    122   
                        builder = builder.set_value(
         123  +
                            /* JsonParserGenerator.kt:365 */
   88    124   
                            ::aws_smithy_json::deserialize::token::expect_number_or_null(
   89    125   
                                tokens.next(),
   90    126   
                            )?
   91    127   
                            .map(i32::try_from)
   92         -
                            .transpose()?,
         128  +
                            .transpose()?, /* JsonParserGenerator.kt:272 */
   93    129   
                        );
         130  +
                        /* JsonParserGenerator.kt:262 */
   94    131   
                    }
   95         -
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
         132  +
                    /* JsonParserGenerator.kt:290 */
         133  +
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
   96    134   
                }
         135  +
                /* JsonParserGenerator.kt:686 */
   97    136   
            }
         137  +
            /* JsonParserGenerator.kt:695 */
   98    138   
            other => {
   99    139   
                return Err(
  100    140   
                    ::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  101    141   
                        "expected object key or end object, found: {:?}",
  102    142   
                        other
  103    143   
                    )),
  104    144   
                )
         145  +
            } /* JsonParserGenerator.kt:685 */
  105    146   
        }
         147  +
        /* JsonParserGenerator.kt:684 */
  106    148   
    }
  107         -
    }
         149  +
    /* JsonParserGenerator.kt:250 */
  108    150   
    if tokens.next().is_some() {
         151  +
        /* JsonParserGenerator.kt:251 */
  109    152   
        return Err(
  110    153   
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
  111    154   
                "found more JSON tokens after completing parsing",
  112    155   
            ),
  113    156   
        );
         157  +
        /* JsonParserGenerator.kt:250 */
  114    158   
    }
         159  +
    /* JsonParserGenerator.kt:163 */
  115    160   
    Ok(builder)
         161  +
    /* JsonParserGenerator.kt:148 */
  116    162   
}

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

@@ -1,1 +17,25 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
    2      3   
pub fn ser_content_type_parameters_output_output_output(
    3      4   
    value: &crate::output::ContentTypeParametersOutput,
    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_content_type_parameters_output::ser_content_type_parameters_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_content_type_parameters_output_output(
   13     19   
    #[allow(unused_variables)] object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   14     20   
    #[allow(unused_variables)] input: &crate::output::ContentTypeParametersOutput,
   15     21   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          22  +
    /* JsonSerializerGenerator.kt:372 */
   16     23   
    Ok(())
          24  +
    /* JsonSerializerGenerator.kt:358 */
   17     25   
}

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

@@ -1,1 +311,402 @@
    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_defaults<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<crate::model::defaults::Builder>,
    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::defaults::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   
                            "defaultString" => {
          37  +
                                /* JsonParserGenerator.kt:276 */
   27     38   
                                if let Some(v) =
   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:278 */{
   34     45   
                                                                            builder = builder.set_default_string(v);
   35     46   
                                                                        }
          47  +
                                /* JsonParserGenerator.kt:262 */
   36     48   
                            }
          49  +
                            /* JsonParserGenerator.kt:262 */
   37     50   
                            "defaultBoolean" => {
          51  +
                                /* JsonParserGenerator.kt:276 */
   38     52   
                                if let Some(v) =
   39         -
                                    ::aws_smithy_json::deserialize::token::expect_bool_or_null(
   40         -
                                        tokens.next(),
   41         -
                                    )?
   42         -
                                {
          53  +
                                /* JsonParserGenerator.kt:298 */::aws_smithy_json::deserialize::token::expect_bool_or_null(tokens.next())?
          54  +
                                /* JsonParserGenerator.kt:278 */{
   43     55   
                                                                            builder = builder.set_default_boolean(v);
   44     56   
                                                                        }
          57  +
                                /* JsonParserGenerator.kt:262 */
   45     58   
                            }
          59  +
                            /* JsonParserGenerator.kt:262 */
   46     60   
                            "defaultList" => {
          61  +
                                /* JsonParserGenerator.kt:276 */
   47     62   
                                if let Some(v) =
   48         -
                                crate::protocol_serde::shape_test_string_list::de_test_string_list(tokens)?
   49         -
                                {
          63  +
                                /* JsonParserGenerator.kt:451 */crate::protocol_serde::shape_test_string_list::de_test_string_list(tokens)?
          64  +
                                /* JsonParserGenerator.kt:278 */{
   50     65   
                                                                            builder = builder.set_default_list(v);
   51     66   
                                                                        }
          67  +
                                /* JsonParserGenerator.kt:262 */
   52     68   
                            }
          69  +
                            /* JsonParserGenerator.kt:262 */
   53     70   
                            "defaultDocumentMap" => {
   54         -
                                if let Some(v) = Some(
   55         -
                                    ::aws_smithy_json::deserialize::token::expect_document(tokens)?,
   56         -
                                ) {
          71  +
                                /* JsonParserGenerator.kt:276 */
          72  +
                                if let Some(v) =
          73  +
                                    /* JsonParserGenerator.kt:319 */
          74  +
                                    Some(
          75  +
                                        ::aws_smithy_json::deserialize::token::expect_document(
          76  +
                                            tokens,
          77  +
                                        )?,
          78  +
                                    )
          79  +
                                /* JsonParserGenerator.kt:278 */
          80  +
                                {
   57     81   
                                    builder = builder.set_default_document_map(v);
   58     82   
                                }
          83  +
                                /* JsonParserGenerator.kt:262 */
   59     84   
                            }
          85  +
                            /* JsonParserGenerator.kt:262 */
   60     86   
                            "defaultDocumentString" => {
   61         -
                                if let Some(v) = Some(
   62         -
                                    ::aws_smithy_json::deserialize::token::expect_document(tokens)?,
   63         -
                                ) {
          87  +
                                /* JsonParserGenerator.kt:276 */
          88  +
                                if let Some(v) =
          89  +
                                    /* JsonParserGenerator.kt:319 */
          90  +
                                    Some(
          91  +
                                        ::aws_smithy_json::deserialize::token::expect_document(
          92  +
                                            tokens,
          93  +
                                        )?,
          94  +
                                    )
          95  +
                                /* JsonParserGenerator.kt:278 */
          96  +
                                {
   64     97   
                                    builder = builder.set_default_document_string(v);
   65     98   
                                }
          99  +
                                /* JsonParserGenerator.kt:262 */
   66    100   
                            }
         101  +
                            /* JsonParserGenerator.kt:262 */
   67    102   
                            "defaultDocumentBoolean" => {
   68         -
                                if let Some(v) = Some(
   69         -
                                    ::aws_smithy_json::deserialize::token::expect_document(tokens)?,
   70         -
                                ) {
         103  +
                                /* JsonParserGenerator.kt:276 */
         104  +
                                if let Some(v) =
         105  +
                                    /* JsonParserGenerator.kt:319 */
         106  +
                                    Some(
         107  +
                                        ::aws_smithy_json::deserialize::token::expect_document(
         108  +
                                            tokens,
         109  +
                                        )?,
         110  +
                                    )
         111  +
                                /* JsonParserGenerator.kt:278 */
         112  +
                                {
   71    113   
                                    builder = builder.set_default_document_boolean(v);
   72    114   
                                }
         115  +
                                /* JsonParserGenerator.kt:262 */
   73    116   
                            }
         117  +
                            /* JsonParserGenerator.kt:262 */
   74    118   
                            "defaultDocumentList" => {
   75         -
                                if let Some(v) = Some(
   76         -
                                    ::aws_smithy_json::deserialize::token::expect_document(tokens)?,
   77         -
                                ) {
         119  +
                                /* JsonParserGenerator.kt:276 */
         120  +
                                if let Some(v) =
         121  +
                                    /* JsonParserGenerator.kt:319 */
         122  +
                                    Some(
         123  +
                                        ::aws_smithy_json::deserialize::token::expect_document(
         124  +
                                            tokens,
         125  +
                                        )?,
         126  +
                                    )
         127  +
                                /* JsonParserGenerator.kt:278 */
         128  +
                                {
   78    129   
                                    builder = builder.set_default_document_list(v);
   79    130   
                                }
         131  +
                                /* JsonParserGenerator.kt:262 */
   80    132   
                            }
         133  +
                            /* JsonParserGenerator.kt:262 */
   81    134   
                            "defaultNullDocument" => {
   82         -
                                builder = builder.set_default_null_document(Some(
   83         -
                                    ::aws_smithy_json::deserialize::token::expect_document(tokens)?,
   84         -
                                ));
   85         -
                            }
         135  +
                                /* JsonParserGenerator.kt:272 */
         136  +
                                builder = builder.set_default_null_document(
         137  +
                                    /* JsonParserGenerator.kt:319 */
         138  +
                                    Some(::aws_smithy_json::deserialize::token::expect_document(
         139  +
                                        tokens,
         140  +
                                    )?), /* JsonParserGenerator.kt:272 */
         141  +
                                );
         142  +
                                /* JsonParserGenerator.kt:262 */
         143  +
                            }
         144  +
                            /* JsonParserGenerator.kt:262 */
   86    145   
                            "defaultTimestamp" => {
         146  +
                                /* JsonParserGenerator.kt:276 */
   87    147   
                                if let Some(v) =
   88         -
                                    ::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
   89         -
                                        tokens.next(),
   90         -
                                        ::aws_smithy_types::date_time::Format::EpochSeconds,
   91         -
                                    )?
   92         -
                                {
         148  +
                                /* JsonParserGenerator.kt:384 */::aws_smithy_json::deserialize::token::expect_timestamp_or_null(tokens.next(), ::aws_smithy_types::date_time::Format::EpochSeconds)?
         149  +
                                /* JsonParserGenerator.kt:278 */{
   93    150   
                                                                            builder = builder.set_default_timestamp(v);
   94    151   
                                                                        }
         152  +
                                /* JsonParserGenerator.kt:262 */
   95    153   
                            }
         154  +
                            /* JsonParserGenerator.kt:262 */
   96    155   
                            "defaultBlob" => {
         156  +
                                /* JsonParserGenerator.kt:276 */
   97    157   
                                if let Some(v) =
   98         -
                                    ::aws_smithy_json::deserialize::token::expect_blob_or_null(
   99         -
                                        tokens.next(),
  100         -
                                    )?
  101         -
                                {
         158  +
                                /* JsonParserGenerator.kt:326 */::aws_smithy_json::deserialize::token::expect_blob_or_null(tokens.next())?
         159  +
                                /* JsonParserGenerator.kt:278 */{
  102    160   
                                                                            builder = builder.set_default_blob(v);
  103    161   
                                                                        }
         162  +
                                /* JsonParserGenerator.kt:262 */
  104    163   
                            }
         164  +
                            /* JsonParserGenerator.kt:262 */
  105    165   
                            "defaultByte" => {
         166  +
                                /* JsonParserGenerator.kt:276 */
  106    167   
                                if let Some(v) =
  107         -
                                    ::aws_smithy_json::deserialize::token::expect_number_or_null(
  108         -
                                        tokens.next(),
  109         -
                                    )?
         168  +
                                /* JsonParserGenerator.kt:365 */::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
  110    169   
                                                    .map(i8::try_from)
  111    170   
                                                    .transpose()?
  112         -
                                {
         171  +
                                /* JsonParserGenerator.kt:278 */{
  113    172   
                                                                            builder = builder.set_default_byte(v);
  114    173   
                                                                        }
         174  +
                                /* JsonParserGenerator.kt:262 */
  115    175   
                            }
         176  +
                            /* JsonParserGenerator.kt:262 */
  116    177   
                            "defaultShort" => {
         178  +
                                /* JsonParserGenerator.kt:276 */
  117    179   
                                if let Some(v) =
  118         -
                                    ::aws_smithy_json::deserialize::token::expect_number_or_null(
  119         -
                                        tokens.next(),
  120         -
                                    )?
         180  +
                                /* JsonParserGenerator.kt:365 */::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
  121    181   
                                                    .map(i16::try_from)
  122    182   
                                                    .transpose()?
  123         -
                                {
         183  +
                                /* JsonParserGenerator.kt:278 */{
  124    184   
                                                                            builder = builder.set_default_short(v);
  125    185   
                                                                        }
         186  +
                                /* JsonParserGenerator.kt:262 */
  126    187   
                            }
         188  +
                            /* JsonParserGenerator.kt:262 */
  127    189   
                            "defaultInteger" => {
         190  +
                                /* JsonParserGenerator.kt:276 */
  128    191   
                                if let Some(v) =
  129         -
                                    ::aws_smithy_json::deserialize::token::expect_number_or_null(
  130         -
                                        tokens.next(),
  131         -
                                    )?
         192  +
                                /* JsonParserGenerator.kt:365 */::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
  132    193   
                                                    .map(i32::try_from)
  133    194   
                                                    .transpose()?
  134         -
                                {
         195  +
                                /* JsonParserGenerator.kt:278 */{
  135    196   
                                                                            builder = builder.set_default_integer(v);
  136    197   
                                                                        }
         198  +
                                /* JsonParserGenerator.kt:262 */
  137    199   
                            }
         200  +
                            /* JsonParserGenerator.kt:262 */
  138    201   
                            "defaultLong" => {
         202  +
                                /* JsonParserGenerator.kt:276 */
  139    203   
                                if let Some(v) =
  140         -
                                    ::aws_smithy_json::deserialize::token::expect_number_or_null(
  141         -
                                        tokens.next(),
  142         -
                                    )?
         204  +
                                /* JsonParserGenerator.kt:365 */::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
  143    205   
                                                    .map(i64::try_from)
  144    206   
                                                    .transpose()?
  145         -
                                {
         207  +
                                /* JsonParserGenerator.kt:278 */{
  146    208   
                                                                            builder = builder.set_default_long(v);
  147    209   
                                                                        }
         210  +
                                /* JsonParserGenerator.kt:262 */
  148    211   
                            }
         212  +
                            /* JsonParserGenerator.kt:262 */
  149    213   
                            "defaultFloat" => {
         214  +
                                /* JsonParserGenerator.kt:276 */
  150    215   
                                if let Some(v) =
  151         -
                                    ::aws_smithy_json::deserialize::token::expect_number_or_null(
  152         -
                                        tokens.next(),
  153         -
                                    )?
  154         -
                                    .map(|v| v.to_f32_lossy())
  155         -
                                {
         216  +
                                /* JsonParserGenerator.kt:361 */::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?.map(|v| v.to_f32_lossy())
         217  +
                                /* JsonParserGenerator.kt:278 */{
  156    218   
                                                                            builder = builder.set_default_float(v);
  157    219   
                                                                        }
         220  +
                                /* JsonParserGenerator.kt:262 */
  158    221   
                            }
         222  +
                            /* JsonParserGenerator.kt:262 */
  159    223   
                            "defaultDouble" => {
         224  +
                                /* JsonParserGenerator.kt:276 */
  160    225   
                                if let Some(v) =
  161         -
                                    ::aws_smithy_json::deserialize::token::expect_number_or_null(
  162         -
                                        tokens.next(),
  163         -
                                    )?
  164         -
                                    .map(|v| v.to_f64_lossy())
  165         -
                                {
         226  +
                                /* JsonParserGenerator.kt:363 */::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?.map(|v| v.to_f64_lossy())
         227  +
                                /* JsonParserGenerator.kt:278 */{
  166    228   
                                                                            builder = builder.set_default_double(v);
  167    229   
                                                                        }
         230  +
                                /* JsonParserGenerator.kt:262 */
  168    231   
                            }
         232  +
                            /* JsonParserGenerator.kt:262 */
  169    233   
                            "defaultMap" => {
         234  +
                                /* JsonParserGenerator.kt:276 */
  170    235   
                                if let Some(v) =
  171         -
                                crate::protocol_serde::shape_test_string_map::de_test_string_map(tokens)?
  172         -
                                {
         236  +
                                /* JsonParserGenerator.kt:509 */crate::protocol_serde::shape_test_string_map::de_test_string_map(tokens)?
         237  +
                                /* JsonParserGenerator.kt:278 */{
  173    238   
                                                                            builder = builder.set_default_map(v);
  174    239   
                                                                        }
         240  +
                                /* JsonParserGenerator.kt:262 */
  175    241   
                            }
         242  +
                            /* JsonParserGenerator.kt:262 */
  176    243   
                            "defaultEnum" => {
         244  +
                                /* JsonParserGenerator.kt:276 */
  177    245   
                                if let Some(v) =
  178         -
                                    ::aws_smithy_json::deserialize::token::expect_string_or_null(
  179         -
                                        tokens.next(),
  180         -
                                    )?
  181         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  182         -
                                    .transpose()?
  183         -
                                {
         246  +
                                /* JsonParserGenerator.kt:354 */::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?.map(|s|
         247  +
                                    /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
         248  +
                                        /* JsonParserGenerator.kt:343 */u.into_owned()
         249  +
                                    /* JsonParserGenerator.kt:339 */)
         250  +
                                /* JsonParserGenerator.kt:354 */).transpose()?
         251  +
                                /* JsonParserGenerator.kt:278 */{
  184    252   
                                                                            builder = builder.set_default_enum(v);
  185    253   
                                                                        }
         254  +
                                /* JsonParserGenerator.kt:262 */
  186    255   
                            }
         256  +
                            /* JsonParserGenerator.kt:262 */
  187    257   
                            "defaultIntEnum" => {
         258  +
                                /* JsonParserGenerator.kt:276 */
  188    259   
                                if let Some(v) =
  189         -
                                    ::aws_smithy_json::deserialize::token::expect_number_or_null(
  190         -
                                        tokens.next(),
  191         -
                                    )?
         260  +
                                /* JsonParserGenerator.kt:365 */::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
  192    261   
                                                    .map(i32::try_from)
  193    262   
                                                    .transpose()?
  194         -
                                {
         263  +
                                /* JsonParserGenerator.kt:278 */{
  195    264   
                                                                            builder = builder.set_default_int_enum(v);
  196    265   
                                                                        }
         266  +
                                /* JsonParserGenerator.kt:262 */
  197    267   
                            }
         268  +
                            /* JsonParserGenerator.kt:262 */
  198    269   
                            "emptyString" => {
         270  +
                                /* JsonParserGenerator.kt:276 */
  199    271   
                                if let Some(v) =
  200         -
                                    ::aws_smithy_json::deserialize::token::expect_string_or_null(
  201         -
                                        tokens.next(),
  202         -
                                    )?
  203         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  204         -
                                    .transpose()?
  205         -
                                {
         272  +
                                /* JsonParserGenerator.kt:354 */::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?.map(|s|
         273  +
                                    /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
         274  +
                                        /* JsonParserGenerator.kt:348 */u.into_owned()
         275  +
                                    /* JsonParserGenerator.kt:339 */)
         276  +
                                /* JsonParserGenerator.kt:354 */).transpose()?
         277  +
                                /* JsonParserGenerator.kt:278 */{
  206    278   
                                                                            builder = builder.set_empty_string(v);
  207    279   
                                                                        }
         280  +
                                /* JsonParserGenerator.kt:262 */
  208    281   
                            }
         282  +
                            /* JsonParserGenerator.kt:262 */
  209    283   
                            "falseBoolean" => {
         284  +
                                /* JsonParserGenerator.kt:276 */
  210    285   
                                if let Some(v) =
  211         -
                                    ::aws_smithy_json::deserialize::token::expect_bool_or_null(
  212         -
                                        tokens.next(),
  213         -
                                    )?
  214         -
                                {
         286  +
                                /* JsonParserGenerator.kt:298 */::aws_smithy_json::deserialize::token::expect_bool_or_null(tokens.next())?
         287  +
                                /* JsonParserGenerator.kt:278 */{
  215    288   
                                                                            builder = builder.set_false_boolean(v);
  216    289   
                                                                        }
         290  +
                                /* JsonParserGenerator.kt:262 */
  217    291   
                            }
         292  +
                            /* JsonParserGenerator.kt:262 */
  218    293   
                            "emptyBlob" => {
         294  +
                                /* JsonParserGenerator.kt:276 */
  219    295   
                                if let Some(v) =
  220         -
                                    ::aws_smithy_json::deserialize::token::expect_blob_or_null(
  221         -
                                        tokens.next(),
  222         -
                                    )?
  223         -
                                {
         296  +
                                /* JsonParserGenerator.kt:326 */::aws_smithy_json::deserialize::token::expect_blob_or_null(tokens.next())?
         297  +
                                /* JsonParserGenerator.kt:278 */{
  224    298   
                                                                            builder = builder.set_empty_blob(v);
  225    299   
                                                                        }
         300  +
                                /* JsonParserGenerator.kt:262 */
  226    301   
                            }
         302  +
                            /* JsonParserGenerator.kt:262 */
  227    303   
                            "zeroByte" => {
         304  +
                                /* JsonParserGenerator.kt:276 */
  228    305   
                                if let Some(v) =
  229         -
                                    ::aws_smithy_json::deserialize::token::expect_number_or_null(
  230         -
                                        tokens.next(),
  231         -
                                    )?
         306  +
                                /* JsonParserGenerator.kt:365 */::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
  232    307   
                                                    .map(i8::try_from)
  233    308   
                                                    .transpose()?
  234         -
                                {
         309  +
                                /* JsonParserGenerator.kt:278 */{
  235    310   
                                                                            builder = builder.set_zero_byte(v);
  236    311   
                                                                        }
         312  +
                                /* JsonParserGenerator.kt:262 */
  237    313   
                            }
         314  +
                            /* JsonParserGenerator.kt:262 */
  238    315   
                            "zeroShort" => {
         316  +
                                /* JsonParserGenerator.kt:276 */
  239    317   
                                if let Some(v) =
  240         -
                                    ::aws_smithy_json::deserialize::token::expect_number_or_null(
  241         -
                                        tokens.next(),
  242         -
                                    )?
         318  +
                                /* JsonParserGenerator.kt:365 */::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
  243    319   
                                                    .map(i16::try_from)
  244    320   
                                                    .transpose()?
  245         -
                                {
         321  +
                                /* JsonParserGenerator.kt:278 */{
  246    322   
                                                                            builder = builder.set_zero_short(v);
  247    323   
                                                                        }
         324  +
                                /* JsonParserGenerator.kt:262 */
  248    325   
                            }
         326  +
                            /* JsonParserGenerator.kt:262 */
  249    327   
                            "zeroInteger" => {
         328  +
                                /* JsonParserGenerator.kt:276 */
  250    329   
                                if let Some(v) =
  251         -
                                    ::aws_smithy_json::deserialize::token::expect_number_or_null(
  252         -
                                        tokens.next(),
  253         -
                                    )?
         330  +
                                /* JsonParserGenerator.kt:365 */::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
  254    331   
                                                    .map(i32::try_from)
  255    332   
                                                    .transpose()?
  256         -
                                {
         333  +
                                /* JsonParserGenerator.kt:278 */{
  257    334   
                                                                            builder = builder.set_zero_integer(v);
  258    335   
                                                                        }
         336  +
                                /* JsonParserGenerator.kt:262 */
  259    337   
                            }
         338  +
                            /* JsonParserGenerator.kt:262 */
  260    339   
                            "zeroLong" => {
         340  +
                                /* JsonParserGenerator.kt:276 */
  261    341   
                                if let Some(v) =
  262         -
                                    ::aws_smithy_json::deserialize::token::expect_number_or_null(
  263         -
                                        tokens.next(),
  264         -
                                    )?
         342  +
                                /* JsonParserGenerator.kt:365 */::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
  265    343   
                                                    .map(i64::try_from)
  266    344   
                                                    .transpose()?
  267         -
                                {
         345  +
                                /* JsonParserGenerator.kt:278 */{
  268    346   
                                                                            builder = builder.set_zero_long(v);
  269    347   
                                                                        }
         348  +
                                /* JsonParserGenerator.kt:262 */
  270    349   
                            }
         350  +
                            /* JsonParserGenerator.kt:262 */
  271    351   
                            "zeroFloat" => {
         352  +
                                /* JsonParserGenerator.kt:276 */
  272    353   
                                if let Some(v) =
  273         -
                                    ::aws_smithy_json::deserialize::token::expect_number_or_null(
  274         -
                                        tokens.next(),
  275         -
                                    )?
  276         -
                                    .map(|v| v.to_f32_lossy())
  277         -
                                {
         354  +
                                /* JsonParserGenerator.kt:361 */::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?.map(|v| v.to_f32_lossy())
         355  +
                                /* JsonParserGenerator.kt:278 */{
  278    356   
                                                                            builder = builder.set_zero_float(v);
  279    357   
                                                                        }
         358  +
                                /* JsonParserGenerator.kt:262 */
  280    359   
                            }
         360  +
                            /* JsonParserGenerator.kt:262 */
  281    361   
                            "zeroDouble" => {
         362  +
                                /* JsonParserGenerator.kt:276 */
  282    363   
                                if let Some(v) =
  283         -
                                    ::aws_smithy_json::deserialize::token::expect_number_or_null(
  284         -
                                        tokens.next(),
  285         -
                                    )?
  286         -
                                    .map(|v| v.to_f64_lossy())
  287         -
                                {
         364  +
                                /* JsonParserGenerator.kt:363 */::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?.map(|v| v.to_f64_lossy())
         365  +
                                /* JsonParserGenerator.kt:278 */{
  288    366   
                                                                            builder = builder.set_zero_double(v);
  289    367   
                                                                        }
         368  +
                                /* JsonParserGenerator.kt:262 */
  290    369   
                            }
  291         -
                            _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
         370  +
                            /* JsonParserGenerator.kt:290 */
         371  +
                            _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
  292    372   
                        }
         373  +
                        /* JsonParserGenerator.kt:686 */
  293    374   
                    }
         375  +
                    /* JsonParserGenerator.kt:695 */
  294    376   
                    other => {
  295    377   
                        return Err(
  296    378   
                            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
  297    379   
                                format!("expected object key or end object, found: {:?}", other),
  298    380   
                            ),
  299    381   
                        )
         382  +
                    } /* JsonParserGenerator.kt:685 */
  300    383   
                }
         384  +
                /* JsonParserGenerator.kt:684 */
  301    385   
            }
  302         -
            }
         386  +
            /* JsonParserGenerator.kt:540 */
  303    387   
            Ok(Some(builder))
         388  +
            /* JsonParserGenerator.kt:713 */
  304    389   
        }
  305         -
        _ => Err(
         390  +
        /* JsonParserGenerator.kt:722 */
         391  +
        _ => {
         392  +
            /* JsonParserGenerator.kt:723 */
         393  +
            Err(
  306    394   
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
  307    395   
                    "expected start object or null",
  308    396   
                ),
  309         -
        ),
         397  +
            )
         398  +
            /* JsonParserGenerator.kt:722 */
         399  +
        } /* JsonParserGenerator.kt:712 */
  310    400   
    }
         401  +
    /* JsonParserGenerator.kt:516 */
  311    402   
}

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

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

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

@@ -1,1 +48,74 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:398 */
    2      3   
pub(crate) fn de_dialog_list<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<::std::vec::Vec<crate::model::Dialog>>,
    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::StartArray { .. }) => {
          22  +
            /* JsonParserGenerator.kt:407 */
   19     23   
            let mut items = Vec::new();
          24  +
            /* JsonParserGenerator.kt:408 */
   20     25   
            loop {
          26  +
                /* JsonParserGenerator.kt:409 */
   21     27   
                match tokens.peek() {
          28  +
                    /* JsonParserGenerator.kt:410 */
   22     29   
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
          30  +
                        /* JsonParserGenerator.kt:411 */
   23     31   
                        tokens.next().transpose().unwrap();
   24     32   
                        break;
          33  +
                        /* JsonParserGenerator.kt:410 */
   25     34   
                    }
          35  +
                    /* JsonParserGenerator.kt:413 */
   26     36   
                    _ => {
   27         -
                        let value = crate::protocol_serde::shape_dialog::de_dialog(tokens)?;
          37  +
                        /* JsonParserGenerator.kt:419 */
          38  +
                        let value =
          39  +
                            /* JsonParserGenerator.kt:544 */crate::protocol_serde::shape_dialog::de_dialog(tokens)?
          40  +
                        /* JsonParserGenerator.kt:419 */;
          41  +
                        /* JsonParserGenerator.kt:422 */
   28     42   
                        if let Some(value) = value {
   29     43   
                            items.push(value);
   30         -
                        } else {
          44  +
                        }
          45  +
                        /* JsonParserGenerator.kt:430 */
          46  +
                        else {
   31     47   
                            return Err(
   32     48   
                                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   33     49   
                                    "dense list cannot contain null values",
   34     50   
                                ),
   35     51   
                            );
   36     52   
                        }
          53  +
                        /* JsonParserGenerator.kt:413 */
          54  +
                    } /* JsonParserGenerator.kt:409 */
   37     55   
                }
          56  +
                /* JsonParserGenerator.kt:408 */
   38     57   
            }
   39         -
            }
          58  +
            /* JsonParserGenerator.kt:446 */
   40     59   
            Ok(Some(items))
          60  +
            /* JsonParserGenerator.kt:713 */
   41     61   
        }
   42         -
        _ => Err(
          62  +
        /* JsonParserGenerator.kt:722 */
          63  +
        _ => {
          64  +
            /* JsonParserGenerator.kt:723 */
          65  +
            Err(
   43     66   
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   44     67   
                    "expected start array or null",
   45     68   
                ),
   46         -
        ),
          69  +
            )
          70  +
            /* JsonParserGenerator.kt:722 */
          71  +
        } /* JsonParserGenerator.kt:712 */
   47     72   
    }
          73  +
    /* JsonParserGenerator.kt:398 */
   48     74   
}

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

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

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

@@ -1,1 +55,78 @@
    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_empty_input_and_empty_output_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::EmptyInputAndEmptyOutputInput,
    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::empty_input_and_empty_output_input::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_empty_input_and_empty_output_http_response(
   28     40   
    #[allow(unused_variables)] output: crate::output::EmptyInputAndEmptyOutputOutput,
   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.0",
   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_empty_input_and_empty_output_output::ser_empty_input_and_empty_output_output_output_output(&output)?
   45         -
        ;
          62  +
            /* HttpBoundProtocolPayloadGenerator.kt:237 */crate::protocol_serde::shape_empty_input_and_empty_output_output::ser_empty_input_and_empty_output_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   
}

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

@@ -1,1 +17,25 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
    2      3   
pub fn ser_empty_input_and_empty_output_output_output_output(
    3      4   
    value: &crate::output::EmptyInputAndEmptyOutputOutput,
    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_empty_input_and_empty_output_output::ser_empty_input_and_empty_output_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_empty_input_and_empty_output_output_output(
   13     19   
    #[allow(unused_variables)] object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   14     20   
    #[allow(unused_variables)] input: &crate::output::EmptyInputAndEmptyOutputOutput,
   15     21   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          22  +
    /* JsonSerializerGenerator.kt:372 */
   16     23   
    Ok(())
          24  +
    /* JsonSerializerGenerator.kt:358 */
   17     25   
}

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

@@ -1,1 +53,78 @@
    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_endpoint_operation_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::EndpointOperationInput,
    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::endpoint_operation_input::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_endpoint_operation_http_response(
   28     40   
    #[allow(unused_variables)] output: crate::output::EndpointOperationOutput,
   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.0",
   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   
}

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

@@ -1,1 +144,210 @@
    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_endpoint_with_host_label_operation_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::EndpointWithHostLabelOperationInput,
    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::endpoint_with_host_label_operation_input::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.0"),
   27     37   
            )?;
   28     38   
            input = crate::protocol_serde::shape_endpoint_with_host_label_operation::de_endpoint_with_host_label_operation(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_endpoint_with_host_label_operation_http_response(
   36     52   
    #[allow(unused_variables)] output: crate::output::EndpointWithHostLabelOperationOutput,
   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.0",
   48     68   
        );
          69  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   49     70   
        let http_status: u16 = 200;
   50     71   
        builder = builder.status(http_status);
   51         -
        let payload = "";
          72  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
          73  +
        let payload =
          74  +
            /* HttpBoundProtocolPayloadGenerator.kt:235 */""
          75  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
          76  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   52     77   
        let content_length = payload.len();
   53     78   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   54     79   
            builder,
   55     80   
            ::http::header::CONTENT_LENGTH,
   56     81   
            content_length,
   57     82   
        );
          83  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   58     84   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          85  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   59     86   
        builder.body(body)?
          87  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   60     88   
    })
          89  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   61     90   
}
   62     91   
          92  +
/* RustType.kt:516 */
   63     93   
#[allow(clippy::unnecessary_wraps)]
          94  +
/* ServerHttpBoundProtocolGenerator.kt:447 */
   64     95   
pub fn ser_endpoint_with_host_label_operation_http_error(
   65     96   
    error: &crate::error::EndpointWithHostLabelOperationError,
   66     97   
) -> std::result::Result<
   67     98   
    ::aws_smithy_http_server::response::Response,
   68     99   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   69    100   
> {
         101  +
    /* ServerHttpBoundProtocolGenerator.kt:452 */
   70    102   
    Ok({
         103  +
        /* ServerHttpBoundProtocolGenerator.kt:468 */
   71    104   
        match error {
         105  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
   72    106   
            crate::error::EndpointWithHostLabelOperationError::ValidationException(output) => {
         107  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
   73    108   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
         109  +
                /* RustType.kt:516 */
   74    110   
                #[allow(unused_mut)]
         111  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
   75    112   
                let mut builder = ::http::Response::builder();
         113  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   76    114   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   77    115   
                    builder,
   78    116   
                    ::http::header::CONTENT_TYPE,
   79    117   
                    "application/x-amz-json-1.0",
   80    118   
                );
         119  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
   81    120   
                let content_length = payload.len();
   82    121   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   83    122   
                    builder,
   84    123   
                    ::http::header::CONTENT_LENGTH,
   85    124   
                    content_length,
   86    125   
                );
         126  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
   87    127   
                builder
   88    128   
                    .status(400)
   89    129   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         130  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
         131  +
            } /* ServerHttpBoundProtocolGenerator.kt:468 */
   90    132   
        }
   91         -
        }
         133  +
        /* ServerHttpBoundProtocolGenerator.kt:452 */
   92    134   
    })
         135  +
    /* ServerHttpBoundProtocolGenerator.kt:447 */
   93    136   
}
   94    137   
         138  +
/* JsonParserGenerator.kt:148 */
   95    139   
pub(crate) fn de_endpoint_with_host_label_operation(
   96    140   
    value: &[u8],
   97    141   
    mut builder: crate::input::endpoint_with_host_label_operation_input::Builder,
   98    142   
) -> ::std::result::Result<
   99    143   
    crate::input::endpoint_with_host_label_operation_input::Builder,
  100    144   
    ::aws_smithy_json::deserialize::error::DeserializeError,
  101    145   
> {
         146  +
    /* JsonParserGenerator.kt:153 */
  102    147   
    let mut tokens_owned =
  103    148   
        ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value))
  104    149   
            .peekable();
  105    150   
    let tokens = &mut tokens_owned;
  106    151   
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
         152  +
    /* JsonParserGenerator.kt:684 */
  107    153   
    loop {
         154  +
        /* JsonParserGenerator.kt:685 */
  108    155   
        match tokens.next().transpose()? {
         156  +
            /* JsonParserGenerator.kt:686 */
  109    157   
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
  110    158   
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
         159  +
                /* JsonParserGenerator.kt:260 */
  111    160   
                match key.to_unescaped()?.as_ref() {
         161  +
                    /* JsonParserGenerator.kt:262 */
  112    162   
                    "label" => {
         163  +
                        /* JsonParserGenerator.kt:276 */
  113    164   
                        if let Some(v) =
         165  +
                            /* JsonParserGenerator.kt:354 */
  114    166   
                            ::aws_smithy_json::deserialize::token::expect_string_or_null(
  115    167   
                                    tokens.next(),
  116    168   
                                )?
  117         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
         169  +
                                .map(|s|
         170  +
                            /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
         171  +
                                /* JsonParserGenerator.kt:348 */u.into_owned()
         172  +
                            /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
  118    173   
                                .transpose()?
         174  +
                        /* JsonParserGenerator.kt:278 */
  119    175   
                        {
  120    176   
                            builder = builder.set_label(v);
  121    177   
                        }
         178  +
                        /* JsonParserGenerator.kt:262 */
  122    179   
                    }
  123         -
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
         180  +
                    /* JsonParserGenerator.kt:290 */
         181  +
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
  124    182   
                }
         183  +
                /* JsonParserGenerator.kt:686 */
  125    184   
            }
         185  +
            /* JsonParserGenerator.kt:695 */
  126    186   
            other => {
  127    187   
                return Err(
  128    188   
                    ::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  129    189   
                        "expected object key or end object, found: {:?}",
  130    190   
                        other
  131    191   
                    )),
  132    192   
                )
         193  +
            } /* JsonParserGenerator.kt:685 */
  133    194   
        }
         195  +
        /* JsonParserGenerator.kt:684 */
  134    196   
    }
  135         -
    }
         197  +
    /* JsonParserGenerator.kt:250 */
  136    198   
    if tokens.next().is_some() {
         199  +
        /* JsonParserGenerator.kt:251 */
  137    200   
        return Err(
  138    201   
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
  139    202   
                "found more JSON tokens after completing parsing",
  140    203   
            ),
  141    204   
        );
         205  +
        /* JsonParserGenerator.kt:250 */
  142    206   
    }
         207  +
    /* JsonParserGenerator.kt:163 */
  143    208   
    Ok(builder)
         209  +
    /* JsonParserGenerator.kt:148 */
  144    210   
}

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

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

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

@@ -1,1 +20,29 @@
    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
    9     13   
        .key("__type")
   10     14   
        .string("aws.protocoltests.json10#FooError");
          15  +
    /* JsonSerializerGenerator.kt:227 */
   11     16   
    object.finish();
   12     17   
    Ok(out)
          18  +
    /* JsonSerializerGenerator.kt:213 */
   13     19   
}
   14     20   
          21  +
/* JsonSerializerGenerator.kt:358 */
   15     22   
pub fn ser_foo_error(
   16     23   
    #[allow(unused_variables)] object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   17     24   
    #[allow(unused_variables)] input: &crate::error::FooError,
   18     25   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          26  +
    /* JsonSerializerGenerator.kt:372 */
   19     27   
    Ok(())
          28  +
    /* JsonSerializerGenerator.kt:358 */
   20     29   
}