Client Test

Client Test

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943

Files changed:

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/protocol_serde/shape_null_operation.rs

@@ -1,1 +77,123 @@
    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  +
/* ProtocolParserGenerator.kt:99 */
    3      5   
pub fn de_null_operation_http_error(
    4      6   
    _response_status: u16,
    5      7   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6      8   
    _response_body: &[u8],
    7      9   
) -> std::result::Result<crate::operation::null_operation::NullOperationOutput, crate::operation::null_operation::NullOperationError> {
          10  +
    /* RustType.kt:516 */
    8     11   
    #[allow(unused_mut)]
          12  +
    /* ProtocolParserGenerator.kt:106 */
    9     13   
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   10     14   
        .map_err(crate::operation::null_operation::NullOperationError::unhandled)?;
          15  +
    /* ProtocolParserGenerator.kt:120 */
   11     16   
    let generic = generic_builder.build();
          17  +
    /* ProtocolParserGenerator.kt:185 */
   12     18   
    Err(crate::operation::null_operation::NullOperationError::generic(generic))
          19  +
    /* ProtocolParserGenerator.kt:99 */
   13     20   
}
   14     21   
          22  +
/* RustType.kt:516 */
   15     23   
#[allow(clippy::unnecessary_wraps)]
          24  +
/* ProtocolParserGenerator.kt:71 */
   16     25   
pub fn de_null_operation_http_response(
   17     26   
    _response_status: u16,
   18     27   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   19     28   
    _response_body: &[u8],
   20     29   
) -> std::result::Result<crate::operation::null_operation::NullOperationOutput, crate::operation::null_operation::NullOperationError> {
          30  +
    /* ProtocolParserGenerator.kt:77 */
   21     31   
    Ok({
          32  +
        /* RustType.kt:516 */
   22     33   
        #[allow(unused_mut)]
          34  +
        /* ProtocolParserGenerator.kt:240 */
   23     35   
        let mut output = crate::operation::null_operation::builders::NullOperationOutputBuilder::default();
          36  +
        /* ProtocolParserGenerator.kt:247 */
   24     37   
        output = crate::protocol_serde::shape_null_operation::de_null_operation(_response_body, output)
   25     38   
            .map_err(crate::operation::null_operation::NullOperationError::unhandled)?;
          39  +
        /* ClientBuilderInstantiator.kt:56 */
   26     40   
        output.build()
          41  +
        /* ProtocolParserGenerator.kt:77 */
   27     42   
    })
          43  +
    /* ProtocolParserGenerator.kt:71 */
   28     44   
}
   29     45   
          46  +
/* JsonSerializerGenerator.kt:287 */
   30     47   
pub fn ser_null_operation_input(
   31     48   
    input: &crate::operation::null_operation::NullOperationInput,
   32     49   
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
          50  +
    /* JsonSerializerGenerator.kt:291 */
   33     51   
    let mut out = String::new();
          52  +
    /* JsonSerializerGenerator.kt:292 */
   34     53   
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
          54  +
    /* JsonSerializerGenerator.kt:375 */
   35     55   
    crate::protocol_serde::shape_null_operation_input::ser_null_operation_input_input(&mut object, input)?;
          56  +
    /* JsonSerializerGenerator.kt:295 */
   36     57   
    object.finish();
          58  +
    /* JsonSerializerGenerator.kt:296 */
   37     59   
    Ok(::aws_smithy_types::body::SdkBody::from(out))
          60  +
    /* JsonSerializerGenerator.kt:287 */
   38     61   
}
   39     62   
          63  +
/* JsonParserGenerator.kt:148 */
   40     64   
pub(crate) fn de_null_operation(
   41     65   
    value: &[u8],
   42     66   
    mut builder: crate::operation::null_operation::builders::NullOperationOutputBuilder,
   43     67   
) -> ::std::result::Result<
   44     68   
    crate::operation::null_operation::builders::NullOperationOutputBuilder,
   45     69   
    ::aws_smithy_json::deserialize::error::DeserializeError,
   46     70   
