Server Test Python

Server Test Python

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943

Files changed:

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

@@ -18,18 +60,61 @@
   38     38   
pub(crate) mod shape_storage_access_not_authorized;
   39     39   
   40     40   
pub(crate) mod shape_stream_pokemon_radio_output;
   41     41   
   42     42   
pub(crate) mod shape_throttling_error;
   43     43   
   44     44   
pub(crate) mod shape_unsupported_region_error;
   45     45   
   46     46   
pub(crate) mod shape_validation_exception;
   47     47   
          48  +
/* JsonParserGenerator.kt:227 */
   48     49   
pub(crate) fn or_empty_doc(data: &[u8]) -> &[u8] {
   49     50   
    if data.is_empty() {
   50     51   
        b"{}"
   51     52   
    } else {
   52     53   
        data
   53     54   
    }
   54     55   
}
   55     56   
   56     57   
pub(crate) mod shape_capturing_payload;
   57     58   

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

@@ -1,1 +247,337 @@
    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::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::capture_pokemon_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_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:986 */
   32     41   
        let input_string = uri.path();
          42  +
        /* ServerHttpBoundProtocolGenerator.kt:998 */
   33     43   
        let (input_string, (_, m1)) =
   34     44   
            ::nom::sequence::tuple::<_, _, ::nom::error::Error<&str>, _>((
   35     45   
                ::nom::sequence::preceded(
   36     46   
                    ::nom::bytes::complete::tag("/"),
   37     47   
                    ::nom::bytes::complete::tag::<_, _, ::nom::error::Error<&str>>(
   38     48   
                        "capture-pokemon-event",
   39     49   
                    ),
   40     50   
                ),
   41     51   
                ::nom::sequence::preceded(
   42     52   
                    ::nom::bytes::complete::tag("/"),
   43     53   
                    ::nom::branch::alt::<_, _, ::nom::error::Error<&str>, _>((
   44     54   
                        ::nom::bytes::complete::take_until("/"),
   45     55   
                        ::nom::combinator::rest,
   46     56   
                    )),
   47     57   
                ),
   48     58   
            ))(input_string)?;
   49     59   
        debug_assert_eq!("", input_string);
          60  +
        /* ServerHttpBoundProtocolGenerator.kt:1009 */
   50     61   
        input =
   51     62   
            input.set_region(crate::protocol_serde::shape_capture_pokemon_input::de_region(m1)?);
          63  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   52     64   
        input.build()?
          65  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   53     66   
    })
          67  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   54     68   
}
   55     69   
          70  +
/* RustType.kt:516 */
   56     71   
#[allow(clippy::unnecessary_wraps)]
          72  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   57     73   
pub fn ser_capture_pokemon_http_response(
   58     74   
    #[allow(unused_variables)] output: crate::output::CapturePokemonOutput,
   59     75   
) -> std::result::Result<
   60     76   
    ::aws_smithy_http_server::response::Response,
   61     77   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   62     78   
> {
          79  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   63     80   
    Ok({
          81  +
        /* RustType.kt:516 */
   64     82   
        #[allow(unused_mut)]
          83  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   65     84   
        let mut builder = ::http::Response::builder();
          85  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   66     86   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   67     87   
            builder,
   68     88   
            ::http::header::CONTENT_TYPE,
   69     89   
            "application/vnd.amazon.eventstream",
   70     90   
        );
          91  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   71     92   
        let http_status: u16 = 200;
   72     93   
        builder = builder.status(http_status);
          94  +
        /* ServerHttpBoundProtocolGenerator.kt:543 */
   73     95   
        let body = ::aws_smithy_http_server::body::boxed(
   74         -
            ::aws_smithy_http_server::body::Body::wrap_stream({
   75         -
                let error_marshaller =
   76         -
                    crate::event_stream_serde::CapturePokemonEventsErrorMarshaller::new();
   77         -
                let marshaller = crate::event_stream_serde::CapturePokemonEventsMarshaller::new();
   78         -
                let signer = ::aws_smithy_eventstream::frame::NoOpSigner {};
   79         -
                let adapter: ::aws_smithy_http::event_stream::MessageStreamAdapter<_, _> = output
   80         -
                    .events
   81         -
                    .into_body_stream(marshaller, error_marshaller, signer);
   82         -
                adapter
   83         -
            }),
          96  +
            ::aws_smithy_http_server::body::Body::wrap_stream(
          97  +
                /* ServerHttpBoundProtocolGenerator.kt:135 */
          98  +
                {
          99  +
                    let error_marshaller =
         100  +
                        crate::event_stream_serde::CapturePokemonEventsErrorMarshaller::new();
         101  +
                    let marshaller =
         102  +
                        crate::event_stream_serde::CapturePokemonEventsMarshaller::new();
         103  +
                    let signer = ::aws_smithy_eventstream::frame::NoOpSigner {};
         104  +
                    let adapter: ::aws_smithy_http::event_stream::MessageStreamAdapter<_, _> =
         105  +
                        output
         106  +
                            .events
         107  +
                            .into_body_stream(marshaller, error_marshaller, signer);
         108  +
                    adapter
         109  +
                }, /* ServerHttpBoundProtocolGenerator.kt:543 */
         110  +
            ),
   84    111   
        );
         112  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   85    113   
        builder.body(body)?
         114  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   86    115   
    })
         116  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   87    117   
}
   88    118   
         119  +
/* RustType.kt:516 */
   89    120   
#[allow(clippy::unnecessary_wraps)]
         121  +
/* ServerHttpBoundProtocolGenerator.kt:447 */
   90    122   
pub fn ser_capture_pokemon_http_error(
   91    123   
    error: &crate::error::CapturePokemonError,
   92    124   
) -> std::result::Result<
   93    125   
    ::aws_smithy_http_server::response::Response,
   94    126   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   95    127   
