Server Test

Server Test

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943

Files changed:

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

@@ -1,1 +62,97 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
    2      3   
pub fn ser_simple_scalar_properties_output_output_output(
    3      4   
    value: &crate::output::SimpleScalarPropertiesOutput,
    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_simple_scalar_properties_output::ser_simple_scalar_properties_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_simple_scalar_properties_output_output(
   13     19   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   14     20   
    input: &crate::output::SimpleScalarPropertiesOutput,
   15     21   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          22  +
    /* JsonSerializerGenerator.kt:382 */
   16     23   
    if let Some(var_1) = &input.byte_value {
          24  +
        /* JsonSerializerGenerator.kt:432 */
   17     25   
        object.key("byteValue").number(
   18     26   
            #[allow(clippy::useless_conversion)]
   19     27   
            ::aws_smithy_types::Number::NegInt((*var_1).into()),
   20     28   
        );
          29  +
        /* JsonSerializerGenerator.kt:382 */
   21     30   
    }
          31  +
    /* JsonSerializerGenerator.kt:382 */
   22     32   
    if let Some(var_2) = &input.double_value {
          33  +
        /* JsonSerializerGenerator.kt:432 */
   23     34   
        object.key("DoubleDribble").number(
   24     35   
            #[allow(clippy::useless_conversion)]
   25     36   
            ::aws_smithy_types::Number::Float((*var_2).into()),
   26     37   
        );
          38  +
        /* JsonSerializerGenerator.kt:382 */
   27     39   
    }
          40  +
    /* JsonSerializerGenerator.kt:382 */
   28     41   
    if let Some(var_3) = &input.false_boolean_value {
          42  +
        /* JsonSerializerGenerator.kt:424 */
   29     43   
        object.key("falseBooleanValue").boolean(*var_3);
          44  +
        /* JsonSerializerGenerator.kt:382 */
   30     45   
    }
          46  +
    /* JsonSerializerGenerator.kt:382 */
   31     47   
    if let Some(var_4) = &input.float_value {
          48  +
        /* JsonSerializerGenerator.kt:432 */
   32     49   
        object.key("floatValue").number(
   33     50   
            #[allow(clippy::useless_conversion)]
   34     51   
            ::aws_smithy_types::Number::Float((*var_4).into()),
   35     52   
        );
          53  +
        /* JsonSerializerGenerator.kt:382 */
   36     54   
    }
          55  +
    /* JsonSerializerGenerator.kt:382 */
   37     56   
    if let Some(var_5) = &input.integer_value {
          57  +
        /* JsonSerializerGenerator.kt:432 */
   38     58   
        object.key("integerValue").number(
   39     59   
            #[allow(clippy::useless_conversion)]
   40     60   
            ::aws_smithy_types::Number::NegInt((*var_5).into()),
   41     61   
        );
          62  +
        /* JsonSerializerGenerator.kt:382 */
   42     63   
    }
          64  +
    /* JsonSerializerGenerator.kt:382 */
   43     65   
    if let Some(var_6) = &input.long_value {
          66  +
        /* JsonSerializerGenerator.kt:432 */
   44     67   
        object.key("longValue").number(
   45     68   
            #[allow(clippy::useless_conversion)]
   46     69   
            ::aws_smithy_types::Number::NegInt((*var_6).into()),
   47     70   
        );
          71  +
        /* JsonSerializerGenerator.kt:382 */
   48     72   
    }
          73  +
    /* JsonSerializerGenerator.kt:382 */
   49     74   
    if let Some(var_7) = &input.short_value {
          75  +
        /* JsonSerializerGenerator.kt:432 */
   50     76   
        object.key("shortValue").number(
   51     77   
            #[allow(clippy::useless_conversion)]
   52     78   
            ::aws_smithy_types::Number::NegInt((*var_7).into()),
   53     79   
        );
          80  +
        /* JsonSerializerGenerator.kt:382 */
   54     81   
    }
          82  +
    /* JsonSerializerGenerator.kt:382 */
   55     83   
    if let Some(var_8) = &input.string_value {
          84  +
        /* JsonSerializerGenerator.kt:423 */
   56     85   
        object.key("stringValue").string(var_8.as_str());
          86  +
        /* JsonSerializerGenerator.kt:382 */
   57     87   
    }
          88  +
    /* JsonSerializerGenerator.kt:382 */
   58     89   
    if let Some(var_9) = &input.true_boolean_value {
          90  +
        /* JsonSerializerGenerator.kt:424 */
   59     91   
        object.key("trueBooleanValue").boolean(*var_9);
          92  +
        /* JsonSerializerGenerator.kt:382 */
   60     93   
    }
          94  +
    /* JsonSerializerGenerator.kt:372 */
   61     95   
    Ok(())
          96  +
    /* JsonSerializerGenerator.kt:358 */
   62     97   
}

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

@@ -1,1 +102,122 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:551 */
    2      3   
pub(crate) fn de_simple_union<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<crate::model::SimpleUnion>,
    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:565 */
   16     18   
    let mut variant = None;
          19  +
    /* JsonParserGenerator.kt:567 */
   17     20   
    match tokens.next().transpose()? {
          21  +
        /* JsonParserGenerator.kt:568 */
   18     22   
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => return Ok(None),
   19         -
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => loop {
   20         -
            match tokens.next().transpose()? {
   21         -
                Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   22         -
                Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
   23         -
                    if let ::std::option::Option::Some(::std::result::Result::Ok(
   24         -
                        ::aws_smithy_json::deserialize::Token::ValueNull { .. },
   25         -
                    )) = tokens.peek()
   26         -
                    {
   27         -
                        let _ = tokens.next().expect("peek returned a token")?;
   28         -
                        continue;
   29         -
                    }
   30         -
                    let key = key.to_unescaped()?;
   31         -
                    if key == "__type" {
   32         -
                        ::aws_smithy_json::deserialize::token::skip_value(tokens)?;
   33         -
                        continue;
   34         -
                    }
   35         -
                    if variant.is_some() {
   36         -
                        return Err(
   37         -
                            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   38         -
                                "encountered mixed variants in union",
   39         -
                            ),
   40         -
                        );
   41         -
                    }
   42         -
                    variant = match key.as_ref() {
   43         -
                        "int" => Some(crate::model::SimpleUnion::Int(
   44         -
                            ::aws_smithy_json::deserialize::token::expect_number_or_null(
   45         -
                                tokens.next(),
   46         -
                            )?
   47         -
                            .map(i32::try_from)
   48         -
                            .transpose()?
   49         -
                            .ok_or_else(|| {
   50         -
                                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   51         -
                                    "value for 'int' cannot be null",
   52         -
                                )
   53         -
                            })?,
   54         -
                        )),
   55         -
                        "string" => Some(crate::model::SimpleUnion::String(
   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         -
                            .ok_or_else(|| {
   62         -
                                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   63         -
                                    "value for 'string' cannot be null",
   64         -
                                )
   65         -
                            })?,
   66         -
                        )),
   67         -
                        variant => {
          23  +
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
          24  +
            /* JsonParserGenerator.kt:684 */
          25  +
            loop {
          26  +
                /* JsonParserGenerator.kt:685 */
          27  +
                match tokens.next().transpose()? {
          28  +
                    /* JsonParserGenerator.kt:686 */
          29  +
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
          30  +
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
          31  +
                        /* JsonParserGenerator.kt:576 */
          32  +
                        if let ::std::option::Option::Some(::std::result::Result::Ok(
          33  +
                            ::aws_smithy_json::deserialize::Token::ValueNull { .. },
          34  +
                        )) = tokens.peek()
          35  +
                        {
          36  +
                            let _ = tokens.next().expect("peek returned a token")?;
          37  +
                            continue;
          38  +
                        }
          39  +
                        /* JsonParserGenerator.kt:585 */
          40  +
                        let key = key.to_unescaped()?;
          41  +
                        if key == "__type" {
          42  +
                            ::aws_smithy_json::deserialize::token::skip_value(tokens)?;
          43  +
                            continue;
          44  +
                        }
          45  +
                        if variant.is_some() {
   68     46   
                            return Err(
   69     47   
                                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   70         -
                                    format!("unexpected union variant: {}", variant),
          48  +
                                    "encountered mixed variants in union",
   71     49   
                                ),
   72         -
                            )
          50  +
                            );
   73     51   
                        }
   74         -
                    };
   75         -
                }
   76         -
                other => {
   77         -
                    return Err(
   78         -
                        ::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   79         -
                            "expected object key or end object, found: {:?}",
   80         -
                            other
   81         -
                        )),
   82         -
                    )
          52  +
                        /* JsonParserGenerator.kt:598 */
          53  +
                        variant = match key.as_ref() {
          54  +
                            /* JsonParserGenerator.kt:601 */
          55  +
                            "int" => {
          56  +
                                /* JsonParserGenerator.kt:611 */
          57  +
                                Some(crate::model::SimpleUnion::Int(
          58  +
                                    /* JsonParserGenerator.kt:365 */::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
          59  +
                                                        .map(i32::try_from)
          60  +
                                                        .transpose()?
          61  +
                                    /* JsonParserGenerator.kt:670 */.ok_or_else(|| ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'int' cannot be null"))?
          62  +
                                /* JsonParserGenerator.kt:611 */))
          63  +
                                /* JsonParserGenerator.kt:601 */
          64  +
                            }
          65  +
                            /* JsonParserGenerator.kt:601 */
          66  +
                            "string" => {
          67  +
                                /* JsonParserGenerator.kt:611 */
          68  +
                                Some(crate::model::SimpleUnion::String(
          69  +
                                    /* JsonParserGenerator.kt:354 */::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?.map(|s|
          70  +
                                        /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          71  +
                                            /* JsonParserGenerator.kt:348 */u.into_owned()
          72  +
                                        /* JsonParserGenerator.kt:339 */)
          73  +
                                    /* JsonParserGenerator.kt:354 */).transpose()?
          74  +
                                    /* JsonParserGenerator.kt:670 */.ok_or_else(|| ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'string' cannot be null"))?
          75  +
                                /* JsonParserGenerator.kt:611 */))
          76  +
                                /* JsonParserGenerator.kt:601 */
          77  +
                            }
          78  +
                            /* JsonParserGenerator.kt:634 */
          79  +
                            variant => {
          80  +
                                return Err(
          81  +
                                    ::aws_smithy_json::deserialize::error::DeserializeError::custom(
          82  +
                                        format!("unexpected union variant: {}", variant),
          83  +
                                    ),
          84  +
                                )
          85  +
                            } /* JsonParserGenerator.kt:598 */
          86  +
                        };
          87  +
                        /* JsonParserGenerator.kt:686 */
          88  +
                    }
          89  +
                    /* JsonParserGenerator.kt:695 */
          90  +
                    other => {
          91  +
                        return Err(
          92  +
                            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
          93  +
                                format!("expected object key or end object, found: {:?}", other),
          94  +
                            ),
          95  +
                        )
          96  +
                    } /* JsonParserGenerator.kt:685 */
   83     97   
                }
          98  +
                /* JsonParserGenerator.kt:684 */
   84     99   
            }
   85         -
        },
         100  +
            /* JsonParserGenerator.kt:568 */
         101  +
        }
         102  +
        /* JsonParserGenerator.kt:642 */
   86    103   
        _ => {
   87    104   
            return Err(
   88    105   
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   89    106   
                    "expected start object or null",
   90    107   
                ),
   91    108   
            )
   92         -
        }
         109  +
        } /* JsonParserGenerator.kt:567 */
   93    110   
    }
         111  +
    /* JsonParserGenerator.kt:649 */
   94    112   
    if variant.is_none() {
   95    113   
        return Err(
   96    114   
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   97    115   
                "Union did not contain a valid variant.",
   98    116   
            ),
   99    117   
        );
  100    118   
    }
         119  +
    /* JsonParserGenerator.kt:657 */
  101    120   
    Ok(variant)
         121  +
    /* JsonParserGenerator.kt:551 */
  102    122   
}

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