> {
          71  +
    /* JsonParserGenerator.kt:153 */
   47     72   
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable();
   48     73   
    let tokens = &mut tokens_owned;
   49     74   
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
          75  +
    /* JsonParserGenerator.kt:684 */
   50     76   
    loop {
          77  +
        /* JsonParserGenerator.kt:685 */
   51     78   
        match tokens.next().transpose()? {
   52         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   53         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   54         -
                "string" => {
   55         -
                    builder = builder.set_string(
   56         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   57         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   58         -
                            .transpose()?,
   59         -
                    );
          79  +
            /* JsonParserGenerator.kt:686 */ Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
          80  +
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
          81  +
                /* JsonParserGenerator.kt:260 */
          82  +
                match key.to_unescaped()?.as_ref() {
          83  +
                    /* JsonParserGenerator.kt:262 */
          84  +
                    "string" => {
          85  +
                        /* JsonParserGenerator.kt:265 */
          86  +
                        builder = builder.set_string(
          87  +
                            /* JsonParserGenerator.kt:354 */
          88  +
                            ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
          89  +
                                .map(|s|
          90  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          91  +
                                    /* JsonParserGenerator.kt:348 */u.into_owned()
          92  +
                                /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
          93  +
                                .transpose()?, /* JsonParserGenerator.kt:265 */
          94  +
                        );
          95  +
                        /* JsonParserGenerator.kt:262 */
          96  +
                    }
          97  +
                    /* JsonParserGenerator.kt:290 */
          98  +
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
   60     99   
                }
   61         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   62         -
            },
         100  +
                /* JsonParserGenerator.kt:686 */
         101  +
            }
         102  +
            /* JsonParserGenerator.kt:695 */
   63    103   
            other => {
   64    104   
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   65    105   
                    "expected object key or end object, found: {:?}",
   66    106   
                    other
   67    107   
                )))
   68         -
            }
         108  +
            } /* JsonParserGenerator.kt:685 */
   69    109   
        }
         110  +
        /* JsonParserGenerator.kt:684 */
   70    111   
    }
         112  +
    /* JsonParserGenerator.kt:250 */
   71    113   
    if tokens.next().is_some() {
         114  +
        /* JsonParserGenerator.kt:251 */
   72    115   
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   73    116   
            "found more JSON tokens after completing parsing",
   74    117   
        ));
         118  +
        /* JsonParserGenerator.kt:250 */
   75    119   
    }
         120  +
    /* JsonParserGenerator.kt:163 */
   76    121   
    Ok(builder)
         122  +
    /* JsonParserGenerator.kt:148 */
   77    123   
}

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/protocol_serde/shape_null_operation_input.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_null_operation_input_input(
    3      4   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4      5   
    input: &crate::operation::null_operation::NullOperationInput,
    5      6   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
           7  +
    /* JsonSerializerGenerator.kt:382 */
    6      8   
    if let Some(var_1) = &input.string {
           9  +
        /* JsonSerializerGenerator.kt:423 */
    7     10   
        object.key("string").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-client-test/json_rpc11/rust-client-codegen/src/protocol_serde/shape_operation_with_optional_input_output.rs

@@ -1,1 +86,132 @@
    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  +
/* ProtocolParserGenerator.kt:99 */
    3      5   
pub fn de_operation_with_optional_input_output_http_error(
    4      6   
    _response_status: u16,
    5      7   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6      8   
    _response_body: &[u8],
    7      9   
) -> std::result::Result<
    8     10   
    crate::operation::operation_with_optional_input_output::OperationWithOptionalInputOutputOutput,
    9     11   
    crate::operation::operation_with_optional_input_output::OperationWithOptionalInputOutputError,
   10     12   
> {
          13  +
    /* RustType.kt:516 */
   11     14   
    #[allow(unused_mut)]
          15  +
    /* ProtocolParserGenerator.kt:106 */
   12     16   
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   13     17   
        .map_err(crate::operation::operation_with_optional_input_output::OperationWithOptionalInputOutputError::unhandled)?;
          18  +
    /* ProtocolParserGenerator.kt:120 */
   14     19   
    let generic = generic_builder.build();
          20  +
    /* ProtocolParserGenerator.kt:185 */
   15     21   
    Err(crate::operation::operation_with_optional_input_output::OperationWithOptionalInputOutputError::generic(generic))
          22  +
    /* ProtocolParserGenerator.kt:99 */
   16     23   
}
   17     24   
          25  +
/* RustType.kt:516 */
   18     26   
#[allow(clippy::unnecessary_wraps)]
          27  +
/* ProtocolParserGenerator.kt:71 */
   19     28   
pub fn de_operation_with_optional_input_output_http_response(
   20     29   
    _response_status: u16,
   21     30   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   22     31   
    _response_body: &[u8],
   23     32   
) -> std::result::Result<
   24     33   
    crate::operation::operation_with_optional_input_output::OperationWithOptionalInputOutputOutput,
   25     34   
    crate::operation::operation_with_optional_input_output::OperationWithOptionalInputOutputError,
   26     35   
> {
          36  +
    /* ProtocolParserGenerator.kt:77 */
   27     37   
    Ok({
          38  +
        /* RustType.kt:516 */
   28     39   
        #[allow(unused_mut)]
          40  +
        /* ProtocolParserGenerator.kt:240 */
   29     41   
        let mut output = crate::operation::operation_with_optional_input_output::builders::OperationWithOptionalInputOutputOutputBuilder::default();
          42  +
        /* ProtocolParserGenerator.kt:247 */
   30     43   
        output = crate::protocol_serde::shape_operation_with_optional_input_output::de_operation_with_optional_input_output(_response_body, output)
   31     44   
            .map_err(crate::operation::operation_with_optional_input_output::OperationWithOptionalInputOutputError::unhandled)?;
          45  +
        /* ClientBuilderInstantiator.kt:56 */
   32     46   
        output.build()
          47  +
        /* ProtocolParserGenerator.kt:77 */
   33     48   
    })
          49  +
    /* ProtocolParserGenerator.kt:71 */
   34     50   
}
   35     51   
          52  +
/* JsonSerializerGenerator.kt:287 */
   36     53   
pub fn ser_operation_with_optional_input_output_input(
   37     54   
    input: &crate::operation::operation_with_optional_input_output::OperationWithOptionalInputOutputInput,
   38     55   
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
          56  +
    /* JsonSerializerGenerator.kt:291 */
   39     57   
    let mut out = String::new();
          58  +
    /* JsonSerializerGenerator.kt:292 */
   40     59   
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
          60  +
    /* JsonSerializerGenerator.kt:375 */
   41     61   
    crate::protocol_serde::shape_operation_with_optional_input_output_input::ser_operation_with_optional_input_output_input_input(
   42     62   
        &mut object,
   43     63   
        input,
   44     64   
    )?;
          65  +
    /* JsonSerializerGenerator.kt:295 */
   45     66   
    object.finish();
          67  +
    /* JsonSerializerGenerator.kt:296 */
   46     68   
    Ok(::aws_smithy_types::body::SdkBody::from(out))
          69  +
    /* JsonSerializerGenerator.kt:287 */
   47     70   
}
   48     71   
          72  +
/* JsonParserGenerator.kt:148 */
   49     73   
pub(crate) fn de_operation_with_optional_input_output(
   50     74   
    value: &[u8],
   51     75   
    mut builder: crate::operation::operation_with_optional_input_output::builders::OperationWithOptionalInputOutputOutputBuilder,
   52     76   
) -> ::std::result::Result<
   53     77   
    crate::operation::operation_with_optional_input_output::builders::OperationWithOptionalInputOutputOutputBuilder,
   54     78   
    ::aws_smithy_json::deserialize::error::DeserializeError,
   55     79   
> {
          80  +
    /* JsonParserGenerator.kt:153 */
   56     81   
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable();
   57     82   
    let tokens = &mut tokens_owned;
   58     83   
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
          84  +
    /* JsonParserGenerator.kt:684 */
   59     85   
    loop {
          86  +
        /* JsonParserGenerator.kt:685 */
   60     87   
        match tokens.next().transpose()? {
   61         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   62         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   63         -
                "Value" => {
   64         -
                    builder = builder.set_value(
   65         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   66         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   67         -
                            .transpose()?,
   68         -
                    );
          88  +
            /* JsonParserGenerator.kt:686 */ Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
          89  +
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
          90  +
                /* JsonParserGenerator.kt:260 */
          91  +
                match key.to_unescaped()?.as_ref() {
          92  +
                    /* JsonParserGenerator.kt:262 */
          93  +
                    "Value" => {
          94  +
                        /* JsonParserGenerator.kt:265 */
          95  +
                        builder = builder.set_value(
          96  +
                            /* JsonParserGenerator.kt:354 */
          97  +
                            ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
          98  +
                                .map(|s|
          99  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
         100  +
                                    /* JsonParserGenerator.kt:348 */u.into_owned()
         101  +
                                /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
         102  +
                                .transpose()?, /* JsonParserGenerator.kt:265 */
         103  +
                        );
         104  +
                        /* JsonParserGenerator.kt:262 */
         105  +
                    }
         106  +
                    /* JsonParserGenerator.kt:290 */
         107  +
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
   69    108   
                }
   70         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   71         -
            },
         109  +
                /* JsonParserGenerator.kt:686 */
         110  +
            }
         111  +
            /* JsonParserGenerator.kt:695 */
   72    112   
            other => {
   73    113   
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   74    114   
                    "expected object key or end object, found: {:?}",
   75    115   
                    other
   76    116   
                )))
   77         -
            }
         117  +
            } /* JsonParserGenerator.kt:685 */
   78    118   
        }
         119  +
        /* JsonParserGenerator.kt:684 */
   79    120   
    }
         121  +
    /* JsonParserGenerator.kt:250 */
   80    122   
    if tokens.next().is_some() {
         123  +
        /* JsonParserGenerator.kt:251 */
   81    124   
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   82    125   
            "found more JSON tokens after completing parsing",
   83    126   
        ));
         127  +
        /* JsonParserGenerator.kt:250 */
   84    128   
    }
         129  +
    /* JsonParserGenerator.kt:163 */
   85    130   
    Ok(builder)
         131  +
    /* JsonParserGenerator.kt:148 */
   86    132   
}

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/protocol_serde/shape_operation_with_optional_input_output_input.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_operation_with_optional_input_output_input_input(
    3      4   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4      5   
    input: &crate::operation::operation_with_optional_input_output::OperationWithOptionalInputOutputInput,
    5      6   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
           7  +
    /* JsonSerializerGenerator.kt:382 */
    6      8   
    if let Some(var_1) = &input.value {
           9  +
        /* JsonSerializerGenerator.kt:423 */
    7     10   
        object.key("Value").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-client-test/json_rpc11/rust-client-codegen/src/protocol_serde/shape_put_and_get_inline_documents.rs

@@ -1,1 +81,126 @@
    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  +
/* ProtocolParserGenerator.kt:99 */
    3      5   
pub fn de_put_and_get_inline_documents_http_error(
    4      6   
    _response_status: u16,
    5      7   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6      8   
    _response_body: &[u8],
    7      9   
) -> std::result::Result<
    8     10   
    crate::operation::put_and_get_inline_documents::PutAndGetInlineDocumentsOutput,
    9     11   
    crate::operation::put_and_get_inline_documents::PutAndGetInlineDocumentsError,
   10     12   
> {
          13  +
    /* RustType.kt:516 */
   11     14   
    #[allow(unused_mut)]
          15  +
    /* ProtocolParserGenerator.kt:106 */
   12     16   
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   13     17   
        .map_err(crate::operation::put_and_get_inline_documents::PutAndGetInlineDocumentsError::unhandled)?;
          18  +
    /* ProtocolParserGenerator.kt:120 */
   14     19   
    let generic = generic_builder.build();
          20  +
    /* ProtocolParserGenerator.kt:185 */
   15     21   
    Err(crate::operation::put_and_get_inline_documents::PutAndGetInlineDocumentsError::generic(
   16     22   
        generic,
   17     23   
    ))
          24  +
    /* ProtocolParserGenerator.kt:99 */
   18     25   
}
   19     26   
          27  +
/* RustType.kt:516 */
   20     28   
#[allow(clippy::unnecessary_wraps)]
          29  +
/* ProtocolParserGenerator.kt:71 */
   21     30   
pub fn de_put_and_get_inline_documents_http_response(
   22     31   
    _response_status: u16,
   23     32   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   24     33   
    _response_body: &[u8],
   25     34   
) -> std::result::Result<
   26     35   
    crate::operation::put_and_get_inline_documents::PutAndGetInlineDocumentsOutput,
   27     36   
    crate::operation::put_and_get_inline_documents::PutAndGetInlineDocumentsError,
   28     37   
> {
          38  +
    /* ProtocolParserGenerator.kt:77 */
   29     39   
    Ok({
          40  +
        /* RustType.kt:516 */
   30     41   
        #[allow(unused_mut)]
          42  +
        /* ProtocolParserGenerator.kt:240 */
   31     43   
        let mut output = crate::operation::put_and_get_inline_documents::builders::PutAndGetInlineDocumentsOutputBuilder::default();
          44  +
        /* ProtocolParserGenerator.kt:247 */
   32     45   
        output = crate::protocol_serde::shape_put_and_get_inline_documents::de_put_and_get_inline_documents(_response_body, output)
   33     46   
            .map_err(crate::operation::put_and_get_inline_documents::PutAndGetInlineDocumentsError::unhandled)?;
          47  +
        /* ClientBuilderInstantiator.kt:56 */
   34     48   
        output.build()
          49  +
        /* ProtocolParserGenerator.kt:77 */
   35     50   
    })
          51  +
    /* ProtocolParserGenerator.kt:71 */
   36     52   
}
   37     53   
          54  +
/* JsonSerializerGenerator.kt:287 */
   38     55   
pub fn ser_put_and_get_inline_documents_input(
   39     56   
    input: &crate::operation::put_and_get_inline_documents::PutAndGetInlineDocumentsInput,
   40     57   
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
          58  +
    /* JsonSerializerGenerator.kt:291 */
   41     59   
    let mut out = String::new();
          60  +
    /* JsonSerializerGenerator.kt:292 */
   42     61   
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
          62  +
    /* JsonSerializerGenerator.kt:375 */
   43     63   
    crate::protocol_serde::shape_put_and_get_inline_documents_input::ser_put_and_get_inline_documents_input_input(&mut object, input)?;
          64  +
    /* JsonSerializerGenerator.kt:295 */
   44     65   
    object.finish();
          66  +
    /* JsonSerializerGenerator.kt:296 */
   45     67   
    Ok(::aws_smithy_types::body::SdkBody::from(out))
          68  +
    /* JsonSerializerGenerator.kt:287 */
   46     69   
}
   47     70   
          71  +
/* JsonParserGenerator.kt:148 */
   48     72   
pub(crate) fn de_put_and_get_inline_documents(
   49     73   
    value: &[u8],
   50     74   
    mut builder: crate::operation::put_and_get_inline_documents::builders::PutAndGetInlineDocumentsOutputBuilder,
   51     75   
) -> ::std::result::Result<
   52     76   
    crate::operation::put_and_get_inline_documents::builders::PutAndGetInlineDocumentsOutputBuilder,
   53     77   
    ::aws_smithy_json::deserialize::error::DeserializeError,
   54     78   
> {
          79  +
    /* JsonParserGenerator.kt:153 */
   55     80   
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable();
   56     81   
    let tokens = &mut tokens_owned;
   57     82   
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
          83  +
    /* JsonParserGenerator.kt:684 */
   58     84   
    loop {
          85  +
        /* JsonParserGenerator.kt:685 */
   59     86   
        match tokens.next().transpose()? {
   60         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   61         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   62         -
                "inlineDocument" => {
   63         -
                    builder = builder.set_inline_document(Some(::aws_smithy_json::deserialize::token::expect_document(tokens)?));
          87  +
            /* JsonParserGenerator.kt:686 */ Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
          88  +
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
          89  +
                /* JsonParserGenerator.kt:260 */
          90  +
                match key.to_unescaped()?.as_ref() {
          91  +
                    /* JsonParserGenerator.kt:262 */
          92  +
                    "inlineDocument" => {
          93  +
                        /* JsonParserGenerator.kt:265 */
          94  +
                        builder = builder.set_inline_document(
          95  +
                            /* JsonParserGenerator.kt:319 */
          96  +
                            Some(::aws_smithy_json::deserialize::token::expect_document(tokens)?), /* JsonParserGenerator.kt:265 */
          97  +
                        );
          98  +
                        /* JsonParserGenerator.kt:262 */
          99  +
                    }
         100  +
                    /* JsonParserGenerator.kt:290 */
         101  +
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
   64    102   
                }
   65         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   66         -
            },
         103  +
                /* JsonParserGenerator.kt:686 */
         104  +
            }
         105  +
            /* JsonParserGenerator.kt:695 */
   67    106   
            other => {
   68    107   
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   69    108   
                    "expected object key or end object, found: {:?}",
   70    109   
                    other
   71    110   
                )))
   72         -
            }
         111  +
            } /* JsonParserGenerator.kt:685 */
   73    112   
        }
         113  +
        /* JsonParserGenerator.kt:684 */
   74    114   
    }
         115  +
    /* JsonParserGenerator.kt:250 */
   75    116   
    if tokens.next().is_some() {
         117  +
        /* JsonParserGenerator.kt:251 */
   76    118   
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   77    119   
            "found more JSON tokens after completing parsing",
   78    120   
        ));
         121  +
        /* JsonParserGenerator.kt:250 */
   79    122   
    }
         123  +
    /* JsonParserGenerator.kt:163 */
   80    124   
    Ok(builder)
         125  +
    /* JsonParserGenerator.kt:148 */
   81    126   
}

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/protocol_serde/shape_put_and_get_inline_documents_input.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_put_and_get_inline_documents_input_input(
    3      4   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4      5   
    input: &crate::operation::put_and_get_inline_documents::PutAndGetInlineDocumentsInput,
    5      6   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
           7  +
    /* JsonSerializerGenerator.kt:382 */
    6      8   
    if let Some(var_1) = &input.inline_document {
           9  +
        /* JsonSerializerGenerator.kt:474 */
    7     10   
        object.key("inlineDocument").document(var_1);
          11  +
        /* JsonSerializerGenerator.kt:382 */
    8     12   
    }
          13  +
    /* JsonSerializerGenerator.kt:372 */
    9     14   
    Ok(())
          15  +
    /* JsonSerializerGenerator.kt:358 */
   10     16   
}

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/protocol_serde/shape_put_with_content_encoding.rs

