Server Test Python

Server Test Python

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943 (ignoring whitespace)

Files changed:

tmp-codegen-diff/codegen-server-test-python/rest_json/rust-server-codegen-python/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   
                        );
          49  +
                        /* JsonParserGenerator.kt:413 */
          50  +
                    } /* JsonParserGenerator.kt:409 */
   34     51   
                }
          52  +
                /* JsonParserGenerator.kt:408 */
   35     53   
            }
   36         -
            }
          54  +
            /* JsonParserGenerator.kt:446 */
   37     55   
            Ok(Some(items))
          56  +
            /* JsonParserGenerator.kt:713 */
   38     57   
        }
   39         -
        _ => Err(
          58  +
        /* JsonParserGenerator.kt:722 */
          59  +
        _ => {
          60  +
            /* JsonParserGenerator.kt:723 */
          61  +
            Err(
   40     62   
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   41     63   
                    "expected start array or null",
   42     64   
                ),
   43         -
        ),
          65  +
            )
          66  +
            /* JsonParserGenerator.kt:722 */
          67  +
        } /* JsonParserGenerator.kt:712 */
   44     68   
    }
          69  +
    /* JsonParserGenerator.kt:398 */
   45     70   
}

tmp-codegen-diff/codegen-server-test-python/rest_json/rust-server-codegen-python/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   
                        )
          61  +
                    } /* JsonParserGenerator.kt:685 */
   43     62   
                }
          63  +
                /* JsonParserGenerator.kt:684 */
   44     64   
            }
   45         -
            }
          65  +
            /* JsonParserGenerator.kt:504 */
   46     66   
            Ok(Some(map))
          67  +
            /* JsonParserGenerator.kt:713 */
   47     68   
        }
   48         -
        _ => Err(
          69  +
        /* JsonParserGenerator.kt:722 */
          70  +
        _ => {
          71  +
            /* JsonParserGenerator.kt:723 */
          72  +
            Err(
   49     73   
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   50     74   
                    "expected start object or null",
   51     75   
                ),
   52         -
        ),
          76  +
            )
          77  +
            /* JsonParserGenerator.kt:722 */
          78  +
        } /* JsonParserGenerator.kt:712 */
   53     79   
    }
          80  +
    /* JsonParserGenerator.kt:460 */
   54     81   
}

tmp-codegen-diff/codegen-server-test-python/rest_json/rust-server-codegen-python/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   
                        )
          57  +
                    } /* JsonParserGenerator.kt:685 */
   42     58   
                }
          59  +
                /* JsonParserGenerator.kt:684 */
   43     60   
            }
   44         -
            }
          61  +
            /* JsonParserGenerator.kt:504 */
   45     62   
            Ok(Some(map))
          63  +
            /* JsonParserGenerator.kt:713 */
   46     64   
        }
   47         -
        _ => Err(
          65  +
        /* JsonParserGenerator.kt:722 */
          66  +
        _ => {
          67  +
            /* JsonParserGenerator.kt:723 */
          68  +
            Err(
   48     69   
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   49     70   
                    "expected start object or null",
   50     71   
                ),
   51         -
        ),
          72  +
            )
          73  +
            /* JsonParserGenerator.kt:722 */
          74  +
        } /* JsonParserGenerator.kt:712 */
   52     75   
    }
          76  +
    /* JsonParserGenerator.kt:460 */
   53     77   
}

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

@@ -1,1 +131,180 @@
    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_internal::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  +
                /* HttpBoundProtocolPayloadGenerator.kt:350 */
   63     85   
                crate::protocol_serde::shape_streaming_traits_output::ser_blob_http_payload(
   64     86   
                    output.blob,
   65         -
                )?,
          87  +
                )?, /* ServerHttpBoundProtocolGenerator.kt:543 */
   66     88   
            ),
   67     89   
        );
          90  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   68     91   
        builder.body(body)?
          92  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   69     93   
    })
          94  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   70     95   
}
   71     96   
          97  +
/* RustType.kt:516 */
   72     98   