@@ -1,1 +47,72 @@
    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_boolean_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<bool>>>,
    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 = ::aws_smithy_json::deserialize::token::expect_bool_or_null(
   26         -
                            tokens.next(),
   27         -
                        )?;
          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:298 */::aws_smithy_json::deserialize::token::expect_bool_or_null(tokens.next())?
          40  +
                        /* JsonParserGenerator.kt:474 */;
          41  +
                        /* JsonParserGenerator.kt:478 */
   28     42   
                        map.insert(key, value);
          43  +
                        /* JsonParserGenerator.kt:686 */
   29     44   
                    }
          45  +
                    /* JsonParserGenerator.kt:695 */
   30     46   
                    other => {
   31     47   
                        return Err(
   32     48   
                            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   33     49   
                                format!("expected object key or end object, found: {:?}", other),
   34     50   
                            ),
   35     51   
                        )
   36         -
                    }
          52  +
                    } /* JsonParserGenerator.kt:685 */
   37     53   
                }
          54  +
                /* JsonParserGenerator.kt:684 */
   38     55   
            }
          56  +
            /* JsonParserGenerator.kt:504 */
   39     57   
            Ok(Some(map))
          58  +
            /* JsonParserGenerator.kt:713 */
   40     59   
        }
   41         -
        _ => Err(
   42         -
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   43         -
                "expected start object or null",
   44         -
            ),
   45         -
        ),
          60  +
        /* JsonParserGenerator.kt:722 */
          61  +
        _ => {
          62  +
            /* JsonParserGenerator.kt:723 */
          63  +
            Err(
          64  +
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
          65  +
                    "expected start object or null",
          66  +
                ),
          67  +
            )
          68  +
            /* JsonParserGenerator.kt:722 */
          69  +
        } /* JsonParserGenerator.kt:712 */
   46     70   
    }
          71  +
    /* JsonParserGenerator.kt:460 */
   47     72   
}

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

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

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

