Server Test

Server Test

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943 (ignoring whitespace)

Files changed:

tmp-codegen-diff/codegen-server-test/pokemon-service-awsjson-server-sdk/rust-server-codegen/src/protocol_serde.rs

@@ -1,1 +36,37 @@
   16     16   
pub(crate) mod shape_invalid_pokeball_error;
   17     17   
   18     18   
pub(crate) mod shape_master_ball_unsuccessful;
   19     19   
   20     20   
pub(crate) mod shape_throttling_error;
   21     21   
   22     22   
pub(crate) mod shape_unsupported_region_error;
   23     23   
   24     24   
pub(crate) mod shape_validation_exception;
   25     25   
          26  +
/* JsonParserGenerator.kt:227 */
   26     27   
pub(crate) fn or_empty_doc(data: &[u8]) -> &[u8] {
   27     28   
    if data.is_empty() {
   28     29   
        b"{}"
   29     30   
    } else {
   30     31   
        data
   31     32   
    }
   32     33   
}
   33     34   
   34     35   
pub(crate) mod shape_capturing_payload;
   35     36   

tmp-codegen-diff/codegen-server-test/pokemon-service-awsjson-server-sdk/rust-server-codegen/src/protocol_serde/shape_capture_pokemon.rs

@@ -1,1 +178,251 @@
    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_capture_pokemon_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::CapturePokemonInput,
    7      9   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection,
    8     10   
>
    9     11   
where
   10     12   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11     13   
    B: Into<::aws_smithy_types::byte_stream::ByteStream>,
   12     14   
    B::Data: Send,
   13     15   
    ::aws_smithy_http_server::protocol::aws_json::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::capture_pokemon_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_capture_pokemon_input::de_events_payload(
   26     34   
                    &mut body.into().into_inner(),
   27     35   
                )?,
   28     36   
            )
   29     37   
        } {
   30     38   
            input = input.set_events(value)
   31     39   
        }
          40  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   32     41   
        input.build()?
          42  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   33     43   
    })
          44  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   34     45   
}
   35     46   
          47  +
/* RustType.kt:516 */
   36     48   
#[allow(clippy::unnecessary_wraps)]
          49  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   37     50   
pub fn ser_capture_pokemon_http_response(
   38     51   
    #[allow(unused_variables)] output: crate::output::CapturePokemonOutput,
   39     52   
) -> std::result::Result<
   40     53   
    ::aws_smithy_http_server::response::Response,
   41     54   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   42     55   