#[allow(clippy::unnecessary_wraps)]
          99  +
/* ServerHttpBoundProtocolGenerator.kt:447 */
   73    100   
pub fn ser_streaming_traits_http_error(
   74    101   
    error: &crate::error::StreamingTraitsError,
   75    102   
) -> std::result::Result<
   76    103   
    ::aws_smithy_http_server::response::Response,
   77    104   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   78    105   
> {
         106  +
    /* ServerHttpBoundProtocolGenerator.kt:452 */
   79    107   
    Ok({
         108  +
        /* ServerHttpBoundProtocolGenerator.kt:468 */
   80    109   
        match error {
         110  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
   81    111   
            crate::error::StreamingTraitsError::InternalServerError(output) => {
         112  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
   82    113   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
         114  +
                /* RustType.kt:516 */
   83    115   
                #[allow(unused_mut)]
         116  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
   84    117   
                let mut builder = ::http::Response::builder();
         118  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   85    119   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   86    120   
                    builder,
   87    121   
                    ::http::header::CONTENT_TYPE,
   88    122   
                    "application/octet-stream",
   89    123   
                );
         124  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   90    125   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   91    126   
                    builder,
   92    127   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
   93    128   
                    "InternalServerError",
   94    129   
                );
         130  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
   95    131   
                let content_length = payload.len();
   96    132   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   97    133   
                    builder,
   98    134   
                    ::http::header::CONTENT_LENGTH,
   99    135   
                    content_length,
  100    136   
                );
         137  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  101    138   
                builder
  102    139   
                    .status(500)
  103    140   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         141  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
         142  +
            } /* ServerHttpBoundProtocolGenerator.kt:468 */
  104    143   
        }
  105         -
        }
         144  +
        /* ServerHttpBoundProtocolGenerator.kt:452 */
  106    145   
    })
         146  +
    /* ServerHttpBoundProtocolGenerator.kt:447 */
  107    147   
}
  108    148   
         149  +
/* HttpBindingGenerator.kt:542 */
  109    150   
pub fn ser_streaming_traits_headers(
  110    151   
    input: &crate::output::StreamingTraitsOutput,
  111    152   
    mut builder: ::http::response::Builder,
  112    153   
) -> std::result::Result<::http::response::Builder, ::aws_smithy_types::error::operation::BuildError>
  113    154   
{
         155  +
    /* HttpBindingGenerator.kt:592 */
  114    156   
    if let ::std::option::Option::Some(inner_1) = &input.foo {
         157  +
        /* HttpBindingGenerator.kt:704 */
  115    158   
        let formatted_2 = inner_1.as_str();
         159  +
        /* HttpBindingGenerator.kt:705 */
  116    160   
        if !formatted_2.is_empty() {
         161  +
            /* HttpBindingGenerator.kt:706 */
  117    162   
            let header_value = formatted_2;
  118    163   
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  119    164   
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
  120    165   
                    "foo",
  121    166   
                    format!(
  122    167   
                        "`{}` cannot be used as a header value: {}",
  123    168   
                        &header_value, err
  124    169   
                    ),
  125    170   
                )
  126    171   
            })?;
  127    172   
            builder = builder.header("X-Foo", header_value);
         173  +
            /* HttpBindingGenerator.kt:705 */
  128    174   
        }
         175  +
        /* HttpBindingGenerator.kt:592 */
  129    176   
    }
         177  +
    /* HttpBindingGenerator.kt:555 */
  130    178   
    Ok(builder)
         179  +
    /* HttpBindingGenerator.kt:542 */
  131    180   
}

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

@@ -1,1 +23,29 @@
    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_http_server_python::types::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_http_server_python::types::ByteStream::new(
   11     12   
        body,
   12     13   
    ))
          14  +
    /* HttpBindingGenerator.kt:230 */
   13     15   
}
   14     16   
          17  +
/* HttpBindingGenerator.kt:153 */
   15     18   