@@ -1,1 +42,64 @@
    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  +
/* ProtocolParserGenerator.kt:99 */
    3      5   
pub fn de_put_with_content_encoding_http_error(
    4      6   
    _response_status: u16,
    5      7   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6      8   
    _response_body: &[u8],
    7      9   
) -> std::result::Result<
    8     10   
    crate::operation::put_with_content_encoding::PutWithContentEncodingOutput,
    9     11   
    crate::operation::put_with_content_encoding::PutWithContentEncodingError,
   10     12   
> {
          13  +
    /* RustType.kt:516 */
   11     14   
    #[allow(unused_mut)]
          15  +
    /* ProtocolParserGenerator.kt:106 */
   12     16   
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   13     17   
        .map_err(crate::operation::put_with_content_encoding::PutWithContentEncodingError::unhandled)?;
          18  +
    /* ProtocolParserGenerator.kt:120 */
   14     19   
    let generic = generic_builder.build();
          20  +
    /* ProtocolParserGenerator.kt:185 */
   15     21   
    Err(crate::operation::put_with_content_encoding::PutWithContentEncodingError::generic(generic))
          22  +
    /* ProtocolParserGenerator.kt:99 */
   16     23   
}
   17     24   
          25  +
/* RustType.kt:516 */
   18     26   