> {
         128  +
    /* ServerHttpBoundProtocolGenerator.kt:452 */
   96    129   
    Ok({
         130  +
        /* ServerHttpBoundProtocolGenerator.kt:468 */
   97    131   
        match error {
         132  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
   98    133   
            crate::error::CapturePokemonError::ValidationException(output) => {
         134  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
   99    135   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
         136  +
                /* RustType.kt:516 */
  100    137   
                #[allow(unused_mut)]
         138  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
  101    139   
                let mut builder = ::http::Response::builder();
         140  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  102    141   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  103    142   
                    builder,
  104    143   
                    ::http::header::CONTENT_TYPE,
  105    144   
                    "application/vnd.amazon.eventstream",
  106    145   
                );
         146  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  107    147   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  108    148   
                    builder,
  109    149   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  110    150   
                    "ValidationException",
  111    151   
                );
         152  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  112    153   
                let content_length = payload.len();
  113    154   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  114    155   
                    builder,
  115    156   
                    ::http::header::CONTENT_LENGTH,
  116    157   
                    content_length,
  117    158   
                );
         159  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  118    160   
                builder
  119    161   
                    .status(400)
  120    162   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         163  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
  121    164   
            }
         165  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
  122    166   
            crate::error::CapturePokemonError::MasterBallUnsuccessful(output) => {
         167  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
  123    168   
                let payload = crate::protocol_serde::shape_master_ball_unsuccessful::ser_master_ball_unsuccessful_error(output)?;
         169  +
                /* RustType.kt:516 */
  124    170   
                #[allow(unused_mut)]
         171  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
  125    172   
                let mut builder = ::http::Response::builder();
         173  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  126    174   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  127    175   
                    builder,
  128    176   
                    ::http::header::CONTENT_TYPE,
  129    177   
                    "application/vnd.amazon.eventstream",
  130    178   
                );
         179  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  131    180   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  132    181   
                    builder,
  133    182   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  134    183   
                    "MasterBallUnsuccessful",
  135    184   
                );
         185  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  136    186   
                let content_length = payload.len();
  137    187   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  138    188   
                    builder,
  139    189   
                    ::http::header::CONTENT_LENGTH,
  140    190   
                    content_length,
  141    191   
                );
         192  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  142    193   
                builder
  143    194   
                    .status(500)
  144    195   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         196  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
  145    197   
            }
         198  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
  146    199   
            crate::error::CapturePokemonError::InvalidPokeballError(output) => {
         200  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
  147    201   
                let payload = crate::protocol_serde::shape_invalid_pokeball_error::ser_invalid_pokeball_error_error(output)?;
         202  +
                /* RustType.kt:516 */
  148    203   
                #[allow(unused_mut)]
         204  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
  149    205   
                let mut builder = ::http::Response::builder();
         206  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  150    207   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  151    208   
                    builder,
  152    209   
                    ::http::header::CONTENT_TYPE,
  153    210   
                    "application/vnd.amazon.eventstream",
  154    211   
                );
         212  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  155    213   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  156    214   
                    builder,
  157    215   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  158    216   
                    "InvalidPokeballError",
  159    217   
                );
         218  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  160    219   
                let content_length = payload.len();
  161    220   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  162    221   
                    builder,
  163    222   
                    ::http::header::CONTENT_LENGTH,
  164    223   
                    content_length,
  165    224   
                );
         225  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  166    226   
                builder
  167    227   
                    .status(400)
  168    228   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         229  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
  169    230   
            }
         231  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
  170    232   
            crate::error::CapturePokemonError::ThrottlingError(output) => {
         233  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
  171    234   
                let payload =
  172    235   
                    crate::protocol_serde::shape_throttling_error::ser_throttling_error_error(
  173    236   
                        output,
  174    237   
                    )?;
         238  +
                /* RustType.kt:516 */
  175    239   
                #[allow(unused_mut)]
         240  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
  176    241   
                let mut builder = ::http::Response::builder();
         242  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  177    243   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  178    244   
                    builder,
  179    245   
                    ::http::header::CONTENT_TYPE,
  180    246   
                    "application/vnd.amazon.eventstream",
  181    247   
                );
         248  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  182    249   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  183    250   
                    builder,
  184    251   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  185    252   
                    "ThrottlingError",
  186    253   
                );
         254  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  187    255   
                let content_length = payload.len();
  188    256   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  189    257   
                    builder,
  190    258   
                    ::http::header::CONTENT_LENGTH,
  191    259   
                    content_length,
  192    260   
                );
         261  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  193    262   
                builder
  194    263   
                    .status(400)
  195    264   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         265  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
  196    266   
            }
         267  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
  197    268   
            crate::error::CapturePokemonError::UnsupportedRegionError(output) => {
         269  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
  198    270   
                let payload = crate::protocol_serde::shape_unsupported_region_error::ser_unsupported_region_error_error(output)?;
         271  +
                /* RustType.kt:516 */
  199    272   
                #[allow(unused_mut)]
         273  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
  200    274   
                let mut builder = ::http::Response::builder();
         275  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  201    276   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  202    277   
                    builder,
  203    278   
                    ::http::header::CONTENT_TYPE,
  204    279   
                    "application/vnd.amazon.eventstream",
  205    280   
                );
         281  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  206    282   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  207    283   
                    builder,
  208    284   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  209    285   
                    "UnsupportedRegionError",
  210    286   
                );
         287  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  211    288   
                let content_length = payload.len();
  212    289   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  213    290   
                    builder,
  214    291   
                    ::http::header::CONTENT_LENGTH,
  215    292   
                    content_length,
  216    293   
                );
         294  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  217    295   
                builder
  218    296   
                    .status(500)
  219    297   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         298  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
  220    299   
            }
         300  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
  221    301   
            crate::error::CapturePokemonError::InternalServerError(output) => {
         302  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
  222    303   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
         304  +
                /* RustType.kt:516 */
  223    305   
                #[allow(unused_mut)]
         306  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
  224    307   
                let mut builder = ::http::Response::builder();
         308  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  225    309   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  226    310   
                    builder,
  227    311   
                    ::http::header::CONTENT_TYPE,
  228    312   
                    "application/vnd.amazon.eventstream",
  229    313   
                );
         314  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  230    315   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  231    316   
                    builder,
  232    317   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  233    318   
                    "InternalServerError",
  234    319   
                );
         320  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  235    321   
                let content_length = payload.len();
  236    322   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  237    323   
                    builder,
  238    324   
                    ::http::header::CONTENT_LENGTH,
  239    325   
                    content_length,
  240    326   
                );
         327  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  241    328   
                builder
  242    329   
                    .status(500)
  243    330   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
  244         -
            }
         331  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
         332  +
            } /* ServerHttpBoundProtocolGenerator.kt:468 */
  245    333   
        }
         334  +
        /* ServerHttpBoundProtocolGenerator.kt:452 */
  246    335   
    })
         336  +
    /* ServerHttpBoundProtocolGenerator.kt:447 */
  247    337   
}

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