pub(crate) fn de_foo_header(
   16     19   
    header_map: &::aws_smithy_runtime_api::http::Headers,
   17     20   
) -> ::std::result::Result<
   18     21   
    ::std::option::Option<::std::string::String>,
   19     22   
    ::aws_smithy_http::header::ParseError,
   20     23   
> {
          24  +
    /* HttpBindingGenerator.kt:160 */
   21     25   
    let headers = header_map.get_all("X-Foo");
          26  +
    /* HttpBindingGenerator.kt:375 */
   22     27   
    ::aws_smithy_http::header::one_or_none(headers)
          28  +
    /* HttpBindingGenerator.kt:153 */
   23     29   
}

tmp-codegen-diff/codegen-server-test-python/rest_json/rust-server-codegen-python/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_http_server_python::types::ByteStream,
    4      5   
) -> ::std::result::Result<
    5      6   
    ::aws_smithy_http_server_python::types::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   
}

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

@@ -1,1 +104,146 @@
    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_require_length_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::StreamingTraitsRequireLengthInput,
    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 =
   19     24   
            crate::input::streaming_traits_require_length_input_internal::Builder::default();
          25  +
        /* RustType.kt:516 */
   20     26   
        #[allow(unused_variables)]
          27  +
        /* ServerHttpBoundProtocolGenerator.kt:728 */
   21     28   
        let ::aws_smithy_runtime_api::http::RequestParts {
   22     29   
            uri, headers, body, ..
   23     30   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          31  +
        /* ServerHttpBoundProtocolGenerator.kt:794 */
   24     32   
        if let Some(value) = {
   25     33   
            Some(crate::protocol_serde::shape_streaming_traits_require_length_input::de_blob_payload(&mut body.into().into_inner())?)
   26     34   
        } {
   27     35   
            input = input.set_blob(value)
   28     36   
        }
          37  +
        /* ServerHttpBoundProtocolGenerator.kt:794 */
   29     38   
        if let Some(value) =
   30     39   
            crate::protocol_serde::shape_streaming_traits_require_length_input::de_foo_header(
   31     40   
                &headers,
   32     41   
            )?
   33     42   
        {
   34     43   
            input = input.set_foo(Some(value))
   35     44   
        }
          45  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   36     46   
        input.build()
          47  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   37     48   
    })
          49  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   38     50   
}
   39     51   
          52  +
/* RustType.kt:516 */
   40     53   
#[allow(clippy::unnecessary_wraps)]
          54  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   41     55   
pub fn ser_streaming_traits_require_length_http_response(
   42     56   
    #[allow(unused_variables)] output: crate::output::StreamingTraitsRequireLengthOutput,
   43     57   
) -> std::result::Result<
   44     58   
    ::aws_smithy_http_server::response::Response,
   45     59   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   46     60   
> {
          61  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   47     62   
    Ok({
          63  +
        /* RustType.kt:516 */
   48     64   
        #[allow(unused_mut)]
          65  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   49     66   
        let mut builder = ::http::Response::builder();
          67  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   50     68   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   51     69   
            builder,
   52     70   
            ::http::header::CONTENT_TYPE,
   53     71   
            "application/json",
   54     72   
        );
          73  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   55     74   
        let http_status: u16 = 200;
   56     75   
        builder = builder.status(http_status);
   57         -
        let payload = "";
          76  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
          77  +
        let payload =
          78  +
            /* HttpBoundProtocolPayloadGenerator.kt:235 */""
          79  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
          80  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   58     81   
        let content_length = payload.len();
   59     82   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   60     83   
            builder,
   61     84   
            ::http::header::CONTENT_LENGTH,
   62     85   
            content_length,
   63     86   
        );
          87  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   64     88   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          89  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   65     90   
        builder.body(body)?
          91  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   66     92   
    })
          93  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   67     94   
}
   68     95   
          96  +
/* RustType.kt:516 */
   69     97   
#[allow(clippy::unnecessary_wraps)]
          98  +
/* ServerHttpBoundProtocolGenerator.kt:447 */
   70     99   