#[allow(clippy::unnecessary_wraps)]
          27  +
/* ProtocolParserGenerator.kt:71 */
   19     28   
pub fn de_put_with_content_encoding_http_response(
   20     29   
    _response_status: u16,
   21     30   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   22     31   
    _response_body: &[u8],
   23     32   
) -> std::result::Result<
   24     33   
    crate::operation::put_with_content_encoding::PutWithContentEncodingOutput,
   25     34   
    crate::operation::put_with_content_encoding::PutWithContentEncodingError,
   26     35   
> {
          36  +
    /* ProtocolParserGenerator.kt:77 */
   27     37   
    Ok({
          38  +
        /* RustType.kt:516 */
   28     39   
        #[allow(unused_mut)]
          40  +
        /* ProtocolParserGenerator.kt:240 */
   29     41   
        let mut output = crate::operation::put_with_content_encoding::builders::PutWithContentEncodingOutputBuilder::default();
          42  +
        /* ClientBuilderInstantiator.kt:56 */
   30     43   
        output.build()
          44  +
        /* ProtocolParserGenerator.kt:77 */
   31     45   
    })
          46  +
    /* ProtocolParserGenerator.kt:71 */
   32     47   
}
   33     48   
          49  +
/* JsonSerializerGenerator.kt:287 */
   34     50   
pub fn ser_put_with_content_encoding_input(
   35     51   
    input: &crate::operation::put_with_content_encoding::PutWithContentEncodingInput,
   36     52   
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
          53  +
    /* JsonSerializerGenerator.kt:291 */
   37     54   
    let mut out = String::new();
          55  +
    /* JsonSerializerGenerator.kt:292 */
   38     56   
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
          57  +
    /* JsonSerializerGenerator.kt:375 */
   39     58   
    crate::protocol_serde::shape_put_with_content_encoding_input::ser_put_with_content_encoding_input_input(&mut object, input)?;
          59  +
    /* JsonSerializerGenerator.kt:295 */
   40     60   
    object.finish();
          61  +
    /* JsonSerializerGenerator.kt:296 */
   41     62   
    Ok(::aws_smithy_types::body::SdkBody::from(out))
          63  +
    /* JsonSerializerGenerator.kt:287 */
   42     64   
}

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/protocol_serde/shape_put_with_content_encoding_input.rs

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

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/protocol_serde/shape_simple_scalar_properties.rs

@@ -1,1 +84,131 @@
    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  +
/* ProtocolParserGenerator.kt:99 */
    3      5   
pub fn de_simple_scalar_properties_http_error(
    4      6   
    _response_status: u16,
    5      7   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6      8   
    _response_body: &[u8],
    7      9   
) -> std::result::Result<
    8     10   
    crate::operation::simple_scalar_properties::SimpleScalarPropertiesOutput,
    9     11   
    crate::operation::simple_scalar_properties::SimpleScalarPropertiesError,
   10     12   
> {
          13  +
    /* RustType.kt:516 */
   11     14   
    #[allow(unused_mut)]
          15  +
    /* ProtocolParserGenerator.kt:106 */
   12     16   
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   13     17   
        .map_err(crate::operation::simple_scalar_properties::SimpleScalarPropertiesError::unhandled)?;
          18  +
    /* ProtocolParserGenerator.kt:120 */
   14     19   
    let generic = generic_builder.build();
          20  +
    /* ProtocolParserGenerator.kt:185 */
   15     21   
    Err(crate::operation::simple_scalar_properties::SimpleScalarPropertiesError::generic(generic))
          22  +
    /* ProtocolParserGenerator.kt:99 */
   16     23   
}
   17     24   
          25  +
/* RustType.kt:516 */
   18     26   
#[allow(clippy::unnecessary_wraps)]
          27  +
/* ProtocolParserGenerator.kt:71 */
   19     28   