@@ -1,1 +45,79 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
    2      3   
pub fn ser_sparse_json_lists_output_output_output(
    3      4   
    value: &crate::output::SparseJsonListsOutput,
    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_sparse_json_lists_output::ser_sparse_json_lists_output_output(
    8     11   
        &mut object,
    9     12   
        value,
   10     13   
    )?;
          14  +
    /* JsonSerializerGenerator.kt:227 */
   11     15   
    object.finish();
   12     16   
    Ok(out)
          17  +
    /* JsonSerializerGenerator.kt:213 */
   13     18   
}
   14     19   
          20  +
/* JsonSerializerGenerator.kt:358 */
   15     21   
pub fn ser_sparse_json_lists_output_output(
   16     22   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   17     23   
    input: &crate::output::SparseJsonListsOutput,
   18     24   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          25  +
    /* JsonSerializerGenerator.kt:382 */
   19     26   
    if let Some(var_1) = &input.sparse_short_list {
          27  +
        /* JsonSerializerGenerator.kt:484 */
   20     28   
        let mut array_2 = object.key("sparseShortList").start_array();
          29  +
        /* JsonSerializerGenerator.kt:524 */
   21     30   
        for item_3 in var_1 {
          31  +
            /* JsonSerializerGenerator.kt:382 */
   22     32   
            if let Some(var_4) = item_3 {
          33  +
                /* JsonSerializerGenerator.kt:432 */
   23     34   
                array_2.value().number(
   24     35   
                    #[allow(clippy::useless_conversion)]
   25     36   
                    ::aws_smithy_types::Number::NegInt((*var_4).into()),
   26     37   
                );
   27         -
            } else {
          38  +
            /* JsonSerializerGenerator.kt:382 */
          39  +
            }
          40  +
            /* JsonSerializerGenerator.kt:395 */
          41  +
            else {
          42  +
                /* JsonSerializerGenerator.kt:396 */
   28     43   
                array_2.value().null();
          44  +
                /* JsonSerializerGenerator.kt:395 */
   29     45   
            }
          46  +
            /* JsonSerializerGenerator.kt:524 */
   30     47   
        }
          48  +
        /* JsonSerializerGenerator.kt:486 */
   31     49   
        array_2.finish();
          50  +
        /* JsonSerializerGenerator.kt:382 */
   32     51   
    }
          52  +
    /* JsonSerializerGenerator.kt:382 */
   33     53   
    if let Some(var_5) = &input.sparse_string_list {
          54  +
        /* JsonSerializerGenerator.kt:484 */
   34     55   
        let mut array_6 = object.key("sparseStringList").start_array();
          56  +
        /* JsonSerializerGenerator.kt:524 */
   35     57   
        for item_7 in var_5 {
          58  +
            /* JsonSerializerGenerator.kt:382 */
   36     59   
            if let Some(var_8) = item_7 {
          60  +
                /* JsonSerializerGenerator.kt:423 */
   37     61   
                array_6.value().string(var_8.as_str());
   38         -
            } else {
          62  +
            /* JsonSerializerGenerator.kt:382 */
          63  +
            }
          64  +
            /* JsonSerializerGenerator.kt:395 */
          65  +
            else {
          66  +
                /* JsonSerializerGenerator.kt:396 */
   39     67   
                array_6.value().null();
          68  +
                /* JsonSerializerGenerator.kt:395 */
   40     69   
            }
          70  +
            /* JsonSerializerGenerator.kt:524 */
   41     71   
        }
          72  +
        /* JsonSerializerGenerator.kt:486 */
   42     73   
        array_6.finish();
          74  +
        /* JsonSerializerGenerator.kt:382 */
   43     75   
    }
          76  +
    /* JsonSerializerGenerator.kt:372 */
   44     77   
    Ok(())
          78  +
    /* JsonSerializerGenerator.kt:358 */
   45     79   
}

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

@@ -1,1 +176,256 @@
    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_sparse_json_maps_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::SparseJsonMapsInput,
    7      9   
    ::aws_smithy_http_server::protocol::rest_json_1::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::rest_json_1::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::sparse_json_maps_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/json"),
   27     37   
            )?;
   28     38   
            input = crate::protocol_serde::shape_sparse_json_maps::de_sparse_json_maps(
   29     39   
                bytes.as_ref(),
   30     40   
                input,
   31     41   
            )?;
          42  +
            /* ServerHttpBoundProtocolGenerator.kt:768 */
   32     43   
        }
          44  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   33     45   
        input.build()?
          46  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   34     47   
    })
          48  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   35     49   
}
   36     50   
          51  +
/* RustType.kt:516 */
   37     52   
#[allow(clippy::unnecessary_wraps)]
          53  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   38     54   
pub fn ser_sparse_json_maps_http_response(
   39     55   
    #[allow(unused_variables)] output: crate::output::SparseJsonMapsOutput,
   40     56   
) -> std::result::Result<
   41     57   
    ::aws_smithy_http_server::response::Response,
   42     58   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   43     59   
> {
          60  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   44     61   
    Ok({
          62  +
        /* RustType.kt:516 */
   45     63   
        #[allow(unused_mut)]
          64  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   46     65   
        let mut builder = ::http::Response::builder();
          66  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   47     67   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   48     68   
            builder,
   49     69   
            ::http::header::CONTENT_TYPE,
   50     70   
            "application/json",
   51     71   
        );
          72  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   52     73   
        let http_status: u16 = 200;
   53     74   
        builder = builder.status(http_status);
          75  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
   54     76   
        let payload =
   55         -
            crate::protocol_serde::shape_sparse_json_maps_output::ser_sparse_json_maps_output_output_output(&output)?
   56         -
        ;
          77  +
            /* HttpBoundProtocolPayloadGenerator.kt:237 */crate::protocol_serde::shape_sparse_json_maps_output::ser_sparse_json_maps_output_output_output(&output)?
          78  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
          79  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   57     80   
        let content_length = payload.len();
   58     81   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   59     82   
            builder,
   60     83   
            ::http::header::CONTENT_LENGTH,
   61     84   
            content_length,
   62     85   
        );
          86  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   63     87   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          88  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   64     89   
        builder.body(body)?
          90  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   65     91   
    })
          92  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   66     93   
}
   67     94   
          95  +