pub fn ser_streaming_traits_require_length_http_error(
   71    100   
    error: &crate::error::StreamingTraitsRequireLengthError,
   72    101   
) -> std::result::Result<
   73    102   
    ::aws_smithy_http_server::response::Response,
   74    103   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   75    104   
> {
         105  +
    /* ServerHttpBoundProtocolGenerator.kt:452 */
   76    106   
    Ok({
         107  +
        /* ServerHttpBoundProtocolGenerator.kt:468 */
   77    108   
        match error {
         109  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
   78    110   
            crate::error::StreamingTraitsRequireLengthError::InternalServerError(output) => {
         111  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
   79    112   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
         113  +
                /* RustType.kt:516 */
   80    114   
                #[allow(unused_mut)]
         115  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
   81    116   
                let mut builder = ::http::Response::builder();
         117  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   82    118   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   83    119   
                    builder,
   84    120   
                    ::http::header::CONTENT_TYPE,
   85    121   
                    "application/json",
   86    122   
                );
         123  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   87    124   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   88    125   
                    builder,
   89    126   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
   90    127   
                    "InternalServerError",
   91    128   
                );
         129  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
   92    130   
                let content_length = payload.len();
   93    131   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   94    132   
                    builder,
   95    133   
                    ::http::header::CONTENT_LENGTH,
   96    134   
                    content_length,
   97    135   
                );
         136  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
   98    137   
                builder
   99    138   
                    .status(500)
  100    139   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         140  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
         141  +
            } /* ServerHttpBoundProtocolGenerator.kt:468 */
  101    142   
        }
  102         -
        }
         143  +
        /* ServerHttpBoundProtocolGenerator.kt:452 */
  103    144   
    })
         145  +
    /* ServerHttpBoundProtocolGenerator.kt:447 */
  104    146   
}

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

@@ -1,1 +23,29 @@
    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_http_server_python::types::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_http_server_python::types::ByteStream::new(
   11     12   
        body,
   12     13   
    ))
          14  +
    /* HttpBindingGenerator.kt:230 */
   13     15   
}
   14     16   
          17  +
/* HttpBindingGenerator.kt:153 */
   15     18   
pub(crate) fn de_foo_header(
   16     19   
    header_map: &::aws_smithy_runtime_api::http::Headers,
   17     20   
) -> ::std::result::Result<
   18     21   
    ::std::option::Option<::std::string::String>,
   19     22   
    ::aws_smithy_http::header::ParseError,
   20     23   
> {
          24  +
    /* HttpBindingGenerator.kt:160 */
   21     25   
    let headers = header_map.get_all("X-Foo");
          26  +
    /* HttpBindingGenerator.kt:375 */
   22     27   
    ::aws_smithy_http::header::one_or_none(headers)
          28  +
    /* HttpBindingGenerator.kt:153 */
   23     29   
}

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

@@ -1,1 +124,172 @@
    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_with_media_type_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::StreamingTraitsWithMediaTypeInput,
    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 =
   19     24   
            crate::input::streaming_traits_with_media_type_input_internal::Builder::default();
          25  +
        /* RustType.kt:516 */
   20     26   
        #[allow(unused_variables)]
          27  +
        /* ServerHttpBoundProtocolGenerator.kt:728 */
   21     28   
        let ::aws_smithy_runtime_api::http::RequestParts {
   22     29   
            uri, headers, body, ..
   23     30   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          31  +
        /* ServerHttpBoundProtocolGenerator.kt:794 */
   24     32   
        if let Some(value) = {
   25     33   
            Some(crate::protocol_serde::shape_streaming_traits_with_media_type_input::de_blob_payload(&mut body.into().into_inner())?)
   26     34   
        } {
   27     35   
            input = input.set_blob(value)
   28     36   
        }
          37  +
        /* ServerHttpBoundProtocolGenerator.kt:794 */
   29     38   
        if let Some(value) =
   30     39   
            crate::protocol_serde::shape_streaming_traits_with_media_type_input::de_foo_header(
   31     40   
                &headers,
   32     41   
            )?
   33     42   
        {
   34     43   
            input = input.set_foo(Some(value))
   35     44   
        }
          45  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   36     46   
        input.build()
          47  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   37     48   
    })
          49  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   38     50   
}
   39     51   
          52  +