@@ -1,1 +23,30 @@
    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   
    crate::python_event_stream::CapturePokemonInputEventsReceiver,
    6      7   
    ::aws_smithy_json::deserialize::error::DeserializeError,
    7      8   
> {
           9  +
    /* HttpBindingGenerator.kt:272 */
    8     10   
    let unmarshaller = crate::event_stream_serde::AttemptCapturingPokemonEventUnmarshaller::new();
    9     11   
    let body = std::mem::replace(body, ::aws_smithy_types::body::SdkBody::taken());
   10     12   
    Ok(crate::python_event_stream::CapturePokemonInputEventsReceiver::new(unmarshaller, body))
          13  +
    /* HttpBindingGenerator.kt:230 */
   11     14   
}
   12     15   
          16  +
/* ServerHttpBoundProtocolGenerator.kt:1292 */
   13     17   
pub fn de_region(
   14     18   
    value: &str,
   15     19   
) -> std::result::Result<
   16     20   
    ::std::string::String,
   17     21   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
   18     22   
> {
          23  +
    /* ServerHttpBoundProtocolGenerator.kt:1302 */
   19     24   
    let value = ::percent_encoding::percent_decode_str(value)
   20     25   
        .decode_utf8()?
   21     26   
        .into_owned();
          27  +
    /* ServerHttpBoundProtocolGenerator.kt:1357 */
   22     28   
    Ok(value)
          29  +
    /* ServerHttpBoundProtocolGenerator.kt:1292 */
   23     30   
}

tmp-codegen-diff/codegen-server-test-python/pokemon-service-server-sdk/rust-server-codegen-python/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_internal::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   
                        )
   79         -
                    }
         102  +
                    } /* JsonParserGenerator.kt:685 */
   80    103   
                }
         104  +
                /* JsonParserGenerator.kt:684 */
   81    105   
            }
         106  +
            /* JsonParserGenerator.kt:540 */
   82    107   
            Ok(Some(builder.build()))
         108  +
            /* JsonParserGenerator.kt:713 */
   83    109   
        }
   84         -
        _ => Err(
   85         -
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   86         -
                "expected start object or null",
   87         -
            ),
   88         -
        ),
         110  +
        /* JsonParserGenerator.kt:722 */
         111  +
        _ => {
         112  +
            /* JsonParserGenerator.kt:723 */
         113  +
            Err(
         114  +
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
         115  +
                    "expected start object or null",
         116  +
                ),
         117  +
            )
         118  +
            /* JsonParserGenerator.kt:722 */
         119  +
        } /* JsonParserGenerator.kt:712 */
   89    120   
    }
         121  +
    /* JsonParserGenerator.kt:516 */
   90    122   
}

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

@@ -1,1 +91,132 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:516 */
    2      3   
#[allow(clippy::unnecessary_wraps)]
           4  +
/* 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::rest_json_1::rejection::RequestRejection,
    8     10   
>
    9     11   
where
   10     12   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11     13   
    B::Data: Send,
   12     14   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
   13     15   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     16   
{
          17  +
    /* ServerHttpBoundProtocolGenerator.kt:399 */
   15     18   
    Ok({
          19  +
        /* RustType.kt:516 */
   16     20   
        #[allow(unused_mut)]
          21  +
        /* ServerHttpBoundProtocolGenerator.kt:723 */
   17     22   
        let mut input = crate::input::check_health_input_internal::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:811 */
   22     30   
        ::aws_smithy_http_server::protocol::content_type_header_classifier_smithy(&headers, None)?;
          31  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   23     32   
        input.build()
          33  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   24     34   
    })
          35  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   25     36   
}
   26     37   
          38  +
/* RustType.kt:516 */
   27     39   
#[allow(clippy::unnecessary_wraps)]
          40  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   28     41   
pub fn ser_check_health_http_response(
   29     42   
    #[allow(unused_variables)] output: crate::output::CheckHealthOutput,
   30     43   
) -> std::result::Result<
   31     44   
    ::aws_smithy_http_server::response::Response,
   32     45   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   33     46   
> {
          47  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   34     48   
    Ok({
          49  +
        /* RustType.kt:516 */
   35     50   
        #[allow(unused_mut)]
          51  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   36     52   
        let mut builder = ::http::Response::builder();
          53  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   37     54   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   38     55   
            builder,
   39     56   
            ::http::header::CONTENT_TYPE,
   40     57   
            "application/json",
   41     58   
        );
          59  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   42     60   
        let http_status: u16 = 200;
   43     61   
        builder = builder.status(http_status);
   44         -
        let payload = "";
          62  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
          63  +
        let payload =
          64  +
            /* HttpBoundProtocolPayloadGenerator.kt:235 */""
          65  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
          66  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   45     67   
        let content_length = payload.len();
   46     68   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   47     69   
            builder,
   48     70   
            ::http::header::CONTENT_LENGTH,
   49     71   
            content_length,
   50     72   
        );
          73  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   51     74   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          75  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   52     76   
        builder.body(body)?
          77  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   53     78   
    })
          79  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   54     80   
}
   55     81   
          82  +
/* RustType.kt:516 */
   56     83   
#[allow(clippy::unnecessary_wraps)]
          84  +
/* ServerHttpBoundProtocolGenerator.kt:447 */
   57     85   
pub fn ser_check_health_http_error(
   58     86   
    error: &crate::error::CheckHealthError,
   59     87   
) -> std::result::Result<
   60     88   
    ::aws_smithy_http_server::response::Response,
   61     89   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   62     90   