/* RustType.kt:516 */
   68     96   
#[allow(clippy::unnecessary_wraps)]
          97  +
/* ServerHttpBoundProtocolGenerator.kt:447 */
   69     98   
pub fn ser_sparse_json_maps_http_error(
   70     99   
    error: &crate::error::SparseJsonMapsError,
   71    100   
) -> std::result::Result<
   72    101   
    ::aws_smithy_http_server::response::Response,
   73    102   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   74    103   
> {
         104  +
    /* ServerHttpBoundProtocolGenerator.kt:452 */
   75    105   
    Ok({
         106  +
        /* ServerHttpBoundProtocolGenerator.kt:468 */
   76    107   
        match error {
         108  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
   77    109   
            crate::error::SparseJsonMapsError::ValidationException(output) => {
         110  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
   78    111   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
         112  +
                /* RustType.kt:516 */
   79    113   
                #[allow(unused_mut)]
         114  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
   80    115   
                let mut builder = ::http::Response::builder();
         116  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   81    117   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   82    118   
                    builder,
   83    119   
                    ::http::header::CONTENT_TYPE,
   84    120   
                    "application/json",
   85    121   
                );
         122  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   86    123   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   87    124   
                    builder,
   88    125   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
   89    126   
                    "ValidationException",
   90    127   
                );
         128  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
   91    129   
                let content_length = payload.len();
   92    130   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   93    131   
                    builder,
   94    132   
                    ::http::header::CONTENT_LENGTH,
   95    133   
                    content_length,
   96    134   
                );
         135  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
   97    136   
                builder
   98    137   
                    .status(400)
   99    138   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
  100         -
            }
         139  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
         140  +
            } /* ServerHttpBoundProtocolGenerator.kt:468 */
  101    141   
        }
         142  +
        /* ServerHttpBoundProtocolGenerator.kt:452 */
  102    143   
    })
         144  +
    /* ServerHttpBoundProtocolGenerator.kt:447 */
  103    145   
}
  104    146   
         147  +
/* JsonParserGenerator.kt:148 */
  105    148   
pub(crate) fn de_sparse_json_maps(
  106    149   
    value: &[u8],
  107    150   
    mut builder: crate::input::sparse_json_maps_input::Builder,
  108    151   
) -> ::std::result::Result<
  109    152   
    crate::input::sparse_json_maps_input::Builder,
  110    153   
    ::aws_smithy_json::deserialize::error::DeserializeError,
  111    154   
> {
         155  +
    /* JsonParserGenerator.kt:153 */
  112    156   
    let mut tokens_owned =
  113    157   
        ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value))
  114    158   
            .peekable();
  115    159   
    let tokens = &mut tokens_owned;
  116    160   
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
         161  +
    /* JsonParserGenerator.kt:684 */
  117    162   
    loop {
         163  +
        /* JsonParserGenerator.kt:685 */
  118    164   
        match tokens.next().transpose()? {
         165  +
            /* JsonParserGenerator.kt:686 */
  119    166   
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
  120    167   
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
         168  +
                /* JsonParserGenerator.kt:260 */
  121    169   
                match key.to_unescaped()?.as_ref() {
         170  +
                    /* JsonParserGenerator.kt:262 */
  122    171   
                    "sparseBooleanMap" => {
         172  +
                        /* JsonParserGenerator.kt:272 */
  123    173   
                        builder = builder.set_sparse_boolean_map(
         174  +
                            /* JsonParserGenerator.kt:509 */
  124    175   
                            crate::protocol_serde::shape_sparse_boolean_map::de_sparse_boolean_map(
  125    176   
                                tokens,
  126         -
                            )?,
         177  +
                            )?, /* JsonParserGenerator.kt:272 */
  127    178   
                        );
         179  +
                        /* JsonParserGenerator.kt:262 */
  128    180   
                    }
         181  +
                    /* JsonParserGenerator.kt:262 */
  129    182   
                    "sparseNumberMap" => {
         183  +
                        /* JsonParserGenerator.kt:272 */
  130    184   
                        builder = builder.set_sparse_number_map(
         185  +
                            /* JsonParserGenerator.kt:509 */
  131    186   
                            crate::protocol_serde::shape_sparse_number_map::de_sparse_number_map(
  132    187   
                                tokens,
  133         -
                            )?,
         188  +
                            )?, /* JsonParserGenerator.kt:272 */
  134    189   
                        );
         190  +
                        /* JsonParserGenerator.kt:262 */
  135    191   
                    }
         192  +
                    /* JsonParserGenerator.kt:262 */
  136    193   
                    "sparseSetMap" => {
  137         -
                        builder = builder.set_sparse_set_map(
  138         -
                            crate::protocol_serde::shape_sparse_set_map::de_sparse_set_map(tokens)?,
  139         -
                        );
         194  +
                        /* JsonParserGenerator.kt:272 */
         195  +
                        builder =
         196  +
                            builder.set_sparse_set_map(
         197  +
                                /* JsonParserGenerator.kt:509 */
         198  +
                                crate::protocol_serde::shape_sparse_set_map::de_sparse_set_map(
         199  +
                                    tokens,
         200  +
                                )?, /* JsonParserGenerator.kt:272 */
         201  +
                            );
         202  +
                        /* JsonParserGenerator.kt:262 */
  140    203   
                    }
         204  +
                    /* JsonParserGenerator.kt:262 */
  141    205   
                    "sparseStringMap" => {
         206  +
                        /* JsonParserGenerator.kt:272 */
  142    207   
                        builder = builder.set_sparse_string_map(
         208  +
                            /* JsonParserGenerator.kt:509 */
  143    209   
                            crate::protocol_serde::shape_sparse_string_map::de_sparse_string_map(
  144    210   
                                tokens,
  145         -
                            )?,
         211  +
                            )?, /* JsonParserGenerator.kt:272 */
  146    212   
                        );
         213  +
                        /* JsonParserGenerator.kt:262 */
  147    214   
                    }
         215  +
                    /* JsonParserGenerator.kt:262 */
  148    216   
                    "sparseStructMap" => {
         217  +
                        /* JsonParserGenerator.kt:272 */
  149    218   
                        builder = builder.set_sparse_struct_map(
         219  +
                            /* JsonParserGenerator.kt:509 */
  150    220   
                            crate::protocol_serde::shape_sparse_struct_map::de_sparse_struct_map(
  151    221   
                                tokens,
  152         -
                            )?,
         222  +
                            )?, /* JsonParserGenerator.kt:272 */
  153    223   
                        );
         224  +
                        /* JsonParserGenerator.kt:262 */
  154    225   
                    }
  155         -
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
         226  +
                    /* JsonParserGenerator.kt:290 */
         227  +
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
  156    228   
                }
         229  +
                /* JsonParserGenerator.kt:686 */
  157    230   
            }
         231  +
            /* JsonParserGenerator.kt:695 */
  158    232   
            other => {
  159    233   
                return Err(
  160    234   
                    ::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  161    235   
                        "expected object key or end object, found: {:?}",
  162    236   
                        other
  163    237   
                    )),
  164    238   
                )
  165         -
            }
         239  +
            } /* JsonParserGenerator.kt:685 */
  166    240   
        }
         241  +
        /* JsonParserGenerator.kt:684 */
  167    242   
    }
         243  +
    /* JsonParserGenerator.kt:250 */
  168    244   
    if tokens.next().is_some() {
         245  +
        /* JsonParserGenerator.kt:251 */
  169    246   
        return Err(
  170    247   
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
  171    248   
                "found more JSON tokens after completing parsing",
  172    249   
            ),
  173    250   
        );
         251  +
        /* JsonParserGenerator.kt:250 */
  174    252   
    }
         253  +
    /* JsonParserGenerator.kt:163 */
  175    254   
    Ok(builder)
         255  +
    /* JsonParserGenerator.kt:148 */
  176    256   
}

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