/* RustType.kt:516 */
   40     53   
#[allow(clippy::unnecessary_wraps)]
          54  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   41     55   
pub fn ser_streaming_traits_with_media_type_http_response(
   42     56   
    #[allow(unused_variables)] output: crate::output::StreamingTraitsWithMediaTypeOutput,
   43     57   
) -> std::result::Result<
   44     58   
    ::aws_smithy_http_server::response::Response,
   45     59   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   46     60   
> {
          61  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   47     62   
    Ok({
          63  +
        /* RustType.kt:516 */
   48     64   
        #[allow(unused_mut)]
          65  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   49     66   
        let mut builder = ::http::Response::builder();
          67  +
        /* ServerHttpBoundProtocolGenerator.kt:629 */
   50     68   
        builder = crate::protocol_serde::shape_streaming_traits_with_media_type::ser_streaming_traits_with_media_type_headers(&output, builder)?;
          69  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   51     70   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   52     71   
            builder,
   53     72   
            ::http::header::CONTENT_TYPE,
   54     73   
            "text/plain",
   55     74   
        );
          75  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   56     76   
        let http_status: u16 = 200;
   57     77   
        builder = builder.status(http_status);
          78  +
        /* ServerHttpBoundProtocolGenerator.kt:543 */
   58     79   
        let body = ::aws_smithy_http_server::body::boxed(::aws_smithy_http_server::body::Body::wrap_stream(
   59         -
            crate::protocol_serde::shape_streaming_traits_with_media_type_output::ser_blob_http_payload( output.blob)?
   60         -
        ));
          80  +
            /* HttpBoundProtocolPayloadGenerator.kt:350 */crate::protocol_serde::shape_streaming_traits_with_media_type_output::ser_blob_http_payload( output.blob)?
          81  +
        /* ServerHttpBoundProtocolGenerator.kt:543 */));
          82  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   61     83   
        builder.body(body)?
          84  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   62     85   
    })
          86  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   63     87   
}
   64     88   
          89  +
/* RustType.kt:516 */
   65     90   
#[allow(clippy::unnecessary_wraps)]
          91  +
/* ServerHttpBoundProtocolGenerator.kt:447 */
   66     92   
pub fn ser_streaming_traits_with_media_type_http_error(
   67     93   
    error: &crate::error::StreamingTraitsWithMediaTypeError,
   68     94   
) -> std::result::Result<
   69     95   
    ::aws_smithy_http_server::response::Response,
   70     96   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   71     97   
> {
          98  +
    /* ServerHttpBoundProtocolGenerator.kt:452 */
   72     99   
    Ok({
         100  +
        /* ServerHttpBoundProtocolGenerator.kt:468 */
   73    101   
        match error {
         102  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
   74    103   
            crate::error::StreamingTraitsWithMediaTypeError::InternalServerError(output) => {
         104  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
   75    105   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
         106  +
                /* RustType.kt:516 */
   76    107   
                #[allow(unused_mut)]
         108  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
   77    109   
                let mut builder = ::http::Response::builder();
         110  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   78    111   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   79    112   
                    builder,
   80    113   
                    ::http::header::CONTENT_TYPE,
   81    114   
                    "text/plain",
   82    115   
                );
         116  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   83    117   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   84    118   
                    builder,
   85    119   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
   86    120   
                    "InternalServerError",
   87    121   
                );
         122  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
   88    123   
                let content_length = payload.len();
   89    124   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   90    125   
                    builder,
   91    126   
                    ::http::header::CONTENT_LENGTH,
   92    127   
                    content_length,
   93    128   
                );
         129  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
   94    130   
                builder
   95    131   
                    .status(500)
   96    132   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         133  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
         134  +
            } /* ServerHttpBoundProtocolGenerator.kt:468 */
   97    135   
        }
   98         -
        }
         136  +
        /* ServerHttpBoundProtocolGenerator.kt:452 */
   99    137   
    })
         138  +
    /* ServerHttpBoundProtocolGenerator.kt:447 */
  100    139   
}
  101    140   
         141  +