> {
          56  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   43     57   
    Ok({
          58  +
        /* RustType.kt:516 */
   44     59   
        #[allow(unused_mut)]
          60  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   45     61   
        let mut builder = ::http::Response::builder();
          62  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   46     63   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   47     64   
            builder,
   48     65   
            ::http::header::CONTENT_TYPE,
   49     66   
            "application/x-amz-json-1.0",
   50     67   
        );
          68  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   51     69   
        let http_status: u16 = 200;
   52     70   
        builder = builder.status(http_status);
          71  +
        /* ServerHttpBoundProtocolGenerator.kt:543 */
   53     72   
        let body = ::aws_smithy_http_server::body::boxed(
   54         -
            ::aws_smithy_http_server::body::Body::wrap_stream({
          73  +
            ::aws_smithy_http_server::body::Body::wrap_stream(
          74  +
                /* ServerHttpBoundProtocolGenerator.kt:135 */
          75  +
                {
   55     76   
                    let error_marshaller =
   56     77   
                        crate::event_stream_serde::CapturePokemonEventsErrorMarshaller::new();
   57         -
                let marshaller = crate::event_stream_serde::CapturePokemonEventsMarshaller::new();
          78  +
                    let marshaller =
          79  +
                        crate::event_stream_serde::CapturePokemonEventsMarshaller::new();
   58     80   
                    let signer = ::aws_smithy_eventstream::frame::NoOpSigner {};
   59         -
                let adapter: ::aws_smithy_http::event_stream::MessageStreamAdapter<_, _> = output
          81  +
                    let adapter: ::aws_smithy_http::event_stream::MessageStreamAdapter<_, _> =
          82  +
                        output
   60     83   
                            .events
   61     84   
                            .into_body_stream(marshaller, error_marshaller, signer);
   62     85   
                    adapter
   63         -
            }),
          86  +
                }, /* ServerHttpBoundProtocolGenerator.kt:543 */
          87  +
            ),
   64     88   
        );
          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_capture_pokemon_http_error(
   71    100   
    error: &crate::error::CapturePokemonError,
   72    101   
) -> std::result::Result<
   73    102   
    ::aws_smithy_http_server::response::Response,
   74    103   
    ::aws_smithy_http_server::protocol::aws_json::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::CapturePokemonError::ValidationException(output) => {
         111  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
   79    112   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_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/x-amz-json-1.0",
   86    122   
                );
         123  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
   87    124   
                let content_length = payload.len();
   88    125   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   89    126   
                    builder,
   90    127   
                    ::http::header::CONTENT_LENGTH,
   91    128   
                    content_length,
   92    129   
                );
         130  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
   93    131   
                builder
   94    132   
                    .status(400)
   95    133   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         134  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
   96    135   
            }
         136  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
   97    137   
            crate::error::CapturePokemonError::MasterBallUnsuccessful(output) => {
         138  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
   98    139   
                let payload = crate::protocol_serde::shape_master_ball_unsuccessful::ser_master_ball_unsuccessful_error(output)?;
         140  +
                /* RustType.kt:516 */
   99    141   
                #[allow(unused_mut)]
         142  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
  100    143   
                let mut builder = ::http::Response::builder();
         144  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  101    145   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  102    146   
                    builder,
  103    147   
                    ::http::header::CONTENT_TYPE,
  104    148   
                    "application/x-amz-json-1.0",
  105    149   
                );
         150  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  106    151   
                let content_length = payload.len();
  107    152   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  108    153   
                    builder,
  109    154   
                    ::http::header::CONTENT_LENGTH,
  110    155   
                    content_length,
  111    156   
                );
         157  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  112    158   
                builder
  113    159   
                    .status(500)
  114    160   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         161  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
  115    162   
            }
         163  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
  116    164   
            crate::error::CapturePokemonError::InvalidPokeballError(output) => {
         165  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
  117    166   
                let payload = crate::protocol_serde::shape_invalid_pokeball_error::ser_invalid_pokeball_error_error(output)?;
         167  +
                /* RustType.kt:516 */
  118    168   
                #[allow(unused_mut)]
         169  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
  119    170   
                let mut builder = ::http::Response::builder();
         171  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  120    172   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  121    173   
                    builder,
  122    174   
                    ::http::header::CONTENT_TYPE,
  123    175   
                    "application/x-amz-json-1.0",
  124    176   
                );
         177  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  125    178   
                let content_length = payload.len();
  126    179   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  127    180   
                    builder,
  128    181   
                    ::http::header::CONTENT_LENGTH,
  129    182   
                    content_length,
  130    183   
                );
         184  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  131    185   
                builder
  132    186   
                    .status(400)
  133    187   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         188  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
  134    189   
            }
         190  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
  135    191   
            crate::error::CapturePokemonError::ThrottlingError(output) => {
         192  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
  136    193   
                let payload =
  137    194   
                    crate::protocol_serde::shape_throttling_error::ser_throttling_error_error(
  138    195   
                        output,
  139    196   
                    )?;
         197  +
                /* RustType.kt:516 */
  140    198   
                #[allow(unused_mut)]
         199  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
  141    200   
                let mut builder = ::http::Response::builder();
         201  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  142    202   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  143    203   
                    builder,
  144    204   
                    ::http::header::CONTENT_TYPE,
  145    205   
                    "application/x-amz-json-1.0",
  146    206   
                );
         207  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  147    208   
                let content_length = payload.len();
  148    209   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  149    210   
                    builder,
  150    211   
                    ::http::header::CONTENT_LENGTH,
  151    212   
                    content_length,
  152    213   
                );
         214  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  153    215   
                builder
  154    216   
                    .status(400)
  155    217   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         218  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
  156    219   
            }
         220  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
  157    221   
            crate::error::CapturePokemonError::UnsupportedRegionError(output) => {
         222  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
  158    223   
                let payload = crate::protocol_serde::shape_unsupported_region_error::ser_unsupported_region_error_error(output)?;
         224  +
                /* RustType.kt:516 */
  159    225   
                #[allow(unused_mut)]
         226  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
  160    227   
                let mut builder = ::http::Response::builder();
         228  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  161    229   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  162    230   
                    builder,
  163    231   
                    ::http::header::CONTENT_TYPE,
  164    232   
                    "application/x-amz-json-1.0",
  165    233   
                );
         234  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  166    235   
                let content_length = payload.len();
  167    236   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  168    237   
                    builder,
  169    238   
                    ::http::header::CONTENT_LENGTH,
  170    239   
                    content_length,
  171    240   
                );
         241  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  172    242   
                builder
  173    243   
                    .status(500)
  174    244   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         245  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
         246  +
            } /* ServerHttpBoundProtocolGenerator.kt:468 */
  175    247   
        }
  176         -
        }
         248  +
        /* ServerHttpBoundProtocolGenerator.kt:452 */
  177    249   
    })
         250  +
    /* ServerHttpBoundProtocolGenerator.kt:447 */
  178    251   
}

tmp-codegen-diff/codegen-server-test/pokemon-service-awsjson-server-sdk/rust-server-codegen/src/protocol_serde/shape_capture_pokemon_input.rs

@@ -1,1 +17,20 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* HttpBindingGenerator.kt:230 */
    2      3   
pub fn de_events_payload(
    3      4   
    body: &mut ::aws_smithy_types::body::SdkBody,
    4      5   
) -> std::result::Result<
    5      6   
    ::aws_smithy_http::event_stream::Receiver<
    6      7   
        crate::model::AttemptCapturingPokemonEvent,
    7      8   
        crate::error::AttemptCapturingPokemonEventError,
    8      9   
    >,
    9     10   
    ::aws_smithy_json::deserialize::error::DeserializeError,
   10     11   
> {
          12  +
    /* HttpBindingGenerator.kt:272 */
   11     13   
    let unmarshaller = crate::event_stream_serde::AttemptCapturingPokemonEventUnmarshaller::new();
   12     14   
    let body = std::mem::replace(body, ::aws_smithy_types::body::SdkBody::taken());
   13     15   
    Ok(::aws_smithy_http::event_stream::Receiver::new(
   14     16   
        unmarshaller,
   15     17   
        body,
   16     18   
    ))
          19  +
    /* HttpBindingGenerator.kt:230 */
   17     20   
}