@@ -1,1 +95,182 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
    2      3   
pub fn ser_sparse_json_maps_output_output_output(
    3      4   
    value: &crate::output::SparseJsonMapsOutput,
    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_sparse_json_maps_output::ser_sparse_json_maps_output_output(
    8     11   
        &mut object,
    9     12   
        value,
   10     13   
    )?;
          14  +
    /* JsonSerializerGenerator.kt:227 */
   11     15   
    object.finish();
   12     16   
    Ok(out)
          17  +
    /* JsonSerializerGenerator.kt:213 */
   13     18   
}
   14     19   
          20  +
/* JsonSerializerGenerator.kt:358 */
   15     21   
pub fn ser_sparse_json_maps_output_output(
   16     22   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   17     23   
    input: &crate::output::SparseJsonMapsOutput,
   18     24   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          25  +
    /* JsonSerializerGenerator.kt:382 */
   19     26   
    if let Some(var_1) = &input.sparse_boolean_map {
          27  +
        /* JsonSerializerGenerator.kt:495 */
   20     28   
        #[allow(unused_mut)]
          29  +
        /* JsonSerializerGenerator.kt:496 */
   21     30   
        let mut object_2 = object.key("sparseBooleanMap").start_object();
          31  +
        /* JsonSerializerGenerator.kt:537 */
   22     32   
        for (key_3, value_4) in var_1 {
          33  +
            /* JsonSerializerGenerator.kt:382 */
   23     34   
            if let Some(var_5) = value_4 {
          35  +
                /* JsonSerializerGenerator.kt:424 */
   24     36   
                object_2.key(key_3.as_str()).boolean(*var_5);
   25         -
            } else {
          37  +
            /* JsonSerializerGenerator.kt:382 */
          38  +
            }
          39  +
            /* JsonSerializerGenerator.kt:395 */
          40  +
            else {
          41  +
                /* JsonSerializerGenerator.kt:396 */
   26     42   
                object_2.key(key_3.as_str()).null();
          43  +
                /* JsonSerializerGenerator.kt:395 */
   27     44   
            }
          45  +
            /* JsonSerializerGenerator.kt:537 */
   28     46   
        }
          47  +
        /* JsonSerializerGenerator.kt:515 */
   29     48   
        object_2.finish();
          49  +
        /* JsonSerializerGenerator.kt:382 */
   30     50   
    }
          51  +
    /* JsonSerializerGenerator.kt:382 */
   31     52   
    if let Some(var_6) = &input.sparse_number_map {
          53  +
        /* JsonSerializerGenerator.kt:495 */
   32     54   
        #[allow(unused_mut)]
          55  +
        /* JsonSerializerGenerator.kt:496 */
   33     56   
        let mut object_7 = object.key("sparseNumberMap").start_object();
          57  +
        /* JsonSerializerGenerator.kt:537 */
   34     58   
        for (key_8, value_9) in var_6 {
          59  +
            /* JsonSerializerGenerator.kt:382 */
   35     60   
            if let Some(var_10) = value_9 {
          61  +
                /* JsonSerializerGenerator.kt:432 */
   36     62   
                object_7.key(key_8.as_str()).number(
   37     63   
                    #[allow(clippy::useless_conversion)]
   38     64   
                    ::aws_smithy_types::Number::NegInt((*var_10).into()),
   39     65   
                );
   40         -
            } else {
          66  +
            /* JsonSerializerGenerator.kt:382 */
          67  +
            }
          68  +
            /* JsonSerializerGenerator.kt:395 */
          69  +
            else {
          70  +
                /* JsonSerializerGenerator.kt:396 */
   41     71   
                object_7.key(key_8.as_str()).null();
          72  +
                /* JsonSerializerGenerator.kt:395 */
   42     73   
            }
          74  +
            /* JsonSerializerGenerator.kt:537 */
   43     75   
        }
          76  +
        /* JsonSerializerGenerator.kt:515 */
   44     77   
        object_7.finish();
          78  +
        /* JsonSerializerGenerator.kt:382 */
   45     79   
    }
          80  +
    /* JsonSerializerGenerator.kt:382 */
   46     81   
    if let Some(var_11) = &input.sparse_set_map {
          82  +
        /* JsonSerializerGenerator.kt:495 */
   47     83   
        #[allow(unused_mut)]
          84  +
        /* JsonSerializerGenerator.kt:496 */
   48     85   
        let mut object_12 = object.key("sparseSetMap").start_object();
          86  +
        /* JsonSerializerGenerator.kt:537 */
   49     87   
        for (key_13, value_14) in var_11 {
          88  +
            /* JsonSerializerGenerator.kt:382 */
   50     89   
            if let Some(var_15) = value_14 {
          90  +
                /* JsonSerializerGenerator.kt:484 */
   51     91   
                let mut array_16 = object_12.key(key_13.as_str()).start_array();
          92  +
                /* JsonSerializerGenerator.kt:524 */
   52     93   
                for item_17 in &var_15.0 {
          94  +
                    /* SerializerUtil.kt:42 */
   53     95   
                    {
          96  +
                        /* JsonSerializerGenerator.kt:423 */
   54     97   
                        array_16.value().string(item_17.as_str());
          98  +
                        /* SerializerUtil.kt:42 */
   55     99   
                    }
         100  +
                    /* JsonSerializerGenerator.kt:524 */
   56    101   
                }
         102  +
                /* JsonSerializerGenerator.kt:486 */
   57    103   
                array_16.finish();
   58         -
            } else {
         104  +
            /* JsonSerializerGenerator.kt:382 */
         105  +
            }
         106  +
            /* JsonSerializerGenerator.kt:395 */
         107  +
            else {
         108  +
                /* JsonSerializerGenerator.kt:396 */
   59    109   
                object_12.key(key_13.as_str()).null();
         110  +
                /* JsonSerializerGenerator.kt:395 */
   60    111   
            }
         112  +
            /* JsonSerializerGenerator.kt:537 */
   61    113   
        }
         114  +
        /* JsonSerializerGenerator.kt:515 */
   62    115   
        object_12.finish();
         116  +
        /* JsonSerializerGenerator.kt:382 */
   63    117   
    }
         118  +
    /* JsonSerializerGenerator.kt:382 */
   64    119   
    if let Some(var_18) = &input.sparse_string_map {
         120  +
        /* JsonSerializerGenerator.kt:495 */
   65    121   
        #[allow(unused_mut)]
         122  +
        /* JsonSerializerGenerator.kt:496 */
   66    123   
        let mut object_19 = object.key("sparseStringMap").start_object();
         124  +
        /* JsonSerializerGenerator.kt:537 */
   67    125   
        for (key_20, value_21) in var_18 {
         126  +
            /* JsonSerializerGenerator.kt:382 */
   68    127   
            if let Some(var_22) = value_21 {
         128  +
                /* JsonSerializerGenerator.kt:423 */
   69    129   
                object_19.key(key_20.as_str()).string(var_22.as_str());
   70         -
            } else {
         130  +
            /* JsonSerializerGenerator.kt:382 */
         131  +
            }
         132  +
            /* JsonSerializerGenerator.kt:395 */
         133  +
            else {
         134  +
                /* JsonSerializerGenerator.kt:396 */
   71    135   
                object_19.key(key_20.as_str()).null();
         136  +
                /* JsonSerializerGenerator.kt:395 */
   72    137   
            }
         138  +
            /* JsonSerializerGenerator.kt:537 */
   73    139   
        }
         140  +
        /* JsonSerializerGenerator.kt:515 */
   74    141   
        object_19.finish();
         142  +
        /* JsonSerializerGenerator.kt:382 */
   75    143   
    }
         144  +
    /* JsonSerializerGenerator.kt:382 */
   76    145   
    if let Some(var_23) = &input.sparse_struct_map {
         146  +
        /* JsonSerializerGenerator.kt:495 */
   77    147   
        #[allow(unused_mut)]
         148  +
        /* JsonSerializerGenerator.kt:496 */
   78    149   
        let mut object_24 = object.key("sparseStructMap").start_object();
         150  +
        /* JsonSerializerGenerator.kt:537 */
   79    151   
        for (key_25, value_26) in var_23 {
         152  +
            /* JsonSerializerGenerator.kt:382 */
   80    153   
            if let Some(var_27) = value_26 {
         154  +
                /* JsonSerializerGenerator.kt:495 */
   81    155   
                #[allow(unused_mut)]
         156  +
                /* JsonSerializerGenerator.kt:496 */
   82    157   
                let mut object_28 = object_24.key(key_25.as_str()).start_object();
         158  +
                /* JsonSerializerGenerator.kt:375 */
   83    159   
                crate::protocol_serde::shape_greeting_struct::ser_greeting_struct(
   84    160   
                    &mut object_28,
   85    161   
                    var_27,
   86    162   
                )?;
         163  +
                /* JsonSerializerGenerator.kt:515 */
   87    164   
                object_28.finish();
   88         -
            } else {
         165  +
            /* JsonSerializerGenerator.kt:382 */
         166  +
            }
         167  +
            /* JsonSerializerGenerator.kt:395 */
         168  +
            else {
         169  +
                /* JsonSerializerGenerator.kt:396 */
   89    170   
                object_24.key(key_25.as_str()).null();
         171  +
                /* JsonSerializerGenerator.kt:395 */
   90    172   
            }
         173  +
            /* JsonSerializerGenerator.kt:537 */
   91    174   
        }
         175  +
        /* JsonSerializerGenerator.kt:515 */
   92    176   
        object_24.finish();
         177  +
        /* JsonSerializerGenerator.kt:382 */
   93    178   
    }
         179  +
    /* JsonSerializerGenerator.kt:372 */
   94    180   
    Ok(())
         181  +
    /* JsonSerializerGenerator.kt:358 */
   95    182   
}

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