/* HttpBindingGenerator.kt:542 */
  102    142   
pub fn ser_streaming_traits_with_media_type_headers(
  103    143   
    input: &crate::output::StreamingTraitsWithMediaTypeOutput,
  104    144   
    mut builder: ::http::response::Builder,
  105    145   
) -> std::result::Result<::http::response::Builder, ::aws_smithy_types::error::operation::BuildError>
  106    146   
{
         147  +
    /* HttpBindingGenerator.kt:592 */
  107    148   
    if let ::std::option::Option::Some(inner_1) = &input.foo {
         149  +
        /* HttpBindingGenerator.kt:704 */
  108    150   
        let formatted_2 = inner_1.as_str();
         151  +
        /* HttpBindingGenerator.kt:705 */
  109    152   
        if !formatted_2.is_empty() {
         153  +
            /* HttpBindingGenerator.kt:706 */
  110    154   
            let header_value = formatted_2;
  111    155   
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  112    156   
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
  113    157   
                    "foo",
  114    158   
                    format!(
  115    159   
                        "`{}` cannot be used as a header value: {}",
  116    160   
                        &header_value, err
  117    161   
                    ),
  118    162   
                )
  119    163   
            })?;
  120    164   
            builder = builder.header("X-Foo", header_value);
         165  +
            /* HttpBindingGenerator.kt:705 */
  121    166   
        }
         167  +
        /* HttpBindingGenerator.kt:592 */
  122    168   
    }
         169  +
    /* HttpBindingGenerator.kt:555 */
  123    170   
    Ok(builder)
         171  +
    /* HttpBindingGenerator.kt:542 */
  124    172   
}

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

@@ -1,1 +23,29 @@
    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_http_server_python::types::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_http_server_python::types::ByteStream::new(
   11     12   
        body,
   12     13   
    ))
          14  +
    /* HttpBindingGenerator.kt:230 */
   13     15   
}
   14     16   
          17  +
/* HttpBindingGenerator.kt:153 */
   15     18   
pub(crate) fn de_foo_header(
   16     19   
    header_map: &::aws_smithy_runtime_api::http::Headers,
   17     20   
) -> ::std::result::Result<
   18     21   
    ::std::option::Option<::std::string::String>,
   19     22   
    ::aws_smithy_http::header::ParseError,
   20     23   
> {
          24  +
    /* HttpBindingGenerator.kt:160 */
   21     25   
    let headers = header_map.get_all("X-Foo");
          26  +
    /* HttpBindingGenerator.kt:375 */
   22     27   
    ::aws_smithy_http::header::one_or_none(headers)
          28  +
    /* HttpBindingGenerator.kt:153 */
   23     29   
}

tmp-codegen-diff/codegen-server-test-python/rest_json/rust-server-codegen-python/src/protocol_serde/shape_streaming_traits_with_media_type_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_http_server_python::types::ByteStream,
    4      5   
) -> ::std::result::Result<
    5      6   
    ::aws_smithy_http_server_python::types::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   
}

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

@@ -1,1 +52,78 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:398 */
    2      3   