tmp-codegen-diff/codegen-server-test/pokemon-service-awsjson-server-sdk/rust-server-codegen/src/protocol_serde/shape_capturing_payload.rs

@@ -1,1 +90,122 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:175 */
    2      3   
pub(crate) fn de_capturing_payload_payload(
    3      4   
    input: &[u8],
    4      5   
) -> ::std::result::Result<
    5      6   
    crate::model::CapturingPayload,
    6      7   
    ::aws_smithy_json::deserialize::error::DeserializeError,
    7      8   
> {
           9  +
    /* JsonParserGenerator.kt:187 */
    8     10   
    let mut tokens_owned =
    9     11   
        ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(input))
   10     12   
            .peekable();
   11     13   
    let tokens = &mut tokens_owned;
   12         -
    let result = crate::protocol_serde::shape_capturing_payload::de_capturing_payload(tokens)?
   13         -
        .ok_or_else(|| {
   14         -
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   15         -
                "expected payload member value",
   16         -
            )
   17         -
        });
          14  +
    /* JsonParserGenerator.kt:194 */
          15  +
    let result =
          16  +
    /* JsonParserGenerator.kt:544 */crate::protocol_serde::shape_capturing_payload::de_capturing_payload(tokens)?
          17  +
    /* JsonParserGenerator.kt:196 */.ok_or_else(|| ::aws_smithy_json::deserialize::error::DeserializeError::custom("expected payload member value"));
          18  +
    /* JsonParserGenerator.kt:250 */
   18     19   
    if tokens.next().is_some() {
          20  +
        /* JsonParserGenerator.kt:251 */
   19     21   
        return Err(
   20     22   
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   21     23   
                "found more JSON tokens after completing parsing",
   22     24   
            ),
   23     25   
        );
          26  +
        /* JsonParserGenerator.kt:250 */
   24     27   
    }
          28  +
    /* JsonParserGenerator.kt:198 */
   25     29   
    result
          30  +
    /* JsonParserGenerator.kt:175 */
   26     31   
}
   27     32   
          33  +
/* JsonParserGenerator.kt:516 */
   28     34   
pub(crate) fn de_capturing_payload<'a, I>(
   29     35   
    tokens: &mut ::std::iter::Peekable<I>,
   30     36   
) -> ::std::result::Result<
   31     37   
    Option<crate::model::CapturingPayload>,
   32     38   
    ::aws_smithy_json::deserialize::error::DeserializeError,
   33     39   
>
   34     40   
where
   35     41   
    I: Iterator<
   36     42   
        Item = Result<
   37     43   
            ::aws_smithy_json::deserialize::Token<'a>,
   38     44   
            ::aws_smithy_json::deserialize::error::DeserializeError,
   39     45   
        >,
   40     46   
    >,
   41     47   
{
          48  +
    /* JsonParserGenerator.kt:712 */
   42     49   
    match tokens.next().transpose()? {
          50  +
        /* JsonParserGenerator.kt:713 */
   43     51   
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   44     52   
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
          53  +
            /* RustType.kt:516 */
   45     54   
            #[allow(unused_mut)]
          55  +
            /* JsonParserGenerator.kt:526 */
   46     56   
            let mut builder = crate::model::capturing_payload::Builder::default();
          57  +
            /* JsonParserGenerator.kt:684 */
   47     58   
            loop {
          59  +
                /* JsonParserGenerator.kt:685 */
   48     60   
                match tokens.next().transpose()? {
          61  +
                    /* JsonParserGenerator.kt:686 */
   49     62   
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   50     63   
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
          64  +
                        /* JsonParserGenerator.kt:260 */
   51     65   
                        match key.to_unescaped()?.as_ref() {
          66  +
                            /* JsonParserGenerator.kt:262 */
   52     67   
                            "name" => {
          68  +
                                /* JsonParserGenerator.kt:272 */
   53     69   
                                builder = builder.set_name(
   54         -
                                    ::aws_smithy_json::deserialize::token::expect_string_or_null(
   55         -
                                        tokens.next(),
   56         -
                                    )?
   57         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   58         -
                                    .transpose()?,
   59         -
                                );
          70  +
                                    /* JsonParserGenerator.kt:354 */::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?.map(|s|
          71  +
                                        /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          72  +
                                            /* JsonParserGenerator.kt:348 */u.into_owned()
          73  +
                                        /* JsonParserGenerator.kt:339 */)
          74  +
                                    /* JsonParserGenerator.kt:354 */).transpose()?
          75  +
                                /* JsonParserGenerator.kt:272 */);
          76  +
                                /* JsonParserGenerator.kt:262 */
   60     77   
                            }
          78  +
                            /* JsonParserGenerator.kt:262 */
   61     79   
                            "pokeball" => {
          80  +
                                /* JsonParserGenerator.kt:272 */
   62     81   
                                builder = builder.set_pokeball(
   63         -
                                    ::aws_smithy_json::deserialize::token::expect_string_or_null(
   64         -
                                        tokens.next(),
   65         -
                                    )?
   66         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   67         -
                                    .transpose()?,
   68         -
                                );
          82  +
                                    /* JsonParserGenerator.kt:354 */::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?.map(|s|
          83  +
                                        /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          84  +
                                            /* JsonParserGenerator.kt:348 */u.into_owned()
          85  +
                                        /* JsonParserGenerator.kt:339 */)
          86  +
                                    /* JsonParserGenerator.kt:354 */).transpose()?
          87  +
                                /* JsonParserGenerator.kt:272 */);
          88  +
                                /* JsonParserGenerator.kt:262 */
   69     89   
                            }
   70         -
                            _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
          90  +
                            /* JsonParserGenerator.kt:290 */
          91  +
                            _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
   71     92   
                        }
          93  +
                        /* JsonParserGenerator.kt:686 */
   72     94   
                    }
          95  +
                    /* JsonParserGenerator.kt:695 */
   73     96   
                    other => {
   74     97   
                        return Err(
   75     98   
                            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   76     99   
                                format!("expected object key or end object, found: {:?}", other),
   77    100   
                            ),
   78    101   
                        )
         102  +
                    } /* JsonParserGenerator.kt:685 */
   79    103   
                }
         104  +
                /* JsonParserGenerator.kt:684 */
   80    105   
            }
   81         -
            }
         106  +
            /* JsonParserGenerator.kt:540 */
   82    107   
            Ok(Some(builder.build()))
         108  +
            /* JsonParserGenerator.kt:713 */
   83    109   
        }
   84         -
        _ => Err(
         110  +
        /* JsonParserGenerator.kt:722 */
         111  +
        _ => {
         112  +
            /* JsonParserGenerator.kt:723 */
         113  +
            Err(
   85    114   
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   86    115   
                    "expected start object or null",
   87    116   
                ),
   88         -
        ),
         117  +
            )
         118  +
            /* JsonParserGenerator.kt:722 */
         119  +
        } /* JsonParserGenerator.kt:712 */
   89    120   
    }
         121  +
    /* JsonParserGenerator.kt:516 */
   90    122   
}