@@ -1,1 +49,74 @@
    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_number_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<i32>>>,
    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 = ::aws_smithy_json::deserialize::token::expect_number_or_null(
   26         -
                            tokens.next(),
   27         -
                        )?
   28         -
                        .map(i32::try_from)
   29         -
                        .transpose()?;
          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:365 */::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
          40  +
                                                .map(i32::try_from)
          41  +
                                                .transpose()?
          42  +
                        /* JsonParserGenerator.kt:474 */;
          43  +
                        /* JsonParserGenerator.kt:478 */
   30     44   
                        map.insert(key, value);
          45  +
                        /* JsonParserGenerator.kt:686 */
   31     46   
                    }
          47  +
                    /* JsonParserGenerator.kt:695 */
   32     48   
                    other => {
   33     49   
                        return Err(
   34     50   
                            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   35     51   
                                format!("expected object key or end object, found: {:?}", other),
   36     52   
                            ),
   37     53   
                        )
   38         -
                    }
          54  +
                    } /* JsonParserGenerator.kt:685 */
   39     55   
                }
          56  +
                /* JsonParserGenerator.kt:684 */
   40     57   
            }
          58  +
            /* JsonParserGenerator.kt:504 */
   41     59   
            Ok(Some(map))
          60  +
            /* JsonParserGenerator.kt:713 */
   42     61   
        }
   43         -
        _ => Err(
   44         -
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   45         -
                "expected start object or null",
   46         -
            ),
   47         -
        ),
          62  +
        /* JsonParserGenerator.kt:722 */
          63  +
        _ => {
          64  +
            /* JsonParserGenerator.kt:723 */
          65  +
            Err(
          66  +
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
          67  +
                    "expected start object or null",
          68  +
                ),
          69  +
            )
          70  +
            /* JsonParserGenerator.kt:722 */
          71  +
        } /* JsonParserGenerator.kt:712 */
   48     72   
    }
          73  +
    /* JsonParserGenerator.kt:460 */
   49     74   
}

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