pub fn de_simple_scalar_properties_http_response(
   20     29   
    _response_status: u16,
   21     30   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   22     31   
    _response_body: &[u8],
   23     32   
) -> std::result::Result<
   24     33   
    crate::operation::simple_scalar_properties::SimpleScalarPropertiesOutput,
   25     34   
    crate::operation::simple_scalar_properties::SimpleScalarPropertiesError,
   26     35   
> {
          36  +
    /* ProtocolParserGenerator.kt:77 */
   27     37   
    Ok({
          38  +
        /* RustType.kt:516 */
   28     39   
        #[allow(unused_mut)]
          40  +
        /* ProtocolParserGenerator.kt:240 */
   29     41   
        let mut output = crate::operation::simple_scalar_properties::builders::SimpleScalarPropertiesOutputBuilder::default();
          42  +
        /* ProtocolParserGenerator.kt:247 */
   30     43   
        output = crate::protocol_serde::shape_simple_scalar_properties::de_simple_scalar_properties(_response_body, output)
   31     44   
            .map_err(crate::operation::simple_scalar_properties::SimpleScalarPropertiesError::unhandled)?;
          45  +
        /* ClientBuilderInstantiator.kt:56 */
   32     46   
        output.build()
          47  +
        /* ProtocolParserGenerator.kt:77 */
   33     48   
    })
          49  +
    /* ProtocolParserGenerator.kt:71 */
   34     50   
}
   35     51   
          52  +
/* JsonSerializerGenerator.kt:287 */
   36     53   
pub fn ser_simple_scalar_properties_input(
   37     54   
    input: &crate::operation::simple_scalar_properties::SimpleScalarPropertiesInput,
   38     55   
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
          56  +
    /* JsonSerializerGenerator.kt:291 */
   39     57   
    let mut out = String::new();
          58  +
    /* JsonSerializerGenerator.kt:292 */
   40     59   
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
          60  +
    /* JsonSerializerGenerator.kt:375 */
   41     61   
    crate::protocol_serde::shape_simple_scalar_properties_input::ser_simple_scalar_properties_input_input(&mut object, input)?;
          62  +
    /* JsonSerializerGenerator.kt:295 */
   42     63   
    object.finish();
          64  +
    /* JsonSerializerGenerator.kt:296 */
   43     65   
    Ok(::aws_smithy_types::body::SdkBody::from(out))
          66  +
    /* JsonSerializerGenerator.kt:287 */
   44     67   
}
   45     68   
          69  +
/* JsonParserGenerator.kt:148 */
   46     70   
pub(crate) fn de_simple_scalar_properties(
   47     71   
    value: &[u8],
   48     72   
    mut builder: crate::operation::simple_scalar_properties::builders::SimpleScalarPropertiesOutputBuilder,
   49     73   
) -> ::std::result::Result<
   50     74   
    crate::operation::simple_scalar_properties::builders::SimpleScalarPropertiesOutputBuilder,
   51     75   
    ::aws_smithy_json::deserialize::error::DeserializeError,
   52     76   
> {
          77  +
    /* JsonParserGenerator.kt:153 */
   53     78   
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable();
   54     79   
    let tokens = &mut tokens_owned;
   55     80   
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
          81  +
    /* JsonParserGenerator.kt:684 */
   56     82   
    loop {
          83  +
        /* JsonParserGenerator.kt:685 */
   57     84   
        match tokens.next().transpose()? {
   58         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   59         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   60         -
                "floatValue" => {
   61         -
                    builder = builder
   62         -
                        .set_float_value(::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?.map(|v| v.to_f32_lossy()));
          85  +
            /* JsonParserGenerator.kt:686 */ Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
          86  +
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
          87  +
                /* JsonParserGenerator.kt:260 */
          88  +
                match key.to_unescaped()?.as_ref() {
          89  +
                    /* JsonParserGenerator.kt:262 */
          90  +
                    "floatValue" => {
          91  +
                        /* JsonParserGenerator.kt:265 */
          92  +
                        builder = builder.set_float_value(
          93  +
                            /* JsonParserGenerator.kt:361 */::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?.map(|v| v.to_f32_lossy())
          94  +
                        /* JsonParserGenerator.kt:265 */);
          95  +
                        /* JsonParserGenerator.kt:262 */
          96  +
                    }
          97  +
                    /* JsonParserGenerator.kt:262 */
          98  +
                    "doubleValue" => {
          99  +
                        /* JsonParserGenerator.kt:265 */
         100  +
                        builder = builder.set_double_value(
         101  +
                            /* JsonParserGenerator.kt:363 */::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?.map(|v| v.to_f64_lossy())
         102  +
                        /* JsonParserGenerator.kt:265 */);
         103  +
                        /* JsonParserGenerator.kt:262 */
         104  +
                    }
         105  +
                    /* JsonParserGenerator.kt:290 */
         106  +
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
   63    107   
                }
   64         -
                "doubleValue" => {
   65         -
                    builder = builder
   66         -
                        .set_double_value(::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?.map(|v| v.to_f64_lossy()));
   67         -
                }
   68         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   69         -
            },
         108  +
                /* JsonParserGenerator.kt:686 */
         109  +
            }
         110  +
            /* JsonParserGenerator.kt:695 */
   70    111   
            other => {
   71    112   
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   72    113   
                    "expected object key or end object, found: {:?}",
   73    114   
                    other
   74    115   
                )))
   75         -
            }
         116  +
            } /* JsonParserGenerator.kt:685 */
   76    117   
        }
         118  +
        /* JsonParserGenerator.kt:684 */
   77    119   
    }
         120  +
    /* JsonParserGenerator.kt:250 */
   78    121   
    if tokens.next().is_some() {
         122  +
        /* JsonParserGenerator.kt:251 */
   79    123   
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   80    124   
            "found more JSON tokens after completing parsing",
   81    125   
        ));
         126  +
        /* JsonParserGenerator.kt:250 */
   82    127   
    }
         128  +
    /* JsonParserGenerator.kt:163 */
   83    129   
    Ok(builder)
         130  +
    /* JsonParserGenerator.kt:148 */
   84    131   
}

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/protocol_serde/shape_simple_scalar_properties_input.rs

@@ -1,1 +19,28 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:358 */
    2      3   
pub fn ser_simple_scalar_properties_input_input(
    3      4   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4      5   
    input: &crate::operation::simple_scalar_properties::SimpleScalarPropertiesInput,
    5      6   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
           7  +
    /* JsonSerializerGenerator.kt:382 */
    6      8   
    if let Some(var_1) = &input.float_value {
           9  +
        /* JsonSerializerGenerator.kt:432 */
    7     10   
        object.key("floatValue").number(
    8     11   
            #[allow(clippy::useless_conversion)]
    9     12   
            ::aws_smithy_types::Number::Float((*var_1).into()),
   10     13   
        );
          14  +
        /* JsonSerializerGenerator.kt:382 */
   11     15   
    }
          16  +
    /* JsonSerializerGenerator.kt:382 */
   12     17   
    if let Some(var_2) = &input.double_value {
          18  +
        /* JsonSerializerGenerator.kt:432 */
   13     19   
        object.key("doubleValue").number(
   14     20   
            #[allow(clippy::useless_conversion)]
   15     21   
            ::aws_smithy_types::Number::Float((*var_2).into()),
   16     22   
        );
          23  +
        /* JsonSerializerGenerator.kt:382 */
   17     24   
    }
          25  +
    /* JsonSerializerGenerator.kt:372 */
   18     26   
    Ok(())
          27  +
    /* JsonSerializerGenerator.kt:358 */
   19     28   
}

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/protocol_serde/shape_simple_struct.rs

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

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/protocol_serde/shape_sparse_nulls_operation.rs