tmp-codegen-diff/codegen-server-test/pokemon-service-awsjson-server-sdk/rust-server-codegen/src/protocol_serde/shape_check_health.rs

@@ -1,1 +53,78 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:516 */
    2      3   
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ServerHttpBoundProtocolGenerator.kt:383 */
    3      5   
pub async fn de_check_health_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::CheckHealthInput,
    7      9   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection,
    8     10   
>
    9     11   
where
   10     12   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11     13   
    B::Data: Send,
   12     14   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection:
   13     15   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     16   
{
          17  +
    /* ServerHttpBoundProtocolGenerator.kt:399 */
   15     18   
    Ok({
          19  +
        /* RustType.kt:516 */
   16     20   
        #[allow(unused_mut)]
          21  +
        /* ServerHttpBoundProtocolGenerator.kt:723 */
   17     22   
        let mut input = crate::input::check_health_input::Builder::default();
          23  +
        /* RustType.kt:516 */
   18     24   
        #[allow(unused_variables)]
          25  +
        /* ServerHttpBoundProtocolGenerator.kt:728 */
   19     26   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     27   
            uri, headers, body, ..
   21     28   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          29  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   22     30   
        input.build()
          31  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   23     32   
    })
          33  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   24     34   
}
   25     35   
          36  +
/* RustType.kt:516 */
   26     37   
#[allow(clippy::unnecessary_wraps)]
          38  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   27     39   
pub fn ser_check_health_http_response(
   28     40   
    #[allow(unused_variables)] output: crate::output::CheckHealthOutput,
   29     41   
) -> std::result::Result<
   30     42   
    ::aws_smithy_http_server::response::Response,
   31     43   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   32     44   
> {
          45  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   33     46   
    Ok({
          47  +
        /* RustType.kt:516 */
   34     48   
        #[allow(unused_mut)]
          49  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   35     50   
        let mut builder = ::http::Response::builder();
          51  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   36     52   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   37     53   
            builder,
   38     54   
            ::http::header::CONTENT_TYPE,
   39     55   
            "application/x-amz-json-1.0",
   40     56   
        );
          57  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   41     58   
        let http_status: u16 = 200;
   42     59   
        builder = builder.status(http_status);
   43         -
        let payload = "";
          60  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
          61  +
        let payload =
          62  +
            /* HttpBoundProtocolPayloadGenerator.kt:235 */""
          63  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
          64  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   44     65   
        let content_length = payload.len();
   45     66   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   46     67   
            builder,
   47     68   
            ::http::header::CONTENT_LENGTH,
   48     69   
            content_length,
   49     70   
        );
          71  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   50     72   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          73  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   51     74   
        builder.body(body)?
          75  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   52     76   
    })
          77  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   53     78   
}

tmp-codegen-diff/codegen-server-test/pokemon-service-awsjson-server-sdk/rust-server-codegen/src/protocol_serde/shape_do_nothing.rs

@@ -1,1 +56,78 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:516 */
    2      3   
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ServerHttpBoundProtocolGenerator.kt:383 */
    3      5   
pub async fn de_do_nothing_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::DoNothingInput,
    7      9   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection,
    8     10   
>
    9     11   