@@ -1,1 +47,74 @@
    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_set_map<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<crate::unconstrained::sparse_set_map_unconstrained::SparseSetMapUnconstrained>,
    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_string_set::de_string_set(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:451 */crate::protocol_serde::shape_string_set::de_string_set(tokens)?
          40  +
                        /* JsonParserGenerator.kt:474 */;
          41  +
                        /* JsonParserGenerator.kt:478 */
   26     42   
                        map.insert(key, value);
          43  +
                        /* JsonParserGenerator.kt:686 */
   27     44   
                    }
          45  +
                    /* JsonParserGenerator.kt:695 */
   28     46   
                    other => {
   29     47   
                        return Err(
   30     48   
                            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   31     49   
                                format!("expected object key or end object, found: {:?}", other),
   32     50   
                            ),
   33     51   
                        )
   34         -
                    }
          52  +
                    } /* JsonParserGenerator.kt:685 */
   35     53   
                }
          54  +
                /* JsonParserGenerator.kt:684 */
   36     55   
            }
          56  +
            /* JsonParserGenerator.kt:502 */
   37     57   
            Ok(Some(
   38     58   
                crate::unconstrained::sparse_set_map_unconstrained::SparseSetMapUnconstrained(map),
   39     59   
            ))
          60  +
            /* JsonParserGenerator.kt:713 */
   40     61   
        }
   41         -
        _ => Err(
   42         -
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   43         -
                "expected start object or null",
   44         -
            ),
   45         -
        ),
          62  +
        /* JsonParserGenerator.kt:722 */
          63  +
        _ => {
          64  +
            /* JsonParserGenerator.kt:723 */
          65  +
            Err(
          66  +
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
          67  +
                    "expected start object or null",
          68  +
                ),
          69  +
            )
          70  +
            /* JsonParserGenerator.kt:722 */
          71  +
        } /* JsonParserGenerator.kt:712 */
   46     72   
    }
          73  +
    /* JsonParserGenerator.kt:460 */
   47     74   
}

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

@@ -1,1 +45,67 @@
    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_short_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<i16>>>,
    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   
                    _ => {
          37  +
                        /* JsonParserGenerator.kt:415 */
   27     38   
                        items.push(
          39  +
                            /* JsonParserGenerator.kt:365 */
   28     40   
                            ::aws_smithy_json::deserialize::token::expect_number_or_null(
   29     41   
                                tokens.next(),
   30     42   
                            )?
   31     43   
                            .map(i16::try_from)
   32         -
                            .transpose()?,
          44  +
                            .transpose()?, /* JsonParserGenerator.kt:415 */
   33     45   
                        );
   34         -
                    }
          46  +
                        /* JsonParserGenerator.kt:413 */
          47  +
                    } /* JsonParserGenerator.kt:409 */
   35     48   
                }
          49  +
                /* JsonParserGenerator.kt:408 */
   36     50   
            }
          51  +
            /* JsonParserGenerator.kt:446 */
   37     52   
            Ok(Some(items))
          53  +
            /* JsonParserGenerator.kt:713 */
   38     54   
        }
   39         -
        _ => Err(
   40         -
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   41         -
                "expected start array or null",
   42         -
            ),
   43         -
        ),
          55  +
        /* JsonParserGenerator.kt:722 */
          56  +
        _ => {
          57  +
            /* JsonParserGenerator.kt:723 */
          58  +
            Err(
          59  +
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
          60  +
                    "expected start array or null",
          61  +
                ),
          62  +
            )
          63  +
            /* JsonParserGenerator.kt:722 */
          64  +
        } /* JsonParserGenerator.kt:712 */
   44     65   
    }
          66  +
    /* JsonParserGenerator.kt:398 */
   45     67   
}

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

@@ -1,1 +45,70 @@
    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<
   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   
                    _ => {
          37  +
                        /* JsonParserGenerator.kt:415 */
   27     38   
                        items.push(
          39  +
                            /* JsonParserGenerator.kt:354 */
   28     40   
                            ::aws_smithy_json::deserialize::token::expect_string_or_null(
   29     41   
                                tokens.next(),
   30     42   
                            )?
   31         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   32         -
                            .transpose()?,
          43  +
                            .map(|s|
          44  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          45  +
                                    /* JsonParserGenerator.kt:348 */u.into_owned()
          46  +
                                /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
          47  +
                            .transpose()?, /* JsonParserGenerator.kt:415 */
   33     48   
                        );
   34         -
                    }
          49  +
                        /* JsonParserGenerator.kt:413 */
          50  +
                    } /* JsonParserGenerator.kt:409 */
   35     51   
                }
          52  +
                /* JsonParserGenerator.kt:408 */
   36     53   
            }
          54  +
            /* JsonParserGenerator.kt:446 */
   37     55   
            Ok(Some(items))
          56  +
            /* JsonParserGenerator.kt:713 */
   38     57   
        }
   39         -
        _ => Err(
   40         -
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   41         -
                "expected start array or null",
   42         -
            ),
   43         -
        ),
          58  +
        /* JsonParserGenerator.kt:722 */
          59  +
        _ => {
          60  +
            /* JsonParserGenerator.kt:723 */
          61  +
            Err(
          62  +
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
          63  +
                    "expected start array or null",
          64  +
                ),
          65  +
            )
          66  +
            /* JsonParserGenerator.kt:722 */
          67  +
        } /* JsonParserGenerator.kt:712 */
   44     68   
    }
          69  +
    /* JsonParserGenerator.kt:398 */
   45     70   
}

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

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

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

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

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

@@ -1,1 +96,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  +
/* ServerHttpBoundProtocolGenerator.kt:383 */
    3      5   
pub async fn de_streaming_traits_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::StreamingTraitsInput,
    7      9   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
    8     10   
>
    9     11   