> {
          91  +
    /* ServerHttpBoundProtocolGenerator.kt:452 */
   63     92   
    Ok({
          93  +
        /* ServerHttpBoundProtocolGenerator.kt:468 */
   64     94   
        match error {
          95  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
   65     96   
            crate::error::CheckHealthError::InternalServerError(output) => {
          97  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
   66     98   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
          99  +
                /* RustType.kt:516 */
   67    100   
                #[allow(unused_mut)]
         101  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
   68    102   
                let mut builder = ::http::Response::builder();
         103  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   69    104   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   70    105   
                    builder,
   71    106   
                    ::http::header::CONTENT_TYPE,
   72    107   
                    "application/json",
   73    108   
                );
         109  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   74    110   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   75    111   
                    builder,
   76    112   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
   77    113   
                    "InternalServerError",
   78    114   
                );
         115  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
   79    116   
                let content_length = payload.len();
   80    117   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   81    118   
                    builder,
   82    119   
                    ::http::header::CONTENT_LENGTH,
   83    120   
                    content_length,
   84    121   
                );
         122  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
   85    123   
                builder
   86    124   
                    .status(500)
   87    125   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
   88         -
            }
         126  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
         127  +
            } /* ServerHttpBoundProtocolGenerator.kt:468 */
   89    128   
        }
         129  +
        /* ServerHttpBoundProtocolGenerator.kt:452 */
   90    130   
    })
         131  +
    /* ServerHttpBoundProtocolGenerator.kt:447 */
   91    132   
}

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

@@ -1,1 +93,130 @@
    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::rest_json_1::rejection::RequestRejection,
    8     10   
>
    9     11   
where
   10     12   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11     13   
    B::Data: Send,
   12     14   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
   13     15   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     16   
{
          17  +
    /* ServerHttpBoundProtocolGenerator.kt:399 */
   15     18   
    Ok({
          19  +
        /* RustType.kt:516 */
   16     20   
        #[allow(unused_mut)]
          21  +
        /* ServerHttpBoundProtocolGenerator.kt:723 */
   17     22   
        let mut input = crate::input::do_nothing_input_internal::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::rest_json_1::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/json",
   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   
}
   57     79   
          80  +
/* RustType.kt:516 */
   58     81   
#[allow(clippy::unnecessary_wraps)]
          82  +
/* ServerHttpBoundProtocolGenerator.kt:447 */
   59     83   
pub fn ser_do_nothing_http_error(
   60     84   
    error: &crate::error::DoNothingError,
   61     85   
) -> std::result::Result<
   62     86   
    ::aws_smithy_http_server::response::Response,
   63     87   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   64     88   
> {
          89  +
    /* ServerHttpBoundProtocolGenerator.kt:452 */
   65     90   
    Ok({
          91  +
        /* ServerHttpBoundProtocolGenerator.kt:468 */
   66     92   
        match error {
          93  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
   67     94   
            crate::error::DoNothingError::InternalServerError(output) => {
          95  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
   68     96   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
          97  +
                /* RustType.kt:516 */
   69     98   
                #[allow(unused_mut)]
          99  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
   70    100   
                let mut builder = ::http::Response::builder();
         101  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   71    102   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   72    103   
                    builder,
   73    104   
                    ::http::header::CONTENT_TYPE,
   74    105   
                    "application/json",
   75    106   
                );
         107  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   76    108   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   77    109   
                    builder,
   78    110   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
   79    111   
                    "InternalServerError",
   80    112   
                );
         113  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
   81    114   
                let content_length = payload.len();
   82    115   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   83    116   
                    builder,
   84    117   
                    ::http::header::CONTENT_LENGTH,
   85    118   
                    content_length,
   86    119   
                );
         120  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
   87    121   
                builder
   88    122   
                    .status(500)
   89    123   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
   90         -
            }
         124  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
         125  +
            } /* ServerHttpBoundProtocolGenerator.kt:468 */
   91    126   
        }
         127  +
        /* ServerHttpBoundProtocolGenerator.kt:452 */
   92    128   
    })
         129  +
    /* ServerHttpBoundProtocolGenerator.kt:447 */
   93    130   
}