where
   10     12   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11     13   
    B::Data: Send,
   12     14   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection:
   13     15   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     16   
{
          17  +
    /* ServerHttpBoundProtocolGenerator.kt:399 */
   15     18   
    Ok({
          19  +
        /* RustType.kt:516 */
   16     20   
        #[allow(unused_mut)]
          21  +
        /* ServerHttpBoundProtocolGenerator.kt:723 */
   17     22   
        let mut input = crate::input::do_nothing_input::Builder::default();
          23  +
        /* RustType.kt:516 */
   18     24   
        #[allow(unused_variables)]
          25  +
        /* ServerHttpBoundProtocolGenerator.kt:728 */
   19     26   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     27   
            uri, headers, body, ..
   21     28   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          29  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   22     30   
        input.build()
          31  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   23     32   
    })
          33  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   24     34   
}
   25     35   
          36  +
/* RustType.kt:516 */
   26     37   
#[allow(clippy::unnecessary_wraps)]
          38  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   27     39   
pub fn ser_do_nothing_http_response(
   28     40   
    #[allow(unused_variables)] output: crate::output::DoNothingOutput,
   29     41   
) -> std::result::Result<
   30     42   
    ::aws_smithy_http_server::response::Response,
   31     43   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   32     44   
> {
          45  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   33     46   
    Ok({
          47  +
        /* RustType.kt:516 */
   34     48   
        #[allow(unused_mut)]
          49  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   35     50   
        let mut builder = ::http::Response::builder();
          51  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   36     52   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   37     53   
            builder,
   38     54   
            ::http::header::CONTENT_TYPE,
   39     55   
            "application/x-amz-json-1.0",
   40     56   
        );
          57  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   41     58   
        let http_status: u16 = 200;
   42     59   
        builder = builder.status(http_status);
          60  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
   43     61   
        let payload =
   44         -
            crate::protocol_serde::shape_do_nothing_output::ser_do_nothing_output_output_output(
   45         -
                &output,
   46         -
            )?;
          62  +
            /* HttpBoundProtocolPayloadGenerator.kt:237 */crate::protocol_serde::shape_do_nothing_output::ser_do_nothing_output_output_output(&output)?
          63  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
          64  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   47     65   
        let content_length = payload.len();
   48     66   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   49     67   
            builder,
   50     68   
            ::http::header::CONTENT_LENGTH,
   51     69   
            content_length,
   52     70   
        );
          71  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   53     72   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          73  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   54     74   
        builder.body(body)?
          75  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   55     76   
    })
          77  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   56     78   
}

tmp-codegen-diff/codegen-server-test/pokemon-service-awsjson-server-sdk/rust-server-codegen/src/protocol_serde/shape_do_nothing_output.rs

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

tmp-codegen-diff/codegen-server-test/pokemon-service-awsjson-server-sdk/rust-server-codegen/src/protocol_serde/shape_get_server_statistics.rs

@@ -1,1 +55,78 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:516 */
    2      3   
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ServerHttpBoundProtocolGenerator.kt:383 */
    3      5   
pub async fn de_get_server_statistics_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::GetServerStatisticsInput,
    7      9   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection,
    8     10   
>
    9     11   
where
   10     12   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11     13   
    B::Data: Send,
   12     14   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection:
   13     15   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     16   
{
          17  +
    /* ServerHttpBoundProtocolGenerator.kt:399 */
   15     18   
    Ok({
          19  +
        /* RustType.kt:516 */
   16     20   
        #[allow(unused_mut)]
          21  +
        /* ServerHttpBoundProtocolGenerator.kt:723 */
   17     22   
        let mut input = crate::input::get_server_statistics_input::Builder::default();
          23  +
        /* RustType.kt:516 */
   18     24   
        #[allow(unused_variables)]
          25  +
        /* ServerHttpBoundProtocolGenerator.kt:728 */
   19     26   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     27   
            uri, headers, body, ..
   21     28   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          29  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   22     30   
        input.build()
          31  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   23     32   
    })
          33  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   24     34   
}
   25     35   
          36  +
/* RustType.kt:516 */
   26     37   
#[allow(clippy::unnecessary_wraps)]
          38  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   27     39   
pub fn ser_get_server_statistics_http_response(
   28     40   
    #[allow(unused_variables)] output: crate::output::GetServerStatisticsOutput,
   29     41   
) -> std::result::Result<
   30     42   
    ::aws_smithy_http_server::response::Response,
   31     43   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   32     44   
> {
          45  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   33     46   
    Ok({
          47  +
        /* RustType.kt:516 */
   34     48   
        #[allow(unused_mut)]
          49  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   35     50   
        let mut builder = ::http::Response::builder();
          51  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   36     52   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   37     53   
            builder,
   38     54   
            ::http::header::CONTENT_TYPE,
   39     55   
            "application/x-amz-json-1.0",
   40     56   
        );
          57  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   41     58   
        let http_status: u16 = 200;
   42     59   
        builder = builder.status(http_status);
          60  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
   43     61   
        let payload =
   44         -
            crate::protocol_serde::shape_get_server_statistics_output::ser_get_server_statistics_output_output_output(&output)?
   45         -
        ;
          62  +
            /* HttpBoundProtocolPayloadGenerator.kt:237 */crate::protocol_serde::shape_get_server_statistics_output::ser_get_server_statistics_output_output_output(&output)?
          63  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
          64  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   46     65   
        let content_length = payload.len();
   47     66   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   48     67   
            builder,
   49     68   
            ::http::header::CONTENT_LENGTH,
   50     69   
            content_length,
   51     70   
        );
          71  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   52     72   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          73  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   53     74   
        builder.body(body)?
          75  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   54     76   
    })
          77  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   55     78   
}