@@ -1,1 +82,133 @@
    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  +
/* ProtocolParserGenerator.kt:99 */
    3      5   
pub fn de_sparse_nulls_operation_http_error(
    4      6   
    _response_status: u16,
    5      7   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6      8   
    _response_body: &[u8],
    7      9   
) -> std::result::Result<
    8     10   
    crate::operation::sparse_nulls_operation::SparseNullsOperationOutput,
    9     11   
    crate::operation::sparse_nulls_operation::SparseNullsOperationError,
   10     12   
> {
          13  +
    /* RustType.kt:516 */
   11     14   
    #[allow(unused_mut)]
          15  +
    /* ProtocolParserGenerator.kt:106 */
   12     16   
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   13     17   
        .map_err(crate::operation::sparse_nulls_operation::SparseNullsOperationError::unhandled)?;
          18  +
    /* ProtocolParserGenerator.kt:120 */
   14     19   
    let generic = generic_builder.build();
          20  +
    /* ProtocolParserGenerator.kt:185 */
   15     21   
    Err(crate::operation::sparse_nulls_operation::SparseNullsOperationError::generic(generic))
          22  +
    /* ProtocolParserGenerator.kt:99 */
   16     23   
}
   17     24   
          25  +
/* RustType.kt:516 */
   18     26   
#[allow(clippy::unnecessary_wraps)]
          27  +
/* ProtocolParserGenerator.kt:71 */
   19     28   
pub fn de_sparse_nulls_operation_http_response(
   20     29   
    _response_status: u16,
   21     30   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   22     31   
    _response_body: &[u8],
   23     32   
) -> std::result::Result<
   24     33   
    crate::operation::sparse_nulls_operation::SparseNullsOperationOutput,
   25     34   
    crate::operation::sparse_nulls_operation::SparseNullsOperationError,
   26     35   
> {
          36  +
    /* ProtocolParserGenerator.kt:77 */
   27     37   
    Ok({
          38  +
        /* RustType.kt:516 */
   28     39   
        #[allow(unused_mut)]
          40  +
        /* ProtocolParserGenerator.kt:240 */
   29     41   
        let mut output = crate::operation::sparse_nulls_operation::builders::SparseNullsOperationOutputBuilder::default();
          42  +
        /* ProtocolParserGenerator.kt:247 */
   30     43   
        output = crate::protocol_serde::shape_sparse_nulls_operation::de_sparse_nulls_operation(_response_body, output)
   31     44   
            .map_err(crate::operation::sparse_nulls_operation::SparseNullsOperationError::unhandled)?;
          45  +
        /* ClientBuilderInstantiator.kt:56 */
   32     46   
        output.build()
          47  +
        /* ProtocolParserGenerator.kt:77 */
   33     48   
    })
          49  +
    /* ProtocolParserGenerator.kt:71 */
   34     50   
}
   35     51   
          52  +
/* JsonSerializerGenerator.kt:287 */
   36     53   
pub fn ser_sparse_nulls_operation_input(
   37     54   
    input: &crate::operation::sparse_nulls_operation::SparseNullsOperationInput,
   38     55   
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
          56  +
    /* JsonSerializerGenerator.kt:291 */
   39     57   
    let mut out = String::new();
          58  +
    /* JsonSerializerGenerator.kt:292 */
   40     59   
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
          60  +
    /* JsonSerializerGenerator.kt:375 */
   41     61   
    crate::protocol_serde::shape_sparse_nulls_operation_input::ser_sparse_nulls_operation_input_input(&mut object, input)?;
          62  +
    /* JsonSerializerGenerator.kt:295 */
   42     63   
    object.finish();
          64  +
    /* JsonSerializerGenerator.kt:296 */
   43     65   
    Ok(::aws_smithy_types::body::SdkBody::from(out))
          66  +
    /* JsonSerializerGenerator.kt:287 */
   44     67   
}
   45     68   
          69  +
/* JsonParserGenerator.kt:148 */
   46     70   
pub(crate) fn de_sparse_nulls_operation(
   47     71   
    value: &[u8],
   48     72   
    mut builder: crate::operation::sparse_nulls_operation::builders::SparseNullsOperationOutputBuilder,
   49     73   
) -> ::std::result::Result<
   50     74   
    crate::operation::sparse_nulls_operation::builders::SparseNullsOperationOutputBuilder,
   51     75   
    ::aws_smithy_json::deserialize::error::DeserializeError,
   52     76   
> {
          77  +
    /* JsonParserGenerator.kt:153 */
   53     78   
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable();
   54     79   
    let tokens = &mut tokens_owned;
   55     80   
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
          81  +
    /* JsonParserGenerator.kt:684 */
   56     82   
    loop {
          83  +
        /* JsonParserGenerator.kt:685 */
   57     84   
        match tokens.next().transpose()? {
   58         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   59         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   60         -
                "sparseStringList" => {
   61         -
                    builder = builder.set_sparse_string_list(crate::protocol_serde::shape_sparse_string_list::de_sparse_string_list(tokens)?);
          85  +
            /* JsonParserGenerator.kt:686 */ Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
          86  +
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
          87  +
                /* JsonParserGenerator.kt:260 */
          88  +
                match key.to_unescaped()?.as_ref() {
          89  +
                    /* JsonParserGenerator.kt:262 */
          90  +
                    "sparseStringList" => {
          91  +
                        /* JsonParserGenerator.kt:265 */
          92  +
                        builder = builder.set_sparse_string_list(
          93  +
                            /* JsonParserGenerator.kt:451 */
          94  +
                            crate::protocol_serde::shape_sparse_string_list::de_sparse_string_list(tokens)?, /* JsonParserGenerator.kt:265 */
          95  +
                        );
          96  +
                        /* JsonParserGenerator.kt:262 */
          97  +
                    }
          98  +
                    /* JsonParserGenerator.kt:262 */
          99  +
                    "sparseStringMap" => {
         100  +
                        /* JsonParserGenerator.kt:265 */
         101  +
                        builder = builder.set_sparse_string_map(
         102  +
                            /* JsonParserGenerator.kt:509 */
         103  +
                            crate::protocol_serde::shape_sparse_string_map::de_sparse_string_map(tokens)?, /* JsonParserGenerator.kt:265 */
         104  +
                        );
         105  +
                        /* JsonParserGenerator.kt:262 */
         106  +
                    }
         107  +
                    /* JsonParserGenerator.kt:290 */
         108  +
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
   62    109   
                }
   63         -
                "sparseStringMap" => {
   64         -
                    builder = builder.set_sparse_string_map(crate::protocol_serde::shape_sparse_string_map::de_sparse_string_map(tokens)?);
   65         -
                }
   66         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   67         -
            },
         110  +
                /* JsonParserGenerator.kt:686 */
         111  +
            }
         112  +
            /* JsonParserGenerator.kt:695 */
   68    113   
            other => {
   69    114   
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   70    115   
                    "expected object key or end object, found: {:?}",
   71    116   
                    other
   72    117   
                )))
   73         -
            }
         118  +
            } /* JsonParserGenerator.kt:685 */
   74    119   
        }
         120  +
        /* JsonParserGenerator.kt:684 */
   75    121   
    }
         122  +
    /* JsonParserGenerator.kt:250 */
   76    123   
    if tokens.next().is_some() {
         124  +
        /* JsonParserGenerator.kt:251 */
   77    125   
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   78    126   
            "found more JSON tokens after completing parsing",
   79    127   
        ));
         128  +
        /* JsonParserGenerator.kt:250 */
   80    129   
    }
         130  +
    /* JsonParserGenerator.kt:163 */
   81    131   
    Ok(builder)
         132  +
    /* JsonParserGenerator.kt:148 */
   82    133   
}

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/protocol_serde/shape_sparse_nulls_operation_input.rs