tmp-codegen-diff/codegen-server-test-python/pokemon-service-server-sdk/rust-server-codegen-python/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-python/pokemon-service-server-sdk/rust-server-codegen-python/src/protocol_serde/shape_flavor_text.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_flavor_text(
    3      4   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4      5   
    input: &crate::model::FlavorText,
    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("flavorText").string(input.flavor_text.as_str());
          11  +
        /* SerializerUtil.kt:42 */
    8     12   
    }
          13  +
    /* SerializerUtil.kt:42 */
    9     14   
    {
          15  +
        /* JsonSerializerGenerator.kt:423 */
   10     16   
        object.key("language").string(input.language.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-python/pokemon-service-server-sdk/rust-server-codegen-python/src/protocol_serde/shape_get_pokemon_species.rs

@@ -1,1 +160,219 @@
    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_pokemon_species_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::GetPokemonSpeciesInput,
    7      9   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
    8     10   
>
    9     11   
where
   10     12   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11     13   
    B::Data: Send,
   12     14   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
   13     15   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     16   
{
          17  +
    /* ServerHttpBoundProtocolGenerator.kt:399 */
   15     18   
    Ok({
          19  +
        /* RustType.kt:516 */
   16     20   
        #[allow(unused_mut)]
          21  +
        /* ServerHttpBoundProtocolGenerator.kt:723 */
   17     22   
        let mut input = crate::input::get_pokemon_species_input_internal::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:986 */
   22     30   
        let input_string = uri.path();
          31  +
        /* ServerHttpBoundProtocolGenerator.kt:998 */
   23     32   
        let (input_string, (_, m1)) =
   24     33   
            ::nom::sequence::tuple::<_, _, ::nom::error::Error<&str>, _>((
   25     34   
                ::nom::sequence::preceded(
   26     35   
                    ::nom::bytes::complete::tag("/"),
   27     36   
                    ::nom::bytes::complete::tag::<_, _, ::nom::error::Error<&str>>(
   28     37   
                        "pokemon-species",
   29     38   
                    ),
   30     39   
                ),
   31     40   
                ::nom::sequence::preceded(
   32     41   
                    ::nom::bytes::complete::tag("/"),
   33     42   
                    ::nom::branch::alt::<_, _, ::nom::error::Error<&str>, _>((
   34     43   
                        ::nom::bytes::complete::take_until("/"),
   35     44   
                        ::nom::combinator::rest,
   36     45   
                    )),
   37     46   
                ),
   38     47   
            ))(input_string)?;
   39     48   
        debug_assert_eq!("", input_string);
          49  +
        /* ServerHttpBoundProtocolGenerator.kt:1009 */
   40     50   
        input =
   41     51   
            input.set_name(crate::protocol_serde::shape_get_pokemon_species_input::de_name(m1)?);
          52  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   42     53   
        input.build()?
          54  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   43     55   
    })
          56  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   44     57   
}
   45     58   
          59  +
/* RustType.kt:516 */
   46     60   
#[allow(clippy::unnecessary_wraps)]
          61  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   47     62   
pub fn ser_get_pokemon_species_http_response(
   48     63   
    #[allow(unused_variables)] output: crate::output::GetPokemonSpeciesOutput,
   49     64   
) -> std::result::Result<
   50     65   
    ::aws_smithy_http_server::response::Response,
   51     66   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   52     67   
> {
          68  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   53     69   
    Ok({
          70  +
        /* RustType.kt:516 */
   54     71   
        #[allow(unused_mut)]
          72  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   55     73   
        let mut builder = ::http::Response::builder();
          74  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   56     75   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   57     76   
            builder,
   58     77   
            ::http::header::CONTENT_TYPE,
   59     78   
            "application/json",
   60     79   
        );
          80  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   61     81   
        let http_status: u16 = 200;
   62     82   
        builder = builder.status(http_status);
          83  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
   63     84   
        let payload =
   64         -
            crate::protocol_serde::shape_get_pokemon_species_output::ser_get_pokemon_species_output_output_output(&output)?
   65         -
        ;
          85  +
            /* HttpBoundProtocolPayloadGenerator.kt:237 */crate::protocol_serde::shape_get_pokemon_species_output::ser_get_pokemon_species_output_output_output(&output)?
          86  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
          87  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   66     88   
        let content_length = payload.len();
   67     89   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   68     90   
            builder,
   69     91   
            ::http::header::CONTENT_LENGTH,
   70     92   
            content_length,
   71     93   
        );
          94  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   72     95   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          96  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   73     97   
        builder.body(body)?
          98  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   74     99   
    })
         100  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   75    101   
}
   76    102   
         103  +
/* RustType.kt:516 */
   77    104   
#[allow(clippy::unnecessary_wraps)]
         105  +
/* ServerHttpBoundProtocolGenerator.kt:447 */
   78    106   
pub fn ser_get_pokemon_species_http_error(
   79    107   
    error: &crate::error::GetPokemonSpeciesError,
   80    108   
) -> std::result::Result<
   81    109   
    ::aws_smithy_http_server::response::Response,
   82    110   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   83    111   
> {
         112  +
    /* ServerHttpBoundProtocolGenerator.kt:452 */
   84    113   
    Ok({
         114  +
        /* ServerHttpBoundProtocolGenerator.kt:468 */
   85    115   
        match error {
         116  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
   86    117   
            crate::error::GetPokemonSpeciesError::ValidationException(output) => {
         118  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
   87    119   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
         120  +
                /* RustType.kt:516 */
   88    121   
                #[allow(unused_mut)]
         122  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
   89    123   
                let mut builder = ::http::Response::builder();
         124  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   90    125   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   91    126   
                    builder,
   92    127   
                    ::http::header::CONTENT_TYPE,
   93    128   
                    "application/json",
   94    129   
                );
         130  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   95    131   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   96    132   
                    builder,
   97    133   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
   98    134   
                    "ValidationException",
   99    135   
                );
         136  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  100    137   
                let content_length = payload.len();
  101    138   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  102    139   
                    builder,
  103    140   
                    ::http::header::CONTENT_LENGTH,
  104    141   
                    content_length,
  105    142   
                );
         143  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  106    144   
                builder
  107    145   
                    .status(400)
  108    146   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         147  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
  109    148   
            }
         149  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
  110    150   
            crate::error::GetPokemonSpeciesError::ResourceNotFoundException(output) => {
         151  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
  111    152   
                let payload = crate::protocol_serde::shape_resource_not_found_exception::ser_resource_not_found_exception_error(output)?;
         153  +
                /* RustType.kt:516 */
  112    154   
                #[allow(unused_mut)]
         155  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
  113    156   
                let mut builder = ::http::Response::builder();
         157  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  114    158   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  115    159   
                    builder,
  116    160   
                    ::http::header::CONTENT_TYPE,
  117    161   
                    "application/json",
  118    162   
                );
         163  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  119    164   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  120    165   
                    builder,
  121    166   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  122    167   
                    "ResourceNotFoundException",
  123    168   
                );
         169  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  124    170   
                let content_length = payload.len();
  125    171   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  126    172   
                    builder,
  127    173   
                    ::http::header::CONTENT_LENGTH,
  128    174   
                    content_length,
  129    175   
                );
         176  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  130    177   
                builder
  131    178   
                    .status(404)
  132    179   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         180  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
  133    181   
            }
         182  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
  134    183   
            crate::error::GetPokemonSpeciesError::InternalServerError(output) => {
         184  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
  135    185   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
         186  +
                /* RustType.kt:516 */
  136    187   
                #[allow(unused_mut)]
         188  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
  137    189   
                let mut builder = ::http::Response::builder();
         190  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  138    191   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  139    192   
                    builder,
  140    193   
                    ::http::header::CONTENT_TYPE,
  141    194   
                    "application/json",
  142    195   
                );
         196  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  143    197   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  144    198   
                    builder,
  145    199   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  146    200   
                    "InternalServerError",
  147    201   
                );
         202  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  148    203   
                let content_length = payload.len();
  149    204   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  150    205   
                    builder,
  151    206   
                    ::http::header::CONTENT_LENGTH,
  152    207   
                    content_length,
  153    208   
                );
         209  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  154    210   
                builder
  155    211   
                    .status(500)
  156    212   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
  157         -
            }
         213  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
         214  +
            } /* ServerHttpBoundProtocolGenerator.kt:468 */
  158    215   
        }
         216  +
        /* ServerHttpBoundProtocolGenerator.kt:452 */
  159    217   
    })
         218  +
    /* ServerHttpBoundProtocolGenerator.kt:447 */
  160    219   
}

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