tmp-codegen-diff/codegen-server-test/pokemon-service-awsjson-server-sdk/rust-server-codegen/src/protocol_serde/shape_get_server_statistics_output.rs

@@ -1,1 +23,34 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
    2      3   
pub fn ser_get_server_statistics_output_output_output(
    3      4   
    value: &crate::output::GetServerStatisticsOutput,
    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_get_server_statistics_output::ser_get_server_statistics_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_get_server_statistics_output_output(
   13     19   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   14     20   
    input: &crate::output::GetServerStatisticsOutput,
   15     21   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          22  +
    /* SerializerUtil.kt:42 */
   16     23   
    {
          24  +
        /* JsonSerializerGenerator.kt:432 */
   17     25   
        object.key("calls_count").number(
   18     26   
            #[allow(clippy::useless_conversion)]
   19     27   
            ::aws_smithy_types::Number::NegInt((input.calls_count).into()),
   20     28   
        );
          29  +
        /* SerializerUtil.kt:42 */
   21     30   
    }
          31  +
    /* JsonSerializerGenerator.kt:372 */
   22     32   
    Ok(())
          33  +
    /* JsonSerializerGenerator.kt:358 */
   23     34   
}

tmp-codegen-diff/codegen-server-test/pokemon-service-awsjson-server-sdk/rust-server-codegen/src/protocol_serde/shape_invalid_pokeball_error.rs

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

tmp-codegen-diff/codegen-server-test/pokemon-service-awsjson-server-sdk/rust-server-codegen/src/protocol_serde/shape_master_ball_unsuccessful.rs

@@ -1,1 +75,109 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
    2      3   
pub fn ser_master_ball_unsuccessful_error(
    3      4   
    value: &crate::error::MasterBallUnsuccessful,
    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_master_ball_unsuccessful::ser_master_ball_unsuccessful(
    8     11   
        &mut object,
    9     12   
        value,
   10     13   
    )?;
          14  +
    /* ServerAwsJson.kt:95 */
   11     15   
    object
   12     16   
        .key("__type")
   13     17   
        .string("com.aws.example#MasterBallUnsuccessful");
          18  +
    /* JsonSerializerGenerator.kt:227 */
   14     19   
    object.finish();
   15     20   
    Ok(out)
          21  +
    /* JsonSerializerGenerator.kt:213 */
   16     22   
}
   17     23   
          24  +
/* JsonSerializerGenerator.kt:358 */
   18     25   
pub fn ser_master_ball_unsuccessful(
   19     26   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   20     27   
    input: &crate::error::MasterBallUnsuccessful,
   21     28   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          29  +
    /* JsonSerializerGenerator.kt:382 */
   22     30   
    if let Some(var_1) = &input.message {
          31  +
        /* JsonSerializerGenerator.kt:423 */
   23     32   
        object.key("message").string(var_1.as_str());
          33  +
        /* JsonSerializerGenerator.kt:382 */
   24     34   
    }
          35  +
    /* JsonSerializerGenerator.kt:372 */
   25     36   
    Ok(())
          37  +
    /* JsonSerializerGenerator.kt:358 */
   26     38   
}
   27     39   
          40  +
/* JsonParserGenerator.kt:148 */
   28     41   
pub(crate) fn de_master_ball_unsuccessful_json_err(
   29     42   
    value: &[u8],
   30     43   
    mut builder: crate::error::master_ball_unsuccessful::Builder,
   31     44   
) -> ::std::result::Result<
   32     45   
    crate::error::master_ball_unsuccessful::Builder,
   33     46   
    ::aws_smithy_json::deserialize::error::DeserializeError,
   34     47   
> {
          48  +
    /* JsonParserGenerator.kt:153 */
   35     49   
    let mut tokens_owned =
   36     50   
        ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value))
   37     51   
            .peekable();
   38     52   
    let tokens = &mut tokens_owned;
   39     53   
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
          54  +
    /* JsonParserGenerator.kt:684 */
   40     55   
    loop {
          56  +
        /* JsonParserGenerator.kt:685 */
   41     57   
        match tokens.next().transpose()? {
          58  +
            /* JsonParserGenerator.kt:686 */
   42     59   
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   43     60   
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
          61  +
                /* JsonParserGenerator.kt:260 */
   44     62   
                match key.to_unescaped()?.as_ref() {
          63  +
                    /* JsonParserGenerator.kt:262 */
   45     64   
                    "message" => {
          65  +
                        /* JsonParserGenerator.kt:272 */
   46     66   
                        builder = builder.set_message(
          67  +
                            /* JsonParserGenerator.kt:354 */
   47     68   
                            ::aws_smithy_json::deserialize::token::expect_string_or_null(
   48     69   
                                tokens.next(),
   49     70   
                            )?
   50         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   51         -
                            .transpose()?,
          71  +
                            .map(|s|
          72  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          73  +
                                    /* JsonParserGenerator.kt:348 */u.into_owned()
          74  +
                                /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
          75  +
                            .transpose()?, /* JsonParserGenerator.kt:272 */
   52     76   
                        );
          77  +
                        /* JsonParserGenerator.kt:262 */
   53     78   
                    }
   54         -
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
          79  +
                    /* JsonParserGenerator.kt:290 */
          80  +
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
   55     81   
                }
          82  +
                /* JsonParserGenerator.kt:686 */
   56     83   
            }
          84  +
            /* JsonParserGenerator.kt:695 */
   57     85   
            other => {
   58     86   
                return Err(
   59     87   
                    ::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   60     88   
                        "expected object key or end object, found: {:?}",
   61     89   
                        other
   62     90   
                    )),
   63     91   
                )
          92  +
            } /* JsonParserGenerator.kt:685 */
   64     93   
        }
          94  +
        /* JsonParserGenerator.kt:684 */
   65     95   
    }
   66         -
    }
          96  +
    /* JsonParserGenerator.kt:250 */
   67     97   
    if tokens.next().is_some() {
          98  +
        /* JsonParserGenerator.kt:251 */
   68     99   
        return Err(
   69    100   
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   70    101   
                "found more JSON tokens after completing parsing",
   71    102   
            ),
   72    103   
        );
         104  +
        /* JsonParserGenerator.kt:250 */
   73    105   
    }
         106  +
    /* JsonParserGenerator.kt:163 */
   74    107   
    Ok(builder)
         108  +
    /* JsonParserGenerator.kt:148 */
   75    109   
}