@@ -1,1 +30,60 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:358 */
    2      3   
pub fn ser_sparse_nulls_operation_input_input(
    3      4   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4      5   
    input: &crate::operation::sparse_nulls_operation::SparseNullsOperationInput,
    5      6   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
           7  +
    /* JsonSerializerGenerator.kt:382 */
    6      8   
    if let Some(var_1) = &input.sparse_string_list {
           9  +
        /* JsonSerializerGenerator.kt:484 */
    7     10   
        let mut array_2 = object.key("sparseStringList").start_array();
          11  +
        /* JsonSerializerGenerator.kt:524 */
    8     12   
        for item_3 in var_1 {
          13  +
            /* JsonSerializerGenerator.kt:382 */
    9     14   
            if let Some(var_4) = item_3 {
          15  +
                /* JsonSerializerGenerator.kt:423 */
   10     16   
                array_2.value().string(var_4.as_str());
   11         -
            } else {
          17  +
            /* JsonSerializerGenerator.kt:382 */
          18  +
            }
          19  +
            /* JsonSerializerGenerator.kt:395 */
          20  +
            else {
          21  +
                /* JsonSerializerGenerator.kt:396 */
   12     22   
                array_2.value().null();
          23  +
                /* JsonSerializerGenerator.kt:395 */
   13     24   
            }
          25  +
            /* JsonSerializerGenerator.kt:524 */
   14     26   
        }
          27  +
        /* JsonSerializerGenerator.kt:486 */
   15     28   
        array_2.finish();
          29  +
        /* JsonSerializerGenerator.kt:382 */
   16     30   
    }
          31  +
    /* JsonSerializerGenerator.kt:382 */
   17     32   
    if let Some(var_5) = &input.sparse_string_map {
          33  +
        /* JsonSerializerGenerator.kt:495 */
   18     34   
        #[allow(unused_mut)]
          35  +
        /* JsonSerializerGenerator.kt:496 */
   19     36   
        let mut object_6 = object.key("sparseStringMap").start_object();
          37  +
        /* JsonSerializerGenerator.kt:537 */
   20     38   
        for (key_7, value_8) in var_5 {
          39  +
            /* JsonSerializerGenerator.kt:382 */
   21     40   
            if let Some(var_9) = value_8 {
          41  +
                /* JsonSerializerGenerator.kt:423 */
   22     42   
                object_6.key(key_7.as_str()).string(var_9.as_str());
   23         -
            } else {
          43  +
            /* JsonSerializerGenerator.kt:382 */
          44  +
            }
          45  +
            /* JsonSerializerGenerator.kt:395 */
          46  +
            else {
          47  +
                /* JsonSerializerGenerator.kt:396 */
   24     48   
                object_6.key(key_7.as_str()).null();
          49  +
                /* JsonSerializerGenerator.kt:395 */
   25     50   
            }
          51  +
            /* JsonSerializerGenerator.kt:537 */
   26     52   
        }
          53  +
        /* JsonSerializerGenerator.kt:515 */
   27     54   
        object_6.finish();
          55  +
        /* JsonSerializerGenerator.kt:382 */
   28     56   
    }
          57  +
    /* JsonSerializerGenerator.kt:372 */
   29     58   
    Ok(())
          59  +
    /* JsonSerializerGenerator.kt:358 */
   30     60   
}

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/protocol_serde/shape_sparse_string_list.rs

@@ -1,1 +36,60 @@
    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_sparse_string_list<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<::std::vec::Vec<::std::option::Option<::std::string::String>>>,
    6      7   
    ::aws_smithy_json::deserialize::error::DeserializeError,
    7      8   
>
    8      9   
where
    9     10   
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
   10     11   
{
          12  +
    /* JsonParserGenerator.kt:712 */
   11     13   
    match tokens.next().transpose()? {
   12         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
          14  +
        /* JsonParserGenerator.kt:713 */ Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   13     15   
        Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => {
          16  +
            /* JsonParserGenerator.kt:407 */
   14     17   
            let mut items = Vec::new();
          18  +
            /* JsonParserGenerator.kt:408 */
   15     19   
            loop {
          20  +
                /* JsonParserGenerator.kt:409 */
   16     21   
                match tokens.peek() {
          22  +
                    /* JsonParserGenerator.kt:410 */
   17     23   
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
          24  +
                        /* JsonParserGenerator.kt:411 */
   18     25   
                        tokens.next().transpose().unwrap();
   19     26   
                        break;
          27  +
                        /* JsonParserGenerator.kt:410 */
   20     28   
                    }
          29  +
                    /* JsonParserGenerator.kt:413 */
   21     30   
                    _ => {
          31  +
                        /* JsonParserGenerator.kt:415 */
   22     32   
                        items.push(
          33  +
                            /* JsonParserGenerator.kt:354 */
   23     34   
                            ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   24         -
                                .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   25         -
                                .transpose()?,
          35  +
                                .map(|s|
          36  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          37  +
                                    /* JsonParserGenerator.kt:348 */u.into_owned()
          38  +
                                /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
          39  +
                                .transpose()?, /* JsonParserGenerator.kt:415 */
   26     40   
                        );
   27         -
                    }
          41  +
                        /* JsonParserGenerator.kt:413 */
          42  +
                    } /* JsonParserGenerator.kt:409 */
   28     43   
                }
          44  +
                /* JsonParserGenerator.kt:408 */
   29     45   
            }
          46  +
            /* JsonParserGenerator.kt:446 */
   30     47   
            Ok(Some(items))
          48  +
            /* JsonParserGenerator.kt:713 */
   31     49   
        }
   32         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   33         -
            "expected start array or null",
   34         -
        )),
          50  +
        /* JsonParserGenerator.kt:722 */
          51  +
        _ => {
          52  +
            /* JsonParserGenerator.kt:723 */
          53  +
            Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          54  +
                "expected start array or null",
          55  +
            ))
          56  +
            /* JsonParserGenerator.kt:722 */
          57  +
        } /* JsonParserGenerator.kt:712 */
   35     58   
    }
          59  +
    /* JsonParserGenerator.kt:398 */
   36     60   
}

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/protocol_serde/shape_sparse_string_map.rs