where
   10     12   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11     13   
    B: Into<::aws_smithy_types::byte_stream::ByteStream>,
   12     14   
    B::Data: Send,
   13     15   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
   14     16   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   15     17   
{
          18  +
    /* ServerHttpBoundProtocolGenerator.kt:399 */
   16     19   
    Ok({
          20  +
        /* RustType.kt:516 */
   17     21   
        #[allow(unused_mut)]
          22  +
        /* ServerHttpBoundProtocolGenerator.kt:723 */
   18     23   
        let mut input = crate::input::streaming_traits_input::Builder::default();
          24  +
        /* RustType.kt:516 */
   19     25   
        #[allow(unused_variables)]
          26  +
        /* ServerHttpBoundProtocolGenerator.kt:728 */
   20     27   
        let ::aws_smithy_runtime_api::http::RequestParts {
   21     28   
            uri, headers, body, ..
   22     29   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          30  +
        /* ServerHttpBoundProtocolGenerator.kt:794 */
   23     31   
        if let Some(value) = {
   24     32   
            Some(
   25     33   
                crate::protocol_serde::shape_streaming_traits_input::de_blob_payload(
   26     34   
                    &mut body.into().into_inner(),
   27     35   
                )?,
   28     36   
            )
   29     37   
        } {
   30     38   
            input = input.set_blob(value)
   31     39   
        }
          40  +
        /* ServerHttpBoundProtocolGenerator.kt:794 */
   32     41   
        if let Some(value) =
   33     42   
            crate::protocol_serde::shape_streaming_traits_input::de_foo_header(&headers)?
   34     43   
        {
   35     44   
            input = input.set_foo(Some(value))
   36     45   
        }
          46  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   37     47   
        input.build()
          48  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   38     49   
    })
          50  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   39     51   
}
   40     52   
          53  +
/* RustType.kt:516 */
   41     54   
#[allow(clippy::unnecessary_wraps)]
          55  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   42     56   
pub fn ser_streaming_traits_http_response(
   43     57   
    #[allow(unused_variables)] output: crate::output::StreamingTraitsOutput,
   44     58   
) -> std::result::Result<
   45     59   
    ::aws_smithy_http_server::response::Response,
   46     60   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   47     61   
> {
          62  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   48     63   
    Ok({
          64  +
        /* RustType.kt:516 */
   49     65   
        #[allow(unused_mut)]
          66  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   50     67   
        let mut builder = ::http::Response::builder();
          68  +
        /* ServerHttpBoundProtocolGenerator.kt:629 */
   51     69   
        builder = crate::protocol_serde::shape_streaming_traits::ser_streaming_traits_headers(
   52     70   
            &output, builder,
   53     71   
        )?;
          72  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   54     73   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   55     74   
            builder,
   56     75   
            ::http::header::CONTENT_TYPE,
   57     76   
            "application/octet-stream",
   58     77   
        );
          78  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   59     79   
        let http_status: u16 = 200;
   60     80   
        builder = builder.status(http_status);
          81  +
        /* ServerHttpBoundProtocolGenerator.kt:543 */
   61     82   
        let body = ::aws_smithy_http_server::body::boxed(
   62     83   
            ::aws_smithy_http_server::body::Body::wrap_stream(
          84  +
                /* ServerProtocolLoader.kt:36 */
   63     85   
                ::aws_smithy_http::futures_stream_adapter::FuturesStreamCompatByteStream::new(
          86  +
                    /* HttpBoundProtocolPayloadGenerator.kt:350 */
   64     87   
                    crate::protocol_serde::shape_streaming_traits_output::ser_blob_http_payload(
   65     88   
                        output.blob,
   66         -
                    )?,
   67         -
                ),
          89  +
                    )?, /* ServerProtocolLoader.kt:36 */
          90  +
                ), /* ServerHttpBoundProtocolGenerator.kt:543 */
   68     91   
            ),
   69     92   
        );
          93  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   70     94   
        builder.body(body)?
          95  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   71     96   
    })
          97  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   72     98   
}
   73     99   
         100  +
/* HttpBindingGenerator.kt:542 */
   74    101   
pub fn ser_streaming_traits_headers(
   75    102   
    input: &crate::output::StreamingTraitsOutput,
   76    103   
    mut builder: ::http::response::Builder,
   77    104   
) -> std::result::Result<::http::response::Builder, ::aws_smithy_types::error::operation::BuildError>
   78    105   
{
         106  +
    /* HttpBindingGenerator.kt:592 */
   79    107   
    if let ::std::option::Option::Some(inner_1) = &input.foo {
         108  +
        /* HttpBindingGenerator.kt:704 */
   80    109   
        let formatted_2 = inner_1.as_str();
         110  +
        /* HttpBindingGenerator.kt:705 */
   81    111   
        if !formatted_2.is_empty() {
         112  +
            /* HttpBindingGenerator.kt:706 */
   82    113   
            let header_value = formatted_2;
   83    114   
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
   84    115   
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
   85    116   
                    "foo",
   86    117   
                    format!(
   87    118   
                        "`{}` cannot be used as a header value: {}",
   88    119   
                        &header_value, err
   89    120   
                    ),
   90    121   
                )
   91    122   
            })?;
   92    123   
            builder = builder.header("X-Foo", header_value);
         124  +
            /* HttpBindingGenerator.kt:705 */
   93    125   
        }
         126  +
        /* HttpBindingGenerator.kt:592 */
   94    127   
    }
         128  +
    /* HttpBindingGenerator.kt:555 */
   95    129   
    Ok(builder)
         130  +
    /* HttpBindingGenerator.kt:542 */
   96    131   
}

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

@@ -1,1 +21,27 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* HttpBindingGenerator.kt:230 */
    2      3   
pub fn de_blob_payload(
    3      4   
    body: &mut ::aws_smithy_types::body::SdkBody,
    4      5   
) -> std::result::Result<
    5      6   
    ::aws_smithy_types::byte_stream::ByteStream,
    6      7   
    ::aws_smithy_json::deserialize::error::DeserializeError,
    7      8   
> {
    8         -
    // replace the body with an empty body
           9  +
    /* HttpBindingGenerator.kt:299 */// replace the body with an empty body
    9     10   
    let body = std::mem::replace(body, ::aws_smithy_types::body::SdkBody::taken());
   10     11   
    Ok(::aws_smithy_types::byte_stream::ByteStream::new(body))
          12  +
    /* HttpBindingGenerator.kt:230 */
   11     13   
}
   12     14   
          15  +
/* HttpBindingGenerator.kt:153 */
   13     16   
pub(crate) fn de_foo_header(
   14     17   
    header_map: &::aws_smithy_runtime_api::http::Headers,
   15     18   
) -> ::std::result::Result<
   16     19   
    ::std::option::Option<::std::string::String>,
   17     20   
    ::aws_smithy_http::header::ParseError,
   18     21   
> {
          22  +
    /* HttpBindingGenerator.kt:160 */
   19     23   
    let headers = header_map.get_all("X-Foo");
          24  +
    /* HttpBindingGenerator.kt:375 */
   20     25   
    ::aws_smithy_http::header::one_or_none(headers)
          26  +
    /* HttpBindingGenerator.kt:153 */
   21     27   
}

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

@@ -1,1 +9,15 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* HttpBoundProtocolPayloadGenerator.kt:311 */
    2      3   
pub fn ser_blob_http_payload(
    3      4   
    payload: ::aws_smithy_types::byte_stream::ByteStream,
    4      5   
) -> ::std::result::Result<
    5      6   
    ::aws_smithy_types::byte_stream::ByteStream,
    6      7   
    ::aws_smithy_types::error::operation::BuildError,
    7      8   
> {
    8         -
    Ok(payload)
           9  +
    /* HttpBoundProtocolPayloadGenerator.kt:345 */
          10  +
    Ok(
          11  +
        /* HttpBoundProtocolPayloadGenerator.kt:374 */
          12  +
        payload, /* HttpBoundProtocolPayloadGenerator.kt:345 */
          13  +
    )
          14  +
    /* HttpBoundProtocolPayloadGenerator.kt:311 */
    9     15   
}