tmp-codegen-diff/codegen-server-test/pokemon-service-awsjson-server-sdk/rust-server-codegen/src/protocol_serde/shape_throttling_error.rs

@@ -1,1 +20,29 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
    2      3   
pub fn ser_throttling_error_error(
    3      4   
    value: &crate::error::ThrottlingError,
    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_throttling_error::ser_throttling_error(&mut object, value)?;
          11  +
    /* ServerAwsJson.kt:95 */
    8     12   
    object
    9     13   
        .key("__type")
   10     14   
        .string("com.aws.example#ThrottlingError");
          15  +
    /* JsonSerializerGenerator.kt:227 */
   11     16   
    object.finish();
   12     17   
    Ok(out)
          18  +
    /* JsonSerializerGenerator.kt:213 */
   13     19   
}
   14     20   
          21  +
/* JsonSerializerGenerator.kt:358 */
   15     22   
pub fn ser_throttling_error(
   16     23   
    #[allow(unused_variables)] object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   17     24   
    #[allow(unused_variables)] input: &crate::error::ThrottlingError,
   18     25   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          26  +
    /* JsonSerializerGenerator.kt:372 */
   19     27   
    Ok(())
          28  +
    /* JsonSerializerGenerator.kt:358 */
   20     29   
}

tmp-codegen-diff/codegen-server-test/pokemon-service-awsjson-server-sdk/rust-server-codegen/src/protocol_serde/shape_unsupported_region_error.rs

@@ -1,1 +26,38 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
    2      3   
pub fn ser_unsupported_region_error_error(
    3      4   
    value: &crate::error::UnsupportedRegionError,
    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_unsupported_region_error::ser_unsupported_region_error(
    8     11   
        &mut object,
    9     12   
        value,
   10     13   
    )?;
          14  +
    /* ServerAwsJson.kt:95 */
   11     15   
    object
   12     16   
        .key("__type")
   13     17   
        .string("com.aws.example#UnsupportedRegionError");
          18  +
    /* JsonSerializerGenerator.kt:227 */
   14     19   
    object.finish();
   15     20   
    Ok(out)
          21  +
    /* JsonSerializerGenerator.kt:213 */
   16     22   
}
   17     23   
          24  +
/* JsonSerializerGenerator.kt:358 */
   18     25   
pub fn ser_unsupported_region_error(
   19     26   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   20     27   
    input: &crate::error::UnsupportedRegionError,
   21     28   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          29  +
    /* SerializerUtil.kt:42 */
   22     30   
    {
          31  +
        /* JsonSerializerGenerator.kt:423 */
   23     32   
        object.key("region").string(input.region.as_str());
          33  +
        /* SerializerUtil.kt:42 */
   24     34   
    }
          35  +
    /* JsonSerializerGenerator.kt:372 */
   25     36   
    Ok(())
          37  +
    /* JsonSerializerGenerator.kt:358 */
   26     38   
}

tmp-codegen-diff/codegen-server-test/pokemon-service-awsjson-server-sdk/rust-server-codegen/src/protocol_serde/shape_validation_exception.rs

@@ -1,1 +38,62 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
    2      3   
pub fn ser_validation_exception_error(
    3      4   
    value: &crate::error::ValidationException,
    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_validation_exception::ser_validation_exception(
    8     11   
        &mut object,
    9     12   
        value,
   10     13   
    )?;
          14  +
    /* ServerAwsJson.kt:95 */
   11     15   
    object
   12     16   
        .key("__type")
   13     17   
        .string("smithy.framework#ValidationException");
          18  +
    /* JsonSerializerGenerator.kt:227 */
   14     19   
    object.finish();
   15     20   
    Ok(out)
          21  +
    /* JsonSerializerGenerator.kt:213 */
   16     22   
}
   17     23   
          24  +
/* JsonSerializerGenerator.kt:358 */
   18     25   