@@ -1,1 +12,16 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* ServerHttpBoundProtocolGenerator.kt:1292 */
    2      3   
pub fn de_name(
    3      4   
    value: &str,
    4      5   
) -> std::result::Result<
    5      6   
    ::std::string::String,
    6      7   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
    7      8   
> {
           9  +
    /* ServerHttpBoundProtocolGenerator.kt:1302 */
    8     10   
    let value = ::percent_encoding::percent_decode_str(value)
    9     11   
        .decode_utf8()?
   10     12   
        .into_owned();
          13  +
    /* ServerHttpBoundProtocolGenerator.kt:1357 */
   11     14   
    Ok(value)
          15  +
    /* ServerHttpBoundProtocolGenerator.kt:1292 */
   12     16   
}

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

@@ -1,1 +35,58 @@
    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_pokemon_species_output_output_output(
    3      4   
    value: &crate::output::GetPokemonSpeciesOutput,
    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_pokemon_species_output::ser_get_pokemon_species_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_get_pokemon_species_output_output(
   16     22   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   17     23   
    input: &crate::output::GetPokemonSpeciesOutput,
   18     24   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          25  +
    /* SerializerUtil.kt:42 */
   19     26   
    {
          27  +
        /* JsonSerializerGenerator.kt:484 */
   20     28   
        let mut array_1 = object.key("flavorTextEntries").start_array();
          29  +
        /* JsonSerializerGenerator.kt:524 */
   21     30   
        for item_2 in &input.flavor_text_entries {
          31  +
            /* SerializerUtil.kt:42 */
   22     32   
            {
          33  +
                /* JsonSerializerGenerator.kt:495 */
   23     34   
                #[allow(unused_mut)]
          35  +
                /* JsonSerializerGenerator.kt:496 */
   24     36   
                let mut object_3 = array_1.value().start_object();
          37  +
                /* JsonSerializerGenerator.kt:375 */
   25     38   
                crate::protocol_serde::shape_flavor_text::ser_flavor_text(&mut object_3, item_2)?;
          39  +
                /* JsonSerializerGenerator.kt:515 */
   26     40   
                object_3.finish();
          41  +
                /* SerializerUtil.kt:42 */
   27     42   
            }
          43  +
            /* JsonSerializerGenerator.kt:524 */
   28     44   
        }
          45  +
        /* JsonSerializerGenerator.kt:486 */
   29     46   
        array_1.finish();
          47  +
        /* SerializerUtil.kt:42 */
   30     48   
    }
          49  +
    /* SerializerUtil.kt:42 */
   31     50   
    {
          51  +
        /* JsonSerializerGenerator.kt:423 */
   32     52   
        object.key("name").string(input.name.as_str());
          53  +
        /* SerializerUtil.kt:42 */
   33     54   
    }
          55  +
    /* JsonSerializerGenerator.kt:372 */
   34     56   
    Ok(())
          57  +
    /* JsonSerializerGenerator.kt:358 */
   35     58   
}

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

@@ -1,1 +92,130 @@
    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::rest_json_1::rejection::RequestRejection,
    8     10   
>
    9     11   
where
   10     12   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11     13   
    B::Data: Send,
   12     14   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
   13     15   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     16   
{
          17  +
    /* ServerHttpBoundProtocolGenerator.kt:399 */
   15     18   
    Ok({
          19  +
        /* RustType.kt:516 */
   16     20   
        #[allow(unused_mut)]
          21  +
        /* ServerHttpBoundProtocolGenerator.kt:723 */
   17     22   
        let mut input = crate::input::get_server_statistics_input_internal::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::rest_json_1::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/json",
   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   
}
   56     79   
          80  +
/* RustType.kt:516 */
   57     81   
#[allow(clippy::unnecessary_wraps)]
          82  +
/* ServerHttpBoundProtocolGenerator.kt:447 */
   58     83   
pub fn ser_get_server_statistics_http_error(
   59     84   
    error: &crate::error::GetServerStatisticsError,
   60     85   
) -> std::result::Result<
   61     86   
    ::aws_smithy_http_server::response::Response,
   62     87   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   63     88   
> {
          89  +
    /* ServerHttpBoundProtocolGenerator.kt:452 */
   64     90   
    Ok({
          91  +
        /* ServerHttpBoundProtocolGenerator.kt:468 */
   65     92   
        match error {
          93  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
   66     94   
            crate::error::GetServerStatisticsError::InternalServerError(output) => {
          95  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
   67     96   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
          97  +
                /* RustType.kt:516 */
   68     98   
                #[allow(unused_mut)]
          99  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
   69    100   
                let mut builder = ::http::Response::builder();
         101  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   70    102   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   71    103   
                    builder,
   72    104   
                    ::http::header::CONTENT_TYPE,
   73    105   
                    "application/json",
   74    106   
                );
         107  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   75    108   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   76    109   
                    builder,
   77    110   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
   78    111   
                    "InternalServerError",
   79    112   
                );
         113  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
   80    114   
                let content_length = payload.len();
   81    115   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   82    116   
                    builder,
   83    117   
                    ::http::header::CONTENT_LENGTH,
   84    118   
                    content_length,
   85    119   
                );
         120  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
   86    121   
                builder
   87    122   
                    .status(500)
   88    123   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
   89         -
            }
         124  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
         125  +
            } /* ServerHttpBoundProtocolGenerator.kt:468 */
   90    126   
        }
         127  +
        /* ServerHttpBoundProtocolGenerator.kt:452 */
   91    128   
    })
         129  +
    /* ServerHttpBoundProtocolGenerator.kt:447 */
   92    130   
}