@@ -1,1 +39,66 @@
    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_sparse_string_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, ::std::option::Option<::std::string::String>>>,
    6      7   
    ::aws_smithy_json::deserialize::error::DeserializeError,
    7      8   
>
    8      9   
where
    9     10   
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
   10     11   
{
          12  +
    /* JsonParserGenerator.kt:712 */
   11     13   
    match tokens.next().transpose()? {
   12         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
          14  +
        /* JsonParserGenerator.kt:713 */ Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   13     15   
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
          16  +
            /* JsonParserGenerator.kt:469 */
   14     17   
            let mut map = ::std::collections::HashMap::new();
          18  +
            /* JsonParserGenerator.kt:684 */
   15     19   
            loop {
          20  +
                /* JsonParserGenerator.kt:685 */
   16     21   
                match tokens.next().transpose()? {
   17         -
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
          22  +
                    /* JsonParserGenerator.kt:686 */ Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   18     23   
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
   19         -
                        let key = key.to_unescaped().map(|u| u.into_owned())?;
   20         -
                        let value = ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   21         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   22         -
                            .transpose()?;
          24  +
                        /* JsonParserGenerator.kt:471 */
          25  +
                        let key =
          26  +
                            /* JsonParserGenerator.kt:339 */key.to_unescaped().map(|u|
          27  +
                                /* JsonParserGenerator.kt:348 */u.into_owned()
          28  +
                            /* JsonParserGenerator.kt:339 */)
          29  +
                        /* JsonParserGenerator.kt:471 */?;
          30  +
                        /* JsonParserGenerator.kt:474 */
          31  +
                        let value =
          32  +
                            /* JsonParserGenerator.kt:354 */::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?.map(|s|
          33  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          34  +
                                    /* JsonParserGenerator.kt:348 */u.into_owned()
          35  +
                                /* JsonParserGenerator.kt:339 */)
          36  +
                            /* JsonParserGenerator.kt:354 */).transpose()?
          37  +
                        /* JsonParserGenerator.kt:474 */;
          38  +
                        /* JsonParserGenerator.kt:478 */
   23     39   
                        map.insert(key, value);
          40  +
                        /* JsonParserGenerator.kt:686 */
   24     41   
                    }
          42  +
                    /* JsonParserGenerator.kt:695 */
   25     43   
                    other => {
   26     44   
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   27     45   
                            "expected object key or end object, found: {:?}",
   28     46   
                            other
   29     47   
                        )))
   30         -
                    }
          48  +
                    } /* JsonParserGenerator.kt:685 */
   31     49   
                }
          50  +
                /* JsonParserGenerator.kt:684 */
   32     51   
            }
          52  +
            /* JsonParserGenerator.kt:504 */
   33     53   
            Ok(Some(map))
          54  +
            /* JsonParserGenerator.kt:713 */
   34     55   
        }
   35         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   36         -
            "expected start object or null",
   37         -
        )),
          56  +
        /* JsonParserGenerator.kt:722 */
          57  +
        _ => {
          58  +
            /* JsonParserGenerator.kt:723 */
          59  +
            Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          60  +
                "expected start object or null",
          61  +
            ))
          62  +
            /* JsonParserGenerator.kt:722 */
          63  +
        } /* JsonParserGenerator.kt:712 */
   38     64   
    }
          65  +
    /* JsonParserGenerator.kt:460 */
   39     66   
}

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/protocol_serde/shape_string_list.rs

@@ -1,1 +34,59 @@
    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_string_list<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<Option<::std::vec::Vec<::std::string::String>>, ::aws_smithy_json::deserialize::error::DeserializeError>
    5      6   
where
    6      7   
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
    7      8   
{
           9  +
    /* JsonParserGenerator.kt:712 */
    8     10   
    match tokens.next().transpose()? {
    9         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
          11  +
        /* JsonParserGenerator.kt:713 */ Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   10     12   
        Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => {
          13  +
            /* JsonParserGenerator.kt:407 */
   11     14   
            let mut items = Vec::new();
          15  +
            /* JsonParserGenerator.kt:408 */
   12     16   
            loop {
          17  +
                /* JsonParserGenerator.kt:409 */
   13     18   
                match tokens.peek() {
          19  +
                    /* JsonParserGenerator.kt:410 */
   14     20   
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
          21  +
                        /* JsonParserGenerator.kt:411 */
   15     22   
                        tokens.next().transpose().unwrap();
   16     23   
                        break;
          24  +
                        /* JsonParserGenerator.kt:410 */
   17     25   
                    }
          26  +
                    /* JsonParserGenerator.kt:413 */
   18     27   
                    _ => {
   19         -
                        let value = ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   20         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   21         -
                            .transpose()?;
          28  +
                        /* JsonParserGenerator.kt:419 */
          29  +
                        let value =
          30  +
                            /* JsonParserGenerator.kt:354 */::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?.map(|s|
          31  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          32  +
                                    /* JsonParserGenerator.kt:348 */u.into_owned()
          33  +
                                /* JsonParserGenerator.kt:339 */)
          34  +
                            /* JsonParserGenerator.kt:354 */).transpose()?
          35  +
                        /* JsonParserGenerator.kt:419 */;
          36  +
                        /* JsonParserGenerator.kt:422 */
   22     37   
                        if let Some(value) = value {
   23     38   
                            items.push(value);
   24     39   
                        }
   25         -
                    }
          40  +
                        /* JsonParserGenerator.kt:413 */
          41  +
                    } /* JsonParserGenerator.kt:409 */
   26     42   
                }
          43  +
                /* JsonParserGenerator.kt:408 */
   27     44   
            }
          45  +
            /* JsonParserGenerator.kt:446 */
   28     46   
            Ok(Some(items))
          47  +
            /* JsonParserGenerator.kt:713 */
   29     48   
        }
   30         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   31         -
            "expected start array or null",
   32         -
        )),
          49  +
        /* JsonParserGenerator.kt:722 */
          50  +
        _ => {
          51  +
            /* JsonParserGenerator.kt:723 */
          52  +
            Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          53  +
                "expected start array or null",
          54  +
            ))
          55  +
            /* JsonParserGenerator.kt:722 */
          56  +
        } /* JsonParserGenerator.kt:712 */
   33     57   
    }
          58  +
    /* JsonParserGenerator.kt:398 */
   34     59   
}