pub fn ser_validation_exception(
   19     26   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   20     27   
    input: &crate::error::ValidationException,
   21     28   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          29  +
    /* SerializerUtil.kt:42 */
   22     30   
    {
          31  +
        /* JsonSerializerGenerator.kt:423 */
   23     32   
        object.key("message").string(input.message.as_str());
          33  +
        /* SerializerUtil.kt:42 */
   24     34   
    }
          35  +
    /* JsonSerializerGenerator.kt:382 */
   25     36   
    if let Some(var_1) = &input.field_list {
          37  +
        /* JsonSerializerGenerator.kt:484 */
   26     38   
        let mut array_2 = object.key("fieldList").start_array();
          39  +
        /* JsonSerializerGenerator.kt:524 */
   27     40   
        for item_3 in var_1 {
          41  +
            /* SerializerUtil.kt:42 */
   28     42   
            {
          43  +
                /* JsonSerializerGenerator.kt:495 */
   29     44   
                #[allow(unused_mut)]
          45  +
                /* JsonSerializerGenerator.kt:496 */
   30     46   
                let mut object_4 = array_2.value().start_object();
          47  +
                /* JsonSerializerGenerator.kt:375 */
   31     48   
                crate::protocol_serde::shape_validation_exception_field::ser_validation_exception_field(&mut object_4, item_3)?;
          49  +
                /* JsonSerializerGenerator.kt:515 */
   32     50   
                object_4.finish();
          51  +
                /* SerializerUtil.kt:42 */
   33     52   
            }
          53  +
            /* JsonSerializerGenerator.kt:524 */
   34     54   
        }
          55  +
        /* JsonSerializerGenerator.kt:486 */
   35     56   
        array_2.finish();
          57  +
        /* JsonSerializerGenerator.kt:382 */
   36     58   
    }
          59  +
    /* JsonSerializerGenerator.kt:372 */
   37     60   
    Ok(())
          61  +
    /* JsonSerializerGenerator.kt:358 */
   38     62   
}

tmp-codegen-diff/codegen-server-test/pokemon-service-awsjson-server-sdk/rust-server-codegen/src/protocol_serde/shape_validation_exception_field.rs

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

tmp-codegen-diff/codegen-server-test/pokemon-service-awsjson-server-sdk/rust-server-codegen/src/service.rs

@@ -1,1 +31,32 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* ServerServiceGenerator.kt:795 */
    2      3   
/// The service builder for [`PokemonService`].
    3      4   
///
    4      5   
/// Constructed via [`PokemonService::builder`].
    5      6   
pub struct PokemonServiceBuilder<Body, L, HttpPl, ModelPl> {
    6      7   
    capture_pokemon: Option<::aws_smithy_http_server::routing::Route<Body>>,
    7      8   
    check_health: Option<::aws_smithy_http_server::routing::Route<Body>>,
    8      9   
    do_nothing: Option<::aws_smithy_http_server::routing::Route<Body>>,
    9     10   
    get_server_statistics: Option<::aws_smithy_http_server::routing::Route<Body>>,
   10     11   
    layer: L,
   11     12   
    http_plugin: HttpPl,
@@ -1027,1028 +1086,1088 @@
 1047   1048   
            "com.aws.example",
 1048   1049   
            "PokemonService",
 1049   1050   
        );
 1050   1051   
 1051   1052   
    const VERSION: Option<&'static str> = Some("2024-03-18");
 1052   1053   
 1053   1054   
    type Protocol = ::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0;
 1054   1055   
 1055   1056   
    type Operations = Operation;
 1056   1057   
}
        1058  +
/* ServiceConfigGenerator.kt:178 */
 1057   1059   
/// Configuration for the [`PokemonService`]. This is the central place where to register and
 1058   1060   
/// configure [`::tower::Layer`]s, HTTP plugins, and model plugins.
 1059   1061   
///
 1060   1062   
/// ```rust,no_run
 1061   1063   
/// # use pokemon_service_awsjson_server_sdk::PokemonServiceConfig;
 1062   1064   
/// # use ::aws_smithy_http_server::plugin::IdentityPlugin;
 1063   1065   
/// # use ::tower::layer::util::Identity;
 1064   1066   
/// # let authentication_plugin = IdentityPlugin;
 1065   1067   
/// # let authorization_plugin = IdentityPlugin;
 1066   1068   
/// # let server_request_id_provider_layer = Identity::new();
@@ -1148,1150 +1207,1210 @@
 1168   1170   
 1169   1171   
    /// Build the configuration.
 1170   1172   
    pub fn build(self) -> super::PokemonServiceConfig<L, H, M> {
 1171   1173   
        super::PokemonServiceConfig {
 1172   1174   
            layers: self.layers,
 1173   1175   
            http_plugins: self.http_plugins,
 1174   1176   
            model_plugins: self.model_plugins,
 1175   1177   
        }
 1176   1178   
    }
 1177   1179   
}
        1180  +
/* ScopeMacroGenerator.kt:81 */
 1178   1181   
/// A macro to help with scoping [plugins](crate::server::plugin) to a subset of all operations.
 1179   1182   
///
 1180   1183   
/// In contrast to [`crate::server::scope`](crate::server::scope), this macro has knowledge
 1181   1184   
/// of the service and any operations _not_ specified will be placed in the opposing group.
 1182   1185   
///
 1183   1186   
/// # Example
 1184   1187   
///
 1185   1188   
/// ```rust
 1186   1189   
/// scope! {
 1187   1190   
///     /// Includes [`CapturePokemon`], excluding all other operations.