pub(crate) fn de_string_list<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<::std::vec::Vec<::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   
                    _ => {
   27         -
                        let value = ::aws_smithy_json::deserialize::token::expect_string_or_null(
   28         -
                            tokens.next(),
   29         -
                        )?
   30         -
                        .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   31         -
                        .transpose()?;
          37  +
                        /* JsonParserGenerator.kt:419 */
          38  +
                        let value =
          39  +
                            /* JsonParserGenerator.kt:354 */::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?.map(|s|
          40  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          41  +
                                    /* JsonParserGenerator.kt:348 */u.into_owned()
          42  +
                                /* JsonParserGenerator.kt:339 */)
          43  +
                            /* JsonParserGenerator.kt:354 */).transpose()?
          44  +
                        /* JsonParserGenerator.kt:419 */;
          45  +
                        /* JsonParserGenerator.kt:422 */
   32     46   
                        if let Some(value) = value {
   33     47   
                            items.push(value);
   34         -
                        } else {
          48  +
                        }
          49  +
                        /* JsonParserGenerator.kt:430 */
          50  +
                        else {
   35     51   
                            return Err(
   36     52   
                                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   37     53   
                                    "dense list cannot contain null values",
   38     54   
                                ),
   39     55   
                            );
   40     56   
                        }
          57  +
                        /* JsonParserGenerator.kt:413 */
          58  +
                    } /* JsonParserGenerator.kt:409 */
   41     59   
                }
          60  +
                /* JsonParserGenerator.kt:408 */
   42     61   
            }
   43         -
            }
          62  +
            /* JsonParserGenerator.kt:446 */
   44     63   
            Ok(Some(items))
          64  +
            /* JsonParserGenerator.kt:713 */
   45     65   
        }
   46         -
        _ => Err(
          66  +
        /* JsonParserGenerator.kt:722 */
          67  +
        _ => {
          68  +
            /* JsonParserGenerator.kt:723 */
          69  +
            Err(
   47     70   
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   48     71   
                    "expected start array or null",
   49     72   
                ),
   50         -
        ),
          73  +
            )
          74  +
            /* JsonParserGenerator.kt:722 */
          75  +
        } /* JsonParserGenerator.kt:712 */
   51     76   
    }
          77  +
    /* JsonParserGenerator.kt:398 */
   52     78   
}

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

@@ -1,1 +60,87 @@
    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_string_map<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<::std::collections::HashMap<::std::string::String, ::std::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::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_string_or_null(
   26         -
                            tokens.next(),
   27         -
                        )?
   28         -
                        .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   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:354 */::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?.map(|s|
          40  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          41  +
                                    /* JsonParserGenerator.kt:348 */u.into_owned()
          42  +
                                /* JsonParserGenerator.kt:339 */)
          43  +
                            /* JsonParserGenerator.kt:354 */).transpose()?
          44  +
                        /* JsonParserGenerator.kt:474 */;
          45  +
                        /* JsonParserGenerator.kt:481 */
   30     46   
                        match value {
   31     47   
                            Some(value) => {
   32     48   
                                map.insert(key, value);
   33     49   
                            }
   34     50   
                            None => {
   35     51   
                                return Err(
   36     52   
                                    ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   37     53   
                                        "dense map cannot contain null values",
   38     54   
                                    ),
   39     55   
                                )
   40     56   
                            }
   41     57   
                        }
          58  +
                        /* JsonParserGenerator.kt:686 */
   42     59   
                    }
          60  +
                    /* JsonParserGenerator.kt:695 */
   43     61   
                    other => {
   44     62   
                        return Err(
   45     63   
                            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   46     64   
                                format!("expected object key or end object, found: {:?}", other),
   47     65   
                            ),
   48     66   
                        )
          67  +
                    } /* JsonParserGenerator.kt:685 */
   49     68   
                }
          69  +
                /* JsonParserGenerator.kt:684 */
   50     70   
            }
   51         -
            }
          71  +
            /* JsonParserGenerator.kt:504 */
   52     72   
            Ok(Some(map))
          73  +
            /* JsonParserGenerator.kt:713 */
   53     74   
        }
   54         -
        _ => Err(
          75  +
        /* JsonParserGenerator.kt:722 */
          76  +
        _ => {
          77  +
            /* JsonParserGenerator.kt:723 */
          78  +
            Err(
   55     79   
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   56     80   
                    "expected start object or null",
   57     81   
                ),
   58         -
        ),
          82  +
            )
          83  +
            /* JsonParserGenerator.kt:722 */
          84  +
        } /* JsonParserGenerator.kt:712 */
   59     85   
    }
          86  +
    /* JsonParserGenerator.kt:460 */
   60     87   
}

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