tmp-codegen-diff/codegen-server-test-python/pokemon-service-server-sdk/rust-server-codegen-python/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-python/pokemon-service-server-sdk/rust-server-codegen-python/src/protocol_serde/shape_get_storage.rs

@@ -1,1 +187,255 @@
    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_storage_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::GetStorageInput,
    7      9   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
    8     10   
>
    9     11   
where
   10     12   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11     13   
    B::Data: Send,
   12     14   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
   13     15   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     16   
{
          17  +
    /* ServerHttpBoundProtocolGenerator.kt:399 */
   15     18   
    Ok({
          19  +
        /* RustType.kt:516 */
   16     20   
        #[allow(unused_mut)]
          21  +
        /* ServerHttpBoundProtocolGenerator.kt:723 */
   17     22   
        let mut input = crate::input::get_storage_input_internal::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:794 */
   22     30   
        if let Some(value) =
   23     31   
            crate::protocol_serde::shape_get_storage_input::de_passcode_header(&headers)?
   24     32   
        {
   25     33   
            input = input.set_passcode(value)
   26     34   
        }
          35  +
        /* ServerHttpBoundProtocolGenerator.kt:986 */
   27     36   
        let input_string = uri.path();
          37  +
        /* ServerHttpBoundProtocolGenerator.kt:998 */
   28     38   
        let (input_string, (_, m1)) =
   29     39   
            ::nom::sequence::tuple::<_, _, ::nom::error::Error<&str>, _>((
   30     40   
                ::nom::sequence::preceded(
   31     41   
                    ::nom::bytes::complete::tag("/"),
   32     42   
                    ::nom::bytes::complete::tag::<_, _, ::nom::error::Error<&str>>("pokedex"),
   33     43   
                ),
   34     44   
                ::nom::sequence::preceded(
   35     45   
                    ::nom::bytes::complete::tag("/"),
   36     46   
                    ::nom::branch::alt::<_, _, ::nom::error::Error<&str>, _>((
   37     47   
                        ::nom::bytes::complete::take_until("/"),
   38     48   
                        ::nom::combinator::rest,
   39     49   
                    )),
   40     50   
                ),
   41     51   
            ))(input_string)?;
   42     52   
        debug_assert_eq!("", input_string);
          53  +
        /* ServerHttpBoundProtocolGenerator.kt:1009 */
   43     54   
        input = input.set_user(crate::protocol_serde::shape_get_storage_input::de_user(m1)?);
          55  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   44     56   
        input.build()?
          57  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   45     58   
    })
          59  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   46     60   
}
   47     61   
          62  +
/* RustType.kt:516 */
   48     63   
#[allow(clippy::unnecessary_wraps)]
          64  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   49     65   
pub fn ser_get_storage_http_response(
   50     66   
    #[allow(unused_variables)] output: crate::output::GetStorageOutput,
   51     67   
) -> std::result::Result<
   52     68   
    ::aws_smithy_http_server::response::Response,
   53     69   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   54     70   
> {
          71  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   55     72   
    Ok({
          73  +
        /* RustType.kt:516 */
   56     74   
        #[allow(unused_mut)]
          75  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   57     76   
        let mut builder = ::http::Response::builder();
          77  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   58     78   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   59     79   
            builder,
   60     80   
            ::http::header::CONTENT_TYPE,
   61     81   
            "application/json",
   62     82   
        );
          83  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   63     84   
        let http_status: u16 = 200;
   64     85   
        builder = builder.status(http_status);
          86  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
   65     87   
        let payload =
   66         -
            crate::protocol_serde::shape_get_storage_output::ser_get_storage_output_output_output(
   67         -
                &output,
   68         -
            )?;
          88  +
            /* HttpBoundProtocolPayloadGenerator.kt:237 */crate::protocol_serde::shape_get_storage_output::ser_get_storage_output_output_output(&output)?
          89  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
          90  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   69     91   
        let content_length = payload.len();
   70     92   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   71     93   
            builder,
   72     94   
            ::http::header::CONTENT_LENGTH,
   73     95   
            content_length,
   74     96   
        );
          97  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   75     98   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          99  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   76    100   
        builder.body(body)?
         101  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   77    102   
    })
         103  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   78    104   
}
   79    105   
         106  +
/* RustType.kt:516 */
   80    107   
#[allow(clippy::unnecessary_wraps)]
         108  +
/* ServerHttpBoundProtocolGenerator.kt:447 */
   81    109   
pub fn ser_get_storage_http_error(
   82    110   
    error: &crate::error::GetStorageError,
   83    111   
) -> std::result::Result<
   84    112   
    ::aws_smithy_http_server::response::Response,
   85    113   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   86    114   
> {
         115  +
    /* ServerHttpBoundProtocolGenerator.kt:452 */
   87    116   
    Ok({
         117  +
        /* ServerHttpBoundProtocolGenerator.kt:468 */
   88    118   
        match error {
         119  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
   89    120   
            crate::error::GetStorageError::ValidationException(output) => {
         121  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
   90    122   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
         123  +
                /* RustType.kt:516 */
   91    124   
                #[allow(unused_mut)]
         125  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
   92    126   
                let mut builder = ::http::Response::builder();
         127  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   93    128   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   94    129   
                    builder,
   95    130   
                    ::http::header::CONTENT_TYPE,
   96    131   
                    "application/json",
   97    132   
                );
         133  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   98    134   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   99    135   
                    builder,
  100    136   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  101    137   
                    "ValidationException",
  102    138   
                );
         139  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  103    140   
                let content_length = payload.len();
  104    141   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  105    142   
                    builder,
  106    143   
                    ::http::header::CONTENT_LENGTH,
  107    144   
                    content_length,
  108    145   
                );
         146  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  109    147   
                builder
  110    148   
                    .status(400)
  111    149   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         150  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
  112    151   
            }
         152  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
  113    153   
            crate::error::GetStorageError::StorageAccessNotAuthorized(output) => {
         154  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
  114    155   
                let payload = crate::protocol_serde::shape_storage_access_not_authorized::ser_storage_access_not_authorized_error(output)?;
         156  +
                /* RustType.kt:516 */
  115    157   
                #[allow(unused_mut)]
         158  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
  116    159   
                let mut builder = ::http::Response::builder();
         160  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  117    161   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  118    162   
                    builder,
  119    163   
                    ::http::header::CONTENT_TYPE,
  120    164   
                    "application/json",
  121    165   
                );
         166  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  122    167   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  123    168   
                    builder,
  124    169   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  125    170   
                    "StorageAccessNotAuthorized",
  126    171   
                );
         172  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  127    173   
                let content_length = payload.len();
  128    174   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  129    175   
                    builder,
  130    176   
                    ::http::header::CONTENT_LENGTH,
  131    177   
                    content_length,
  132    178   
                );
         179  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  133    180   
                builder
  134    181   
                    .status(401)
  135    182   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         183  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
  136    184   
            }
         185  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
  137    186   
            crate::error::GetStorageError::ResourceNotFoundException(output) => {
         187  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
  138    188   
                let payload = crate::protocol_serde::shape_resource_not_found_exception::ser_resource_not_found_exception_error(output)?;
         189  +
                /* RustType.kt:516 */
  139    190   
                #[allow(unused_mut)]
         191  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
  140    192   
                let mut builder = ::http::Response::builder();
         193  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  141    194   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  142    195   
                    builder,
  143    196   
                    ::http::header::CONTENT_TYPE,
  144    197   
                    "application/json",
  145    198   
                );
         199  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  146    200   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  147    201   
                    builder,
  148    202   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  149    203   
                    "ResourceNotFoundException",
  150    204   
                );
         205  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  151    206   
                let content_length = payload.len();
  152    207   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  153    208   
                    builder,
  154    209   
                    ::http::header::CONTENT_LENGTH,
  155    210   
                    content_length,
  156    211   
                );
         212  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  157    213   
                builder
  158    214   
                    .status(404)
  159    215   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         216  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
  160    217   
            }
         218  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
  161    219   
            crate::error::GetStorageError::InternalServerError(output) => {
         220  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
  162    221   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
         222  +
                /* RustType.kt:516 */
  163    223   
                #[allow(unused_mut)]
         224  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
  164    225   
                let mut builder = ::http::Response::builder();
         226  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  165    227   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  166    228   
                    builder,
  167    229   
                    ::http::header::CONTENT_TYPE,
  168    230   
                    "application/json",
  169    231   
                );
         232  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  170    233   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  171    234   
                    builder,
  172    235   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  173    236   
                    "InternalServerError",
  174    237   
                );
         238  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  175    239   
                let content_length = payload.len();
  176    240   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  177    241   
                    builder,
  178    242   
                    ::http::header::CONTENT_LENGTH,
  179    243   
                    content_length,
  180    244   
                );
         245  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  181    246   
                builder
  182    247   
                    .status(500)
  183    248   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
  184         -
            }
         249  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
         250  +
            } /* ServerHttpBoundProtocolGenerator.kt:468 */
  185    251   
        }
         252  +
        /* ServerHttpBoundProtocolGenerator.kt:452 */
  186    253   
    })
         254  +
    /* ServerHttpBoundProtocolGenerator.kt:447 */
  187    255   
}

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

@@ -1,1 +22,30 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* HttpBindingGenerator.kt:153 */
    2      3   
pub(crate) fn de_passcode_header(
    3      4   
    header_map: &::aws_smithy_runtime_api::http::Headers,
    4      5   
) -> ::std::result::Result<
    5      6   
    ::std::option::Option<::std::string::String>,
    6      7   
    ::aws_smithy_http::header::ParseError,
    7      8   
> {
           9  +
    /* HttpBindingGenerator.kt:160 */
    8     10   
    let headers = header_map.get_all("passcode");
          11  +
    /* HttpBindingGenerator.kt:375 */
    9     12   
    ::aws_smithy_http::header::one_or_none(headers)
          13  +
    /* HttpBindingGenerator.kt:153 */
   10     14   
}
   11     15   
          16  +
/* ServerHttpBoundProtocolGenerator.kt:1292 */
   12     17   
pub fn de_user(
   13     18   
    value: &str,
   14     19   
) -> std::result::Result<
   15     20   
    ::std::string::String,
   16     21   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
   17     22   
> {
          23  +
    /* ServerHttpBoundProtocolGenerator.kt:1302 */
   18     24   
    let value = ::percent_encoding::percent_decode_str(value)
   19     25   
        .decode_utf8()?
   20     26   
        .into_owned();
          27  +
    /* ServerHttpBoundProtocolGenerator.kt:1357 */
   21     28   
    Ok(value)
          29  +
    /* ServerHttpBoundProtocolGenerator.kt:1292 */
   22     30   
}

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

@@ -1,1 +29,46 @@
    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_storage_output_output_output(
    3      4   
    value: &crate::output::GetStorageOutput,
    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_storage_output::ser_get_storage_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_get_storage_output_output(
   16     22   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   17     23   
    input: &crate::output::GetStorageOutput,
   18     24   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          25  +
    /* SerializerUtil.kt:42 */
   19     26   
    {
          27  +
        /* JsonSerializerGenerator.kt:484 */
   20     28   
        let mut array_1 = object.key("collection").start_array();
          29  +
        /* JsonSerializerGenerator.kt:524 */
   21     30   
        for item_2 in &input.collection {
          31  +
            /* SerializerUtil.kt:42 */
   22     32   
            {
          33  +
                /* JsonSerializerGenerator.kt:423 */
   23     34   
                array_1.value().string(item_2.as_str());
          35  +
                /* SerializerUtil.kt:42 */
   24     36   
            }
          37  +
            /* JsonSerializerGenerator.kt:524 */
   25     38   
        }
          39  +
        /* JsonSerializerGenerator.kt:486 */
   26     40   
        array_1.finish();
          41  +
        /* SerializerUtil.kt:42 */
   27     42   
    }
          43  +
    /* JsonSerializerGenerator.kt:372 */
   28     44   
    Ok(())
          45  +
    /* JsonSerializerGenerator.kt:358 */
   29     46   
}