@@ -1,1 +54,80 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:398 */
    2      3   
pub(crate) fn de_string_set<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<crate::unconstrained::string_set_unconstrained::StringSetUnconstrained>,
    6      7   
    ::aws_smithy_json::deserialize::error::DeserializeError,
    7      8   
>
    8      9   
where
    9     10   
    I: Iterator<
   10     11   
        Item = Result<
   11     12   
            ::aws_smithy_json::deserialize::Token<'a>,
   12     13   
            ::aws_smithy_json::deserialize::error::DeserializeError,
   13     14   
        >,
   14     15   
    >,
   15     16   
{
          17  +
    /* JsonParserGenerator.kt:712 */
   16     18   
    match tokens.next().transpose()? {
          19  +
        /* JsonParserGenerator.kt:713 */
   17     20   
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   18     21   
        Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => {
          22  +
            /* JsonParserGenerator.kt:407 */
   19     23   
            let mut items = Vec::new();
          24  +
            /* JsonParserGenerator.kt:408 */
   20     25   
            loop {
          26  +
                /* JsonParserGenerator.kt:409 */
   21     27   
                match tokens.peek() {
          28  +
                    /* JsonParserGenerator.kt:410 */
   22     29   
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
          30  +
                        /* JsonParserGenerator.kt:411 */
   23     31   
                        tokens.next().transpose().unwrap();
   24     32   
                        break;
          33  +
                        /* JsonParserGenerator.kt:410 */
   25     34   
                    }
          35  +
                    /* JsonParserGenerator.kt:413 */
   26     36   
                    _ => {
   27         -
                        let value = ::aws_smithy_json::deserialize::token::expect_string_or_null(
   28         -
                            tokens.next(),
   29         -
                        )?
   30         -
                        .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   31         -
                        .transpose()?;
          37  +
                        /* JsonParserGenerator.kt:419 */
          38  +
                        let value =
          39  +
                            /* JsonParserGenerator.kt:354 */::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?.map(|s|
          40  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          41  +
                                    /* JsonParserGenerator.kt:348 */u.into_owned()
          42  +
                                /* JsonParserGenerator.kt:339 */)
          43  +
                            /* JsonParserGenerator.kt:354 */).transpose()?
          44  +
                        /* JsonParserGenerator.kt:419 */;
          45  +
                        /* JsonParserGenerator.kt:422 */
   32     46   
                        if let Some(value) = value {
   33     47   
                            items.push(value);
   34         -
                        } else {
          48  +
                        }
          49  +
                        /* JsonParserGenerator.kt:430 */
          50  +
                        else {
   35     51   
                            return Err(
   36     52   
                                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   37     53   
                                    "dense list cannot contain null values",
   38     54   
                                ),
   39     55   
                            );
   40     56   
                        }
          57  +
                        /* JsonParserGenerator.kt:413 */
          58  +
                    } /* JsonParserGenerator.kt:409 */
   41     59   
                }
          60  +
                /* JsonParserGenerator.kt:408 */
   42     61   
            }
   43         -
            }
          62  +
            /* JsonParserGenerator.kt:444 */
   44     63   
            Ok(Some(
   45     64   
                crate::unconstrained::string_set_unconstrained::StringSetUnconstrained(items),
   46     65   
            ))
          66  +
            /* JsonParserGenerator.kt:713 */
   47     67   
        }
   48         -
        _ => Err(
          68  +
        /* JsonParserGenerator.kt:722 */
          69  +
        _ => {
          70  +
            /* JsonParserGenerator.kt:723 */
          71  +
            Err(
   49     72   
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   50     73   
                    "expected start array or null",
   51     74   
                ),
   52         -
        ),
          75  +
            )
          76  +
            /* JsonParserGenerator.kt:722 */
          77  +
        } /* JsonParserGenerator.kt:712 */
   53     78   
    }
          79  +
    /* JsonParserGenerator.kt:398 */
   54     80   
}

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

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

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

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