Server Test

Server Test

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943 (ignoring whitespace)

Files changed:

tmp-codegen-diff/codegen-server-test/rpcv2Cbor/rust-server-codegen/src/protocol_serde/shape_fractional_seconds.rs

@@ -1,1 +60,84 @@
    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_fractional_seconds_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::FractionalSecondsInput,
    7      9   
    ::aws_smithy_http_server::protocol::rpc_v2_cbor::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::rpc_v2_cbor::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::fractional_seconds_input::Builder::default();
          23  +
        /* RustType.kt:516 */
   18     24   
        #[allow(unused_variables)]
          25  +
        /* ServerHttpBoundProtocolGenerator.kt:728 */
   19     26   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     27   
            uri, headers, body, ..
   21     28   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          29  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   22     30   
        input.build()
          31  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   23     32   
    })
          33  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   24     34   
}
   25     35   
          36  +
/* RustType.kt:516 */
   26     37   
#[allow(clippy::unnecessary_wraps)]
          38  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   27     39   
pub fn ser_fractional_seconds_http_response(
   28     40   
    #[allow(unused_variables)] output: crate::output::FractionalSecondsOutput,
   29     41   
) -> std::result::Result<
   30     42   
    ::aws_smithy_http_server::response::Response,
   31     43   
    ::aws_smithy_http_server::protocol::rpc_v2_cbor::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/cbor",
   40     56   
        );
          57  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   41     58   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   42     59   
            builder,
   43     60   
            ::http::header::HeaderName::from_static("smithy-protocol"),
   44     61   
            "rpc-v2-cbor",
   45     62   
        );
          63  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   46     64   
        let http_status: u16 = 200;
   47     65   
        builder = builder.status(http_status);
          66  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
   48     67   
        let payload =
   49         -
            crate::protocol_serde::shape_fractional_seconds_output::ser_fractional_seconds_output_output_output(&output)?
   50         -
        ;
          68  +
            /* HttpBoundProtocolPayloadGenerator.kt:237 */crate::protocol_serde::shape_fractional_seconds_output::ser_fractional_seconds_output_output_output(&output)?
          69  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
          70  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   51     71   
        let content_length = payload.len();
   52     72   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   53     73   
            builder,
   54     74   
            ::http::header::CONTENT_LENGTH,
   55     75   
            content_length,
   56     76   
        );
          77  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   57     78   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          79  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   58     80   
        builder.body(body)?
          81  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   59     82   
    })
          83  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   60     84   
}

tmp-codegen-diff/codegen-server-test/rpcv2Cbor/rust-server-codegen/src/protocol_serde/shape_fractional_seconds_output.rs

@@ -1,1 +26,42 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* CborSerializerGenerator.kt:228 */
    2      3   
pub fn ser_fractional_seconds_output_output_output(
    3      4   
    value: &crate::output::FractionalSecondsOutput,
    4      5   
) -> ::std::result::Result<
    5      6   
    ::std::vec::Vec<u8>,
    6      7   
    ::aws_smithy_types::error::operation::SerializationError,
    7      8   
> {
           9  +
    /* CborSerializerGenerator.kt:233 */
    8     10   
    let mut encoder = ::aws_smithy_cbor::Encoder::new(::std::vec::Vec::new());
          11  +
    /* CborSerializerGenerator.kt:235 */
    9     12   
    {
          13  +
        /* CborSerializerGenerator.kt:236 */
   10     14   
        let encoder = &mut encoder;
          15  +
        /* CborSerializerGenerator.kt:403 */
   11     16   
        crate::protocol_serde::shape_fractional_seconds_output::ser_fractional_seconds_output_output(encoder, value )?;
          17  +
        /* CborSerializerGenerator.kt:235 */
   12     18   
    }
          19  +
    /* CborSerializerGenerator.kt:242 */
   13     20   
    ::std::result::Result::Ok(encoder.into_writer())
          21  +
    /* CborSerializerGenerator.kt:228 */
   14     22   
}
   15     23   
          24  +
/* CborSerializerGenerator.kt:369 */
   16     25   
pub fn ser_fractional_seconds_output_output(
   17     26   
    encoder: &mut ::aws_smithy_cbor::Encoder,
   18     27   
    #[allow(unused)] input: &crate::output::FractionalSecondsOutput,
   19     28   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          29  +
    /* CborSerializerGenerator.kt:377 */
   20     30   
    encoder.begin_map();
          31  +
    /* CborSerializerGenerator.kt:414 */
   21     32   
    if let Some(var_1) = &input.datetime {
          33  +
        /* CborSerializerGenerator.kt:472 */
   22     34   
        encoder.str("datetime").timestamp(var_1);
          35  +
        /* CborSerializerGenerator.kt:414 */
   23     36   
    }
          37  +
    /* CborSerializerGenerator.kt:393 */
   24     38   
    encoder.end();
          39  +
    /* CborSerializerGenerator.kt:394 */
   25     40   
    Ok(())
          41  +
    /* CborSerializerGenerator.kt:369 */
   26     42   
}

tmp-codegen-diff/codegen-server-test/rpcv2Cbor/rust-server-codegen/src/protocol_serde/shape_greeting_struct.rs

@@ -1,1 +64,79 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* CborParserGenerator.kt:692 */
    2      3   
pub(crate) fn de_greeting_struct(
    3      4   
    decoder: &mut ::aws_smithy_cbor::Decoder,
    4      5   
) -> ::std::result::Result<crate::model::GreetingStruct, ::aws_smithy_cbor::decode::DeserializeError>
    5      6   
{
           7  +
    /* CborParserGenerator.kt:700 */
    6      8   
    #[allow(clippy::match_single_binding)]
    7      9   
    fn pair(
    8     10   
        mut builder: crate::model::greeting_struct::Builder,
    9     11   
        decoder: &mut ::aws_smithy_cbor::Decoder,
   10     12   
    ) -> ::std::result::Result<
   11     13   
        crate::model::greeting_struct::Builder,
   12     14   
        ::aws_smithy_cbor::decode::DeserializeError,
   13     15   
    > {
   14     16   
        builder = match decoder.str()?.as_ref() {
   15     17   
            "hi" => {
   16     18   
                ::aws_smithy_cbor::decode::set_optional(builder, decoder, |builder, decoder| {
   17     19   
                    Ok(builder.set_hi(Some(decoder.string()?)))
   18     20   
                })?
   19     21   
            }
   20     22   
            _ => {
   21     23   
                decoder.skip()?;
   22     24   
                builder
   23     25   
            }
   24     26   
        };
   25     27   
        Ok(builder)
   26     28   
    }
   27     29   
   28     30   
    let mut builder = crate::model::greeting_struct::Builder::default();
   29     31   
   30     32   
    match decoder.map()? {
   31     33   
        None => loop {
   32     34   
            match decoder.datatype()? {
   33     35   
                ::aws_smithy_cbor::data::Type::Break => {
   34     36   
                    decoder.skip()?;
   35     37   
                    break;
   36     38   
                }
   37     39   
                _ => {
   38     40   
                    builder = pair(builder, decoder)?;
   39     41   
                }
   40     42   
            };
   41     43   
        },
   42     44   
        Some(n) => {
   43     45   
            for _ in 0..n {
   44     46   
                builder = pair(builder, decoder)?;
   45     47   
            }
   46     48   
        }
   47     49   
    };
          50  +
    /* CborParserGenerator.kt:726 */
   48     51   
    #[allow(clippy::needless_question_mark)]
          52  +
    /* CborParserGenerator.kt:727 */
   49     53   
    {
          54  +
        /* CborParserGenerator.kt:728 */
   50     55   
        return Ok(builder.build());
          56  +
        /* CborParserGenerator.kt:727 */
   51     57   
    }
          58  +
    /* CborParserGenerator.kt:692 */
   52     59   
}
   53     60   
          61  +
/* CborSerializerGenerator.kt:369 */
   54     62   
pub fn ser_greeting_struct(
   55     63   
    encoder: &mut ::aws_smithy_cbor::Encoder,
   56     64   
    #[allow(unused)] input: &crate::model::GreetingStruct,
   57     65   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          66  +
    /* CborSerializerGenerator.kt:377 */
   58     67   
    encoder.begin_map();
          68  +
    /* CborSerializerGenerator.kt:414 */
   59     69   
    if let Some(var_1) = &input.hi {
          70  +
        /* CborSerializerGenerator.kt:462 */
   60     71   
        encoder.str("hi").str(var_1.as_str());
          72  +
        /* CborSerializerGenerator.kt:414 */
   61     73   
    }
          74  +
    /* CborSerializerGenerator.kt:393 */
   62     75   
    encoder.end();
          76  +
    /* CborSerializerGenerator.kt:394 */
   63     77   
    Ok(())
          78  +
    /* CborSerializerGenerator.kt:369 */
   64     79   
}

tmp-codegen-diff/codegen-server-test/rpcv2Cbor/rust-server-codegen/src/protocol_serde/shape_greeting_with_errors.rs

@@ -1,1 +125,173 @@
    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_greeting_with_errors_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::GreetingWithErrorsInput,
    7      9   
    ::aws_smithy_http_server::protocol::rpc_v2_cbor::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::rpc_v2_cbor::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::greeting_with_errors_input::Builder::default();
          23  +
        /* RustType.kt:516 */
   18     24   
        #[allow(unused_variables)]
          25  +
        /* ServerHttpBoundProtocolGenerator.kt:728 */
   19     26   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     27   
            uri, headers, body, ..
   21     28   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          29  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   22     30   
        input.build()
          31  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   23     32   
    })
          33  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   24     34   
}
   25     35   
          36  +
/* RustType.kt:516 */
   26     37   
#[allow(clippy::unnecessary_wraps)]
          38  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   27     39   
pub fn ser_greeting_with_errors_http_response(
   28     40   
    #[allow(unused_variables)] output: crate::output::GreetingWithErrorsOutput,
   29     41   
) -> std::result::Result<
   30     42   
    ::aws_smithy_http_server::response::Response,
   31     43   
    ::aws_smithy_http_server::protocol::rpc_v2_cbor::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/cbor",
   40     56   
        );
          57  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   41     58   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   42     59   
            builder,
   43     60   
            ::http::header::HeaderName::from_static("smithy-protocol"),
   44     61   
            "rpc-v2-cbor",
   45     62   
        );
          63  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   46     64   
        let http_status: u16 = 200;
   47     65   
        builder = builder.status(http_status);
          66  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
   48     67   
        let payload =
   49         -
            crate::protocol_serde::shape_greeting_with_errors_output::ser_greeting_with_errors_output_output_output(&output)?
   50         -
        ;
          68  +
            /* HttpBoundProtocolPayloadGenerator.kt:237 */crate::protocol_serde::shape_greeting_with_errors_output::ser_greeting_with_errors_output_output_output(&output)?
          69  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
          70  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   51     71   
        let content_length = payload.len();
   52     72   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   53     73   
            builder,
   54     74   
            ::http::header::CONTENT_LENGTH,
   55     75   
            content_length,
   56     76   
        );
          77  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   57     78   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          79  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   58     80   
        builder.body(body)?
          81  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   59     82   
    })
          83  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   60     84   
}
   61     85   
          86  +
/* RustType.kt:516 */
   62     87   
#[allow(clippy::unnecessary_wraps)]
          88  +
/* ServerHttpBoundProtocolGenerator.kt:447 */
   63     89   
pub fn ser_greeting_with_errors_http_error(
   64     90   
    error: &crate::error::GreetingWithErrorsError,
   65     91   
) -> std::result::Result<
   66     92   
    ::aws_smithy_http_server::response::Response,
   67     93   
    ::aws_smithy_http_server::protocol::rpc_v2_cbor::rejection::ResponseRejection,
   68     94   
> {
          95  +
    /* ServerHttpBoundProtocolGenerator.kt:452 */
   69     96   
    Ok({
          97  +
        /* ServerHttpBoundProtocolGenerator.kt:468 */
   70     98   
        match error {
          99  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
   71    100   
            crate::error::GreetingWithErrorsError::InvalidGreeting(output) => {
         101  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
   72    102   
                let payload =
   73    103   
                    crate::protocol_serde::shape_invalid_greeting::ser_invalid_greeting_error(
   74    104   
                        output,
   75    105   
                    )?;
         106  +
                /* RustType.kt:516 */
   76    107   
                #[allow(unused_mut)]
         108  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
   77    109   
                let mut builder = ::http::Response::builder();
         110  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   78    111   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   79    112   
                    builder,
   80    113   
                    ::http::header::CONTENT_TYPE,
   81    114   
                    "application/cbor",
   82    115   
                );
         116  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   83    117   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   84    118   
                    builder,
   85    119   
                    ::http::header::HeaderName::from_static("smithy-protocol"),
   86    120   
                    "rpc-v2-cbor",
   87    121   
                );
         122  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
   88    123   
                let content_length = payload.len();
   89    124   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   90    125   
                    builder,
   91    126   
                    ::http::header::CONTENT_LENGTH,
   92    127   
                    content_length,
   93    128   
                );
         129  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
   94    130   
                builder
   95    131   
                    .status(400)
   96    132   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         133  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
   97    134   
            }
         135  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
   98    136   
            crate::error::GreetingWithErrorsError::ComplexError(output) => {
         137  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
   99    138   
                let payload =
  100    139   
                    crate::protocol_serde::shape_complex_error::ser_complex_error_error(output)?;
         140  +
                /* RustType.kt:516 */
  101    141   
                #[allow(unused_mut)]
         142  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
  102    143   
                let mut builder = ::http::Response::builder();
         144  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  103    145   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  104    146   
                    builder,
  105    147   
                    ::http::header::CONTENT_TYPE,
  106    148   
                    "application/cbor",
  107    149   
                );
         150  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  108    151   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  109    152   
                    builder,
  110    153   
                    ::http::header::HeaderName::from_static("smithy-protocol"),
  111    154   
                    "rpc-v2-cbor",
  112    155   
                );
         156  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  113    157   
                let content_length = payload.len();
  114    158   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  115    159   
                    builder,
  116    160   
                    ::http::header::CONTENT_LENGTH,
  117    161   
                    content_length,
  118    162   
                );
         163  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  119    164   
                builder
  120    165   
                    .status(400)
  121    166   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         167  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
         168  +
            } /* ServerHttpBoundProtocolGenerator.kt:468 */
  122    169   
        }
  123         -
        }
         170  +
        /* ServerHttpBoundProtocolGenerator.kt:452 */
  124    171   
    })
         172  +
    /* ServerHttpBoundProtocolGenerator.kt:447 */
  125    173   
}

tmp-codegen-diff/codegen-server-test/rpcv2Cbor/rust-server-codegen/src/protocol_serde/shape_greeting_with_errors_output.rs

@@ -1,1 +26,42 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* CborSerializerGenerator.kt:228 */
    2      3   
pub fn ser_greeting_with_errors_output_output_output(
    3      4   
    value: &crate::output::GreetingWithErrorsOutput,
    4      5   
) -> ::std::result::Result<
    5      6   
    ::std::vec::Vec<u8>,
    6      7   
    ::aws_smithy_types::error::operation::SerializationError,
    7      8   
> {
           9  +
    /* CborSerializerGenerator.kt:233 */
    8     10   
    let mut encoder = ::aws_smithy_cbor::Encoder::new(::std::vec::Vec::new());
          11  +
    /* CborSerializerGenerator.kt:235 */
    9     12   
    {
          13  +
        /* CborSerializerGenerator.kt:236 */
   10     14   
        let encoder = &mut encoder;
          15  +
        /* CborSerializerGenerator.kt:403 */
   11     16   
        crate::protocol_serde::shape_greeting_with_errors_output::ser_greeting_with_errors_output_output(encoder, value )?;
          17  +
        /* CborSerializerGenerator.kt:235 */
   12     18   
    }
          19  +
    /* CborSerializerGenerator.kt:242 */
   13     20   
    ::std::result::Result::Ok(encoder.into_writer())
          21  +
    /* CborSerializerGenerator.kt:228 */
   14     22   
}
   15     23   
          24  +
/* CborSerializerGenerator.kt:369 */
   16     25   
pub fn ser_greeting_with_errors_output_output(
   17     26   
    encoder: &mut ::aws_smithy_cbor::Encoder,
   18     27   
    #[allow(unused)] input: &crate::output::GreetingWithErrorsOutput,
   19     28   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          29  +
    /* CborSerializerGenerator.kt:377 */
   20     30   
    encoder.begin_map();
          31  +
    /* CborSerializerGenerator.kt:414 */
   21     32   
    if let Some(var_1) = &input.greeting {
          33  +
        /* CborSerializerGenerator.kt:462 */
   22     34   
        encoder.str("greeting").str(var_1.as_str());
          35  +
        /* CborSerializerGenerator.kt:414 */
   23     36   
    }
          37  +
    /* CborSerializerGenerator.kt:393 */
   24     38   
    encoder.end();
          39  +
    /* CborSerializerGenerator.kt:394 */
   25     40   
    Ok(())
          41  +
    /* CborSerializerGenerator.kt:369 */
   26     42   
}

tmp-codegen-diff/codegen-server-test/rpcv2Cbor/rust-server-codegen/src/protocol_serde/shape_integer_enum_list.rs

@@ -1,1 +31,32 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* CborParserGenerator.kt:616 */
    2      3   
pub(crate) fn de_integer_enum_list(
    3      4   
    decoder: &mut ::aws_smithy_cbor::Decoder,
    4      5   
) -> ::std::result::Result<::std::vec::Vec<i32>, ::aws_smithy_cbor::decode::DeserializeError> {
    5      6   
    fn member(
    6      7   
        mut list: ::std::vec::Vec<i32>,
    7      8   
        decoder: &mut ::aws_smithy_cbor::Decoder,
    8      9   
    ) -> ::std::result::Result<::std::vec::Vec<i32>, ::aws_smithy_cbor::decode::DeserializeError>
    9     10   
    {
   10     11   
        let value = match decoder.datatype()? {
   11     12   
            ::aws_smithy_cbor::data::Type::Null => {

tmp-codegen-diff/codegen-server-test/rpcv2Cbor/rust-server-codegen/src/protocol_serde/shape_integer_list.rs

@@ -1,1 +31,32 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* CborParserGenerator.kt:616 */
    2      3   
pub(crate) fn de_integer_list(
    3      4   
    decoder: &mut ::aws_smithy_cbor::Decoder,
    4      5   
) -> ::std::result::Result<::std::vec::Vec<i32>, ::aws_smithy_cbor::decode::DeserializeError> {
    5      6   
    fn member(
    6      7   
        mut list: ::std::vec::Vec<i32>,
    7      8   
        decoder: &mut ::aws_smithy_cbor::Decoder,
    8      9   
    ) -> ::std::result::Result<::std::vec::Vec<i32>, ::aws_smithy_cbor::decode::DeserializeError>
    9     10   
    {
   10     11   
        let value = match decoder.datatype()? {
   11     12   
            ::aws_smithy_cbor::data::Type::Null => {

tmp-codegen-diff/codegen-server-test/rpcv2Cbor/rust-server-codegen/src/protocol_serde/shape_invalid_greeting.rs

@@ -1,1 +29,46 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* CborSerializerGenerator.kt:228 */
    2      3   
pub fn ser_invalid_greeting_error(
    3      4   
    value: &crate::error::InvalidGreeting,
    4      5   
) -> ::std::result::Result<
    5      6   
    ::std::vec::Vec<u8>,
    6      7   
    ::aws_smithy_types::error::operation::SerializationError,
    7      8   
> {
           9  +
    /* CborSerializerGenerator.kt:233 */
    8     10   
    let mut encoder = ::aws_smithy_cbor::Encoder::new(::std::vec::Vec::new());
          11  +
    /* CborSerializerGenerator.kt:235 */
    9     12   
    {
          13  +
        /* CborSerializerGenerator.kt:236 */
   10     14   
        let encoder = &mut encoder;
          15  +
        /* CborSerializerGenerator.kt:403 */
   11     16   
        crate::protocol_serde::shape_invalid_greeting::ser_invalid_greeting(encoder, value)?;
          17  +
        /* CborSerializerGenerator.kt:235 */
   12     18   
    }
          19  +
    /* CborSerializerGenerator.kt:242 */
   13     20   
    ::std::result::Result::Ok(encoder.into_writer())
          21  +
    /* CborSerializerGenerator.kt:228 */
   14     22   
}
   15     23   
          24  +
/* CborSerializerGenerator.kt:369 */
   16     25   
pub fn ser_invalid_greeting(
   17     26   
    encoder: &mut ::aws_smithy_cbor::Encoder,
   18     27   
    #[allow(unused)] input: &crate::error::InvalidGreeting,
   19     28   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          29  +
    /* CborSerializerGenerator.kt:377 */
   20     30   
    encoder.begin_map();
          31  +
    /* AddTypeFieldToServerErrorsCborCustomization.kt:47 */
   21     32   
    encoder
   22     33   
        .str("__type")
   23     34   
        .str("smithy.protocoltests.rpcv2Cbor#InvalidGreeting");
          35  +
    /* CborSerializerGenerator.kt:414 */
   24     36   
    if let Some(var_1) = &input.message {
          37  +
        /* CborSerializerGenerator.kt:462 */
   25     38   
        encoder.str("Message").str(var_1.as_str());
          39  +
        /* CborSerializerGenerator.kt:414 */
   26     40   
    }
          41  +
    /* CborSerializerGenerator.kt:393 */
   27     42   
    encoder.end();
          43  +
    /* CborSerializerGenerator.kt:394 */
   28     44   
    Ok(())
          45  +
    /* CborSerializerGenerator.kt:369 */
   29     46   
}

tmp-codegen-diff/codegen-server-test/rpcv2Cbor/rust-server-codegen/src/protocol_serde/shape_nested_string_list.rs

@@ -1,1 +31,32 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* CborParserGenerator.kt:616 */
    2      3   
pub(crate) fn de_nested_string_list(
    3      4   
    decoder: &mut ::aws_smithy_cbor::Decoder,
    4      5   
) -> ::std::result::Result<
    5      6   
    ::std::vec::Vec<::std::vec::Vec<::std::string::String>>,
    6      7   
    ::aws_smithy_cbor::decode::DeserializeError,
    7      8   
> {
    8      9   
    fn member(
    9     10   
        mut list: ::std::vec::Vec<::std::vec::Vec<::std::string::String>>,
   10     11   
        decoder: &mut ::aws_smithy_cbor::Decoder,
   11     12   
    ) -> ::std::result::Result<

tmp-codegen-diff/codegen-server-test/rpcv2Cbor/rust-server-codegen/src/protocol_serde/shape_no_input_output.rs

@@ -1,1 +53,78 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:516 */
    2      3   
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ServerHttpBoundProtocolGenerator.kt:383 */
    3      5   
pub async fn de_no_input_output_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::NoInputOutputInput,
    7      9   
    ::aws_smithy_http_server::protocol::rpc_v2_cbor::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::rpc_v2_cbor::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::no_input_output_input::Builder::default();
          23  +
        /* RustType.kt:516 */
   18     24   
        #[allow(unused_variables)]
          25  +
        /* ServerHttpBoundProtocolGenerator.kt:728 */
   19     26   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     27   
            uri, headers, body, ..
   21     28   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          29  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   22     30   
        input.build()
          31  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   23     32   
    })
          33  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   24     34   
}
   25     35   
          36  +
/* RustType.kt:516 */
   26     37   
#[allow(clippy::unnecessary_wraps)]
          38  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   27     39   
pub fn ser_no_input_output_http_response(
   28     40   
    #[allow(unused_variables)] output: crate::output::NoInputOutputOutput,
   29     41   
) -> std::result::Result<
   30     42   
    ::aws_smithy_http_server::response::Response,
   31     43   
    ::aws_smithy_http_server::protocol::rpc_v2_cbor::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::HeaderName::from_static("smithy-protocol"),
   39     55   
            "rpc-v2-cbor",
   40     56   
        );
          57  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   41     58   
        let http_status: u16 = 200;
   42     59   
        builder = builder.status(http_status);
   43         -
        let payload = "";
          60  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
          61  +
        let payload =
          62  +
            /* HttpBoundProtocolPayloadGenerator.kt:235 */""
          63  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
          64  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   44     65   
        let content_length = payload.len();
   45     66   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   46     67   
            builder,
   47     68   
            ::http::header::CONTENT_LENGTH,
   48     69   
            content_length,
   49     70   
        );
          71  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   50     72   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          73  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   51     74   
        builder.body(body)?
          75  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   52     76   
    })
          77  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   53     78   
}

tmp-codegen-diff/codegen-server-test/rpcv2Cbor/rust-server-codegen/src/protocol_serde/shape_operation_with_defaults.rs

@@ -1,1 +140,184 @@
    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_operation_with_defaults_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::OperationWithDefaultsInput,
    7      9   
    ::aws_smithy_http_server::protocol::rpc_v2_cbor::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::rpc_v2_cbor::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::operation_with_defaults_input::Builder::default();
          23  +
        /* RustType.kt:516 */
   18     24   
        #[allow(unused_variables)]
          25  +
        /* ServerHttpBoundProtocolGenerator.kt:728 */
   19     26   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     27   
            uri, headers, body, ..
   21     28   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          29  +
        /* ServerHttpBoundProtocolGenerator.kt:745 */
   22     30   
        let bytes = ::hyper::body::to_bytes(body).await?;
          31  +
        /* ServerHttpBoundProtocolGenerator.kt:768 */
   23     32   
        if !bytes.is_empty() {
          33  +
            /* ServerHttpBoundProtocolGenerator.kt:769 */
   24     34   
            ::aws_smithy_http_server::protocol::content_type_header_classifier_smithy(
   25     35   
                &headers,
   26     36   
                Some("application/cbor"),
   27     37   
            )?;
   28     38   
            input =
   29     39   
                crate::protocol_serde::shape_operation_with_defaults::de_operation_with_defaults(
   30     40   
                    bytes.as_ref(),
   31     41   
                    input,
   32     42   
                )?;
          43  +
            /* ServerHttpBoundProtocolGenerator.kt:768 */
   33     44   
        }
          45  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   34     46   
        input.build()?
          47  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   35     48   
    })
          49  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   36     50   
}
   37     51   
          52  +
/* RustType.kt:516 */
   38     53   
#[allow(clippy::unnecessary_wraps)]
          54  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   39     55   
pub fn ser_operation_with_defaults_http_response(
   40     56   
    #[allow(unused_variables)] output: crate::output::OperationWithDefaultsOutput,
   41     57   
) -> std::result::Result<
   42     58   
    ::aws_smithy_http_server::response::Response,
   43     59   
    ::aws_smithy_http_server::protocol::rpc_v2_cbor::rejection::ResponseRejection,
   44     60   
> {
          61  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   45     62   
    Ok({
          63  +
        /* RustType.kt:516 */
   46     64   
        #[allow(unused_mut)]
          65  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   47     66   
        let mut builder = ::http::Response::builder();
          67  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   48     68   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   49     69   
            builder,
   50     70   
            ::http::header::CONTENT_TYPE,
   51     71   
            "application/cbor",
   52     72   
        );
          73  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   53     74   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   54     75   
            builder,
   55     76   
            ::http::header::HeaderName::from_static("smithy-protocol"),
   56     77   
            "rpc-v2-cbor",
   57     78   
        );
          79  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   58     80   
        let http_status: u16 = 200;
   59     81   
        builder = builder.status(http_status);
          82  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
   60     83   
        let payload =
   61         -
            crate::protocol_serde::shape_operation_with_defaults_output::ser_operation_with_defaults_output_output_output(&output)?
   62         -
        ;
          84  +
            /* HttpBoundProtocolPayloadGenerator.kt:237 */crate::protocol_serde::shape_operation_with_defaults_output::ser_operation_with_defaults_output_output_output(&output)?
          85  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
          86  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   63     87   
        let content_length = payload.len();
   64     88   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   65     89   
            builder,
   66     90   
            ::http::header::CONTENT_LENGTH,
   67     91   
            content_length,
   68     92   
        );
          93  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   69     94   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          95  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   70     96   
        builder.body(body)?
          97  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   71     98   
    })
          99  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   72    100   
}
   73    101   
         102  +
/* RustType.kt:516 */
   74    103   
#[allow(clippy::unnecessary_wraps)]
         104  +
/* ServerHttpBoundProtocolGenerator.kt:447 */
   75    105   
pub fn ser_operation_with_defaults_http_error(
   76    106   
    error: &crate::error::OperationWithDefaultsError,
   77    107   
) -> std::result::Result<
   78    108   
    ::aws_smithy_http_server::response::Response,
   79    109   
    ::aws_smithy_http_server::protocol::rpc_v2_cbor::rejection::ResponseRejection,
   80    110   
> {
         111  +
    /* ServerHttpBoundProtocolGenerator.kt:452 */
   81    112   
    Ok({
         113  +
        /* ServerHttpBoundProtocolGenerator.kt:468 */
   82    114   
        match error {
         115  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
   83    116   
            crate::error::OperationWithDefaultsError::ValidationException(output) => {
         117  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
   84    118   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
         119  +
                /* RustType.kt:516 */
   85    120   
                #[allow(unused_mut)]
         121  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
   86    122   
                let mut builder = ::http::Response::builder();
         123  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   87    124   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   88    125   
                    builder,
   89    126   
                    ::http::header::CONTENT_TYPE,
   90    127   
                    "application/cbor",
   91    128   
                );
         129  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   92    130   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   93    131   
                    builder,
   94    132   
                    ::http::header::HeaderName::from_static("smithy-protocol"),
   95    133   
                    "rpc-v2-cbor",
   96    134   
                );
         135  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
   97    136   
                let content_length = payload.len();
   98    137   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   99    138   
                    builder,
  100    139   
                    ::http::header::CONTENT_LENGTH,
  101    140   
                    content_length,
  102    141   
                );
         142  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  103    143   
                builder
  104    144   
                    .status(400)
  105    145   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         146  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
         147  +
            } /* ServerHttpBoundProtocolGenerator.kt:468 */
  106    148   
        }
  107         -
        }
         149  +
        /* ServerHttpBoundProtocolGenerator.kt:452 */
  108    150   
    })
         151  +
    /* ServerHttpBoundProtocolGenerator.kt:447 */
  109    152   
}
  110    153   
         154  +
/* CborParserGenerator.kt:482 */
  111    155   
pub(crate) fn de_operation_with_defaults(
  112    156   
    value: &[u8],
  113    157   
    mut builder: crate::input::operation_with_defaults_input::Builder,
  114    158   
) -> ::std::result::Result<
  115    159   
    crate::input::operation_with_defaults_input::Builder,
  116    160   
    ::aws_smithy_cbor::decode::DeserializeError,
  117    161   
> {
  118    162   
    #[allow(clippy::match_single_binding)]
  119    163   
    fn pair(
  120    164   
        mut builder: crate::input::operation_with_defaults_input::Builder,

tmp-codegen-diff/codegen-server-test/rpcv2Cbor/rust-server-codegen/src/protocol_serde/shape_operation_with_defaults_output.rs

@@ -1,1 +110,204 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* CborSerializerGenerator.kt:228 */
    2      3   
pub fn ser_operation_with_defaults_output_output_output(
    3      4   
    value: &crate::output::OperationWithDefaultsOutput,
    4      5   
) -> ::std::result::Result<
    5      6   
    ::std::vec::Vec<u8>,
    6      7   
    ::aws_smithy_types::error::operation::SerializationError,
    7      8   
> {
           9  +
    /* CborSerializerGenerator.kt:233 */
    8     10   
    let mut encoder = ::aws_smithy_cbor::Encoder::new(::std::vec::Vec::new());
          11  +
    /* CborSerializerGenerator.kt:235 */
    9     12   
    {
          13  +
        /* CborSerializerGenerator.kt:236 */
   10     14   
        let encoder = &mut encoder;
          15  +
        /* CborSerializerGenerator.kt:403 */
   11     16   
        crate::protocol_serde::shape_operation_with_defaults_output::ser_operation_with_defaults_output_output(encoder, value )?;
          17  +
        /* CborSerializerGenerator.kt:235 */
   12     18   
    }
          19  +
    /* CborSerializerGenerator.kt:242 */
   13     20   
    ::std::result::Result::Ok(encoder.into_writer())
          21  +
    /* CborSerializerGenerator.kt:228 */
   14     22   
}
   15     23   
          24  +
/* CborSerializerGenerator.kt:369 */
   16     25   
pub fn ser_operation_with_defaults_output_output(
   17     26   
    encoder: &mut ::aws_smithy_cbor::Encoder,
   18     27   
    #[allow(unused)] input: &crate::output::OperationWithDefaultsOutput,
   19     28   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          29  +
    /* CborSerializerGenerator.kt:377 */
   20     30   
    encoder.begin_map();
          31  +
    /* SerializerUtil.kt:46 */
   21     32   
    {
          33  +
        /* CborSerializerGenerator.kt:462 */
   22     34   
        encoder
   23     35   
            .str("defaultString")
   24     36   
            .str(input.default_string.as_str());
          37  +
        /* SerializerUtil.kt:46 */
   25     38   
    }
          39  +
    /* SerializerUtil.kt:46 */
   26     40   
    {
          41  +
        /* CborSerializerGenerator.kt:460 */
   27     42   
        encoder.str("defaultBoolean").boolean(input.default_boolean);
          43  +
        /* SerializerUtil.kt:46 */
   28     44   
    }
          45  +
    /* SerializerUtil.kt:46 */
   29     46   
    {
          47  +
        /* CborSerializerGenerator.kt:486 */
   30     48   
        encoder.str("defaultList");
          49  +
        /* CborSerializerGenerator.kt:504 */
   31     50   
        encoder.array((input.default_list).len());
          51  +
        /* CborSerializerGenerator.kt:506 */
   32     52   
        for item_1 in &input.default_list {
          53  +
            /* SerializerUtil.kt:42 */
   33     54   
            {
          55  +
                /* CborSerializerGenerator.kt:462 */
   34     56   
                encoder.str(item_1.as_str());
          57  +
                /* SerializerUtil.kt:42 */
   35     58   
            }
          59  +
            /* CborSerializerGenerator.kt:506 */
   36     60   
        }
          61  +
        /* SerializerUtil.kt:46 */
   37     62   
    }
          63  +
    /* SerializerUtil.kt:46 */
   38     64   
    {
          65  +
        /* CborSerializerGenerator.kt:472 */
   39     66   
        encoder
   40     67   
            .str("defaultTimestamp")
   41     68   
            .timestamp(&input.default_timestamp);
          69  +
        /* SerializerUtil.kt:46 */
   42     70   
    }
          71  +
    /* SerializerUtil.kt:46 */
   43     72   
    {
          73  +
        /* CborSerializerGenerator.kt:459 */
   44     74   
        encoder.str("defaultBlob").blob(&input.default_blob);
          75  +
        /* SerializerUtil.kt:46 */
   45     76   
    }
          77  +
    /* SerializerUtil.kt:46 */
   46     78   
    {
          79  +
        /* CborSerializerGenerator.kt:464 */
   47     80   
        encoder.str("defaultByte").byte(input.default_byte);
          81  +
        /* SerializerUtil.kt:46 */
   48     82   
    }
          83  +
    /* SerializerUtil.kt:46 */
   49     84   
    {
          85  +
        /* CborSerializerGenerator.kt:465 */
   50     86   
        encoder.str("defaultShort").short(input.default_short);
          87  +
        /* SerializerUtil.kt:46 */
   51     88   
    }
          89  +
    /* SerializerUtil.kt:46 */
   52     90   
    {
          91  +
        /* CborSerializerGenerator.kt:466 */
   53     92   
        encoder.str("defaultInteger").integer(input.default_integer);
          93  +
        /* SerializerUtil.kt:46 */
   54     94   
    }
          95  +
    /* SerializerUtil.kt:46 */
   55     96   
    {
          97  +
        /* CborSerializerGenerator.kt:467 */
   56     98   
        encoder.str("defaultLong").long(input.default_long);
          99  +
        /* SerializerUtil.kt:46 */
   57    100   
    }
         101  +
    /* SerializerUtil.kt:46 */
   58    102   
    {
         103  +
        /* CborSerializerGenerator.kt:469 */
   59    104   
        encoder.str("defaultFloat").float(input.default_float);
         105  +
        /* SerializerUtil.kt:46 */
   60    106   
    }
         107  +
    /* SerializerUtil.kt:46 */
   61    108   
    {
         109  +
        /* CborSerializerGenerator.kt:470 */
   62    110   
        encoder.str("defaultDouble").double(input.default_double);
         111  +
        /* SerializerUtil.kt:46 */
   63    112   
    }
         113  +
    /* SerializerUtil.kt:46 */
   64    114   
    {
         115  +
        /* CborSerializerGenerator.kt:486 */
   65    116   
        encoder.str("defaultMap");
         117  +
        /* CborSerializerGenerator.kt:517 */
   66    118   
        encoder.map((input.default_map).len());
         119  +
        /* CborSerializerGenerator.kt:518 */
   67    120   
        for (key_2, value_3) in &input.default_map {
         121  +
            /* SerializerUtil.kt:42 */
   68    122   
            {
         123  +
                /* CborSerializerGenerator.kt:462 */
   69    124   
                encoder.str(key_2.as_str()).str(value_3.as_str());
         125  +
                /* SerializerUtil.kt:42 */
   70    126   
            }
         127  +
            /* CborSerializerGenerator.kt:518 */
   71    128   
        }
         129  +
        /* SerializerUtil.kt:46 */
   72    130   
    }
         131  +
    /* SerializerUtil.kt:46 */
   73    132   
    {
         133  +
        /* CborSerializerGenerator.kt:462 */
   74    134   
        encoder.str("defaultEnum").str(input.default_enum.as_str());
         135  +
        /* SerializerUtil.kt:46 */
   75    136   
    }
         137  +
    /* SerializerUtil.kt:46 */
   76    138   
    {
         139  +
        /* CborSerializerGenerator.kt:466 */
   77    140   
        encoder
   78    141   
            .str("defaultIntEnum")
   79    142   
            .integer(input.default_int_enum);
         143  +
        /* SerializerUtil.kt:46 */
   80    144   
    }
         145  +
    /* SerializerUtil.kt:46 */
   81    146   
    {
         147  +
        /* CborSerializerGenerator.kt:462 */
   82    148   
        encoder.str("emptyString").str(input.empty_string.as_str());
         149  +
        /* SerializerUtil.kt:46 */
   83    150   
    }
         151  +
    /* SerializerUtil.kt:46 */
   84    152   
    {
         153  +
        /* CborSerializerGenerator.kt:460 */
   85    154   
        encoder.str("falseBoolean").boolean(input.false_boolean);
         155  +
        /* SerializerUtil.kt:46 */
   86    156   
    }
         157  +
    /* SerializerUtil.kt:46 */
   87    158   
    {
         159  +
        /* CborSerializerGenerator.kt:459 */
   88    160   
        encoder.str("emptyBlob").blob(&input.empty_blob);
         161  +
        /* SerializerUtil.kt:46 */
   89    162   
    }
         163  +
    /* SerializerUtil.kt:46 */
   90    164   
    {
         165  +
        /* CborSerializerGenerator.kt:464 */
   91    166   
        encoder.str("zeroByte").byte(input.zero_byte);
         167  +
        /* SerializerUtil.kt:46 */
   92    168   
    }
         169  +
    /* SerializerUtil.kt:46 */
   93    170   
    {
         171  +
        /* CborSerializerGenerator.kt:465 */
   94    172   
        encoder.str("zeroShort").short(input.zero_short);
         173  +
        /* SerializerUtil.kt:46 */
   95    174   
    }
         175  +
    /* SerializerUtil.kt:46 */
   96    176   
    {
         177  +
        /* CborSerializerGenerator.kt:466 */
   97    178   
        encoder.str("zeroInteger").integer(input.zero_integer);
         179  +
        /* SerializerUtil.kt:46 */
   98    180   
    }
         181  +
    /* SerializerUtil.kt:46 */
   99    182   
    {
         183  +
        /* CborSerializerGenerator.kt:467 */
  100    184   
        encoder.str("zeroLong").long(input.zero_long);
         185  +
        /* SerializerUtil.kt:46 */
  101    186   
    }
         187  +
    /* SerializerUtil.kt:46 */
  102    188   
    {
         189  +
        /* CborSerializerGenerator.kt:469 */
  103    190   
        encoder.str("zeroFloat").float(input.zero_float);
         191  +
        /* SerializerUtil.kt:46 */
  104    192   
    }
         193  +
    /* SerializerUtil.kt:46 */
  105    194   
    {
         195  +
        /* CborSerializerGenerator.kt:470 */
  106    196   
        encoder.str("zeroDouble").double(input.zero_double);
         197  +
        /* SerializerUtil.kt:46 */
  107    198   
    }
         199  +
    /* CborSerializerGenerator.kt:393 */
  108    200   
    encoder.end();
         201  +
    /* CborSerializerGenerator.kt:394 */
  109    202   
    Ok(())
         203  +
    /* CborSerializerGenerator.kt:369 */
  110    204   
}

tmp-codegen-diff/codegen-server-test/rpcv2Cbor/rust-server-codegen/src/protocol_serde/shape_optional_input_output.rs

@@ -1,1 +102,131 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:516 */
    2      3   
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ServerHttpBoundProtocolGenerator.kt:383 */
    3      5   
pub async fn de_optional_input_output_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::OptionalInputOutputInput,
    7      9   
    ::aws_smithy_http_server::protocol::rpc_v2_cbor::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::rpc_v2_cbor::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::optional_input_output_input::Builder::default();
          23  +
        /* RustType.kt:516 */
   18     24   
        #[allow(unused_variables)]
          25  +
        /* ServerHttpBoundProtocolGenerator.kt:728 */
   19     26   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     27   
            uri, headers, body, ..
   21     28   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          29  +
        /* ServerHttpBoundProtocolGenerator.kt:745 */
   22     30   
        let bytes = ::hyper::body::to_bytes(body).await?;
          31  +
        /* ServerHttpBoundProtocolGenerator.kt:768 */
   23     32   
        if !bytes.is_empty() {
          33  +
            /* ServerHttpBoundProtocolGenerator.kt:769 */
   24     34   
            ::aws_smithy_http_server::protocol::content_type_header_classifier_smithy(
   25     35   
                &headers,
   26     36   
                Some("application/cbor"),
   27     37   
            )?;
   28     38   
            input = crate::protocol_serde::shape_optional_input_output::de_optional_input_output(
   29     39   
                bytes.as_ref(),
   30     40   
                input,
   31     41   
            )?;
          42  +
            /* ServerHttpBoundProtocolGenerator.kt:768 */
   32     43   
        }
          44  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   33     45   
        input.build()
          46  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   34     47   
    })
          48  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   35     49   
}
   36     50   
          51  +
/* RustType.kt:516 */
   37     52   
#[allow(clippy::unnecessary_wraps)]
          53  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   38     54   
pub fn ser_optional_input_output_http_response(
   39     55   
    #[allow(unused_variables)] output: crate::output::OptionalInputOutputOutput,
   40     56   
) -> std::result::Result<
   41     57   
    ::aws_smithy_http_server::response::Response,
   42     58   
    ::aws_smithy_http_server::protocol::rpc_v2_cbor::rejection::ResponseRejection,
   43     59   
> {
          60  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   44     61   
    Ok({
          62  +
        /* RustType.kt:516 */
   45     63   
        #[allow(unused_mut)]
          64  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   46     65   
        let mut builder = ::http::Response::builder();
          66  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   47     67   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   48     68   
            builder,
   49     69   
            ::http::header::CONTENT_TYPE,
   50     70   
            "application/cbor",
   51     71   
        );
          72  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   52     73   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   53     74   
            builder,
   54     75   
            ::http::header::HeaderName::from_static("smithy-protocol"),
   55     76   
            "rpc-v2-cbor",
   56     77   
        );
          78  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   57     79   
        let http_status: u16 = 200;
   58     80   
        builder = builder.status(http_status);
          81  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
   59     82   
        let payload =
   60         -
            crate::protocol_serde::shape_optional_input_output_output::ser_optional_input_output_output_output_output(&output)?
   61         -
        ;
          83  +
            /* HttpBoundProtocolPayloadGenerator.kt:237 */crate::protocol_serde::shape_optional_input_output_output::ser_optional_input_output_output_output_output(&output)?
          84  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
          85  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   62     86   
        let content_length = payload.len();
   63     87   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   64     88   
            builder,
   65     89   
            ::http::header::CONTENT_LENGTH,
   66     90   
            content_length,
   67     91   
        );
          92  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   68     93   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          94  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   69     95   
        builder.body(body)?
          96  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   70     97   
    })
          98  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   71     99   
}
   72    100   
         101  +
/* CborParserGenerator.kt:482 */
   73    102   
pub(crate) fn de_optional_input_output(
   74    103   
    value: &[u8],
   75    104   
    mut builder: crate::input::optional_input_output_input::Builder,
   76    105   
) -> ::std::result::Result<
   77    106   
    crate::input::optional_input_output_input::Builder,
   78    107   
    ::aws_smithy_cbor::decode::DeserializeError,
   79    108   
> {
   80    109   
    #[allow(clippy::match_single_binding)]
   81    110   
    fn pair(
   82    111   
        mut builder: crate::input::optional_input_output_input::Builder,

tmp-codegen-diff/codegen-server-test/rpcv2Cbor/rust-server-codegen/src/protocol_serde/shape_optional_input_output_output.rs

@@ -1,1 +26,42 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* CborSerializerGenerator.kt:228 */
    2      3   
pub fn ser_optional_input_output_output_output_output(
    3      4   
    value: &crate::output::OptionalInputOutputOutput,
    4      5   
) -> ::std::result::Result<
    5      6   
    ::std::vec::Vec<u8>,
    6      7   
    ::aws_smithy_types::error::operation::SerializationError,
    7      8   
> {
           9  +
    /* CborSerializerGenerator.kt:233 */
    8     10   
    let mut encoder = ::aws_smithy_cbor::Encoder::new(::std::vec::Vec::new());
          11  +
    /* CborSerializerGenerator.kt:235 */
    9     12   
    {
          13  +
        /* CborSerializerGenerator.kt:236 */
   10     14   
        let encoder = &mut encoder;
          15  +
        /* CborSerializerGenerator.kt:403 */
   11     16   
        crate::protocol_serde::shape_optional_input_output_output::ser_optional_input_output_output_output(encoder, value )?;
          17  +
        /* CborSerializerGenerator.kt:235 */
   12     18   
    }
          19  +
    /* CborSerializerGenerator.kt:242 */
   13     20   
    ::std::result::Result::Ok(encoder.into_writer())
          21  +
    /* CborSerializerGenerator.kt:228 */
   14     22   
}
   15     23   
          24  +
/* CborSerializerGenerator.kt:369 */
   16     25   
pub fn ser_optional_input_output_output_output(
   17     26   
    encoder: &mut ::aws_smithy_cbor::Encoder,
   18     27   
    #[allow(unused)] input: &crate::output::OptionalInputOutputOutput,
   19     28   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          29  +
    /* CborSerializerGenerator.kt:377 */
   20     30   
    encoder.begin_map();
          31  +
    /* CborSerializerGenerator.kt:414 */
   21     32   
    if let Some(var_1) = &input.value {
          33  +
        /* CborSerializerGenerator.kt:462 */
   22     34   
        encoder.str("value").str(var_1.as_str());
          35  +
        /* CborSerializerGenerator.kt:414 */
   23     36   
    }
          37  +
    /* CborSerializerGenerator.kt:393 */
   24     38   
    encoder.end();
          39  +
    /* CborSerializerGenerator.kt:394 */
   25     40   
    Ok(())
          41  +
    /* CborSerializerGenerator.kt:369 */
   26     42   
}

tmp-codegen-diff/codegen-server-test/rpcv2Cbor/rust-server-codegen/src/protocol_serde/shape_recursive_shapes.rs

@@ -1,1 +102,131 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:516 */
    2      3   
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ServerHttpBoundProtocolGenerator.kt:383 */
    3      5   
pub async fn de_recursive_shapes_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::RecursiveShapesInput,
    7      9   
    ::aws_smithy_http_server::protocol::rpc_v2_cbor::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::rpc_v2_cbor::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::recursive_shapes_input::Builder::default();
          23  +
        /* RustType.kt:516 */
   18     24   
        #[allow(unused_variables)]
          25  +
        /* ServerHttpBoundProtocolGenerator.kt:728 */
   19     26   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     27   
            uri, headers, body, ..
   21     28   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          29  +
        /* ServerHttpBoundProtocolGenerator.kt:745 */
   22     30   
        let bytes = ::hyper::body::to_bytes(body).await?;
          31  +
        /* ServerHttpBoundProtocolGenerator.kt:768 */
   23     32   
        if !bytes.is_empty() {
          33  +
            /* ServerHttpBoundProtocolGenerator.kt:769 */
   24     34   
            ::aws_smithy_http_server::protocol::content_type_header_classifier_smithy(
   25     35   
                &headers,
   26     36   
                Some("application/cbor"),
   27     37   
            )?;
   28     38   
            input = crate::protocol_serde::shape_recursive_shapes::de_recursive_shapes(
   29     39   
                bytes.as_ref(),
   30     40   
                input,
   31     41   
            )?;
          42  +
            /* ServerHttpBoundProtocolGenerator.kt:768 */
   32     43   
        }
          44  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   33     45   
        input.build()
          46  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   34     47   
    })
          48  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   35     49   
}
   36     50   
          51  +
/* RustType.kt:516 */
   37     52   
#[allow(clippy::unnecessary_wraps)]
          53  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   38     54   
pub fn ser_recursive_shapes_http_response(
   39     55   
    #[allow(unused_variables)] output: crate::output::RecursiveShapesOutput,
   40     56   
) -> std::result::Result<
   41     57   
    ::aws_smithy_http_server::response::Response,
   42     58   
    ::aws_smithy_http_server::protocol::rpc_v2_cbor::rejection::ResponseRejection,
   43     59   
> {
          60  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   44     61   
    Ok({
          62  +
        /* RustType.kt:516 */
   45     63   
        #[allow(unused_mut)]
          64  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   46     65   
        let mut builder = ::http::Response::builder();
          66  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   47     67   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   48     68   
            builder,
   49     69   
            ::http::header::CONTENT_TYPE,
   50     70   
            "application/cbor",
   51     71   
        );
          72  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   52     73   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   53     74   
            builder,
   54     75   
            ::http::header::HeaderName::from_static("smithy-protocol"),
   55     76   
            "rpc-v2-cbor",
   56     77   
        );
          78  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   57     79   
        let http_status: u16 = 200;
   58     80   
        builder = builder.status(http_status);
          81  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
   59     82   
        let payload =
   60         -
            crate::protocol_serde::shape_recursive_shapes_output::ser_recursive_shapes_output_output_output(&output)?
   61         -
        ;
          83  +
            /* HttpBoundProtocolPayloadGenerator.kt:237 */crate::protocol_serde::shape_recursive_shapes_output::ser_recursive_shapes_output_output_output(&output)?
          84  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
          85  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   62     86   
        let content_length = payload.len();
   63     87   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   64     88   
            builder,
   65     89   
            ::http::header::CONTENT_LENGTH,
   66     90   
            content_length,
   67     91   
        );
          92  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   68     93   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          94  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   69     95   
        builder.body(body)?
          96  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   70     97   
    })
          98  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   71     99   
}
   72    100   
         101  +
/* CborParserGenerator.kt:482 */
   73    102   
pub(crate) fn de_recursive_shapes(
   74    103   
    value: &[u8],
   75    104   
    mut builder: crate::input::recursive_shapes_input::Builder,
   76    105   
) -> ::std::result::Result<
   77    106   
    crate::input::recursive_shapes_input::Builder,
   78    107   
    ::aws_smithy_cbor::decode::DeserializeError,
   79    108   
> {
   80    109   
    #[allow(clippy::match_single_binding)]
   81    110   
    fn pair(
   82    111   
        mut builder: crate::input::recursive_shapes_input::Builder,

tmp-codegen-diff/codegen-server-test/rpcv2Cbor/rust-server-codegen/src/protocol_serde/shape_recursive_shapes_input_output_nested1.rs

@@ -1,1 +82,101 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* CborParserGenerator.kt:692 */
    2      3   
pub(crate) fn de_recursive_shapes_input_output_nested1(
    3      4   
    decoder: &mut ::aws_smithy_cbor::Decoder,
    4      5   
) -> ::std::result::Result<
    5      6   
    crate::model::RecursiveShapesInputOutputNested1,
    6      7   
    ::aws_smithy_cbor::decode::DeserializeError,
    7      8   
> {
           9  +
    /* CborParserGenerator.kt:700 */
    8     10   
    #[allow(clippy::match_single_binding)]
    9     11   
    fn pair(
   10     12   
        mut builder: crate::model::recursive_shapes_input_output_nested1::Builder,
   11     13   
        decoder: &mut ::aws_smithy_cbor::Decoder,
   12     14   
    ) -> ::std::result::Result<
   13     15   
        crate::model::recursive_shapes_input_output_nested1::Builder,
   14     16   
        ::aws_smithy_cbor::decode::DeserializeError,
   15     17   
    > {
   16     18   
        builder = match decoder.str()?.as_ref() {
   17     19   
            "foo" => {
   18     20   
                ::aws_smithy_cbor::decode::set_optional(builder, decoder, |builder, decoder| {
   19     21   
                    Ok(builder.set_foo(Some(decoder.string()?)))
   20     22   
                })?
   21     23   
            }
   22     24   
            "nested" => {
   23     25   
                ::aws_smithy_cbor::decode::set_optional(builder, decoder, |builder, decoder| {
   24     26   
                    Ok(builder.set_nested(
   25     27   
                    Some(
   26     28   
                         {
   27     29   
                            let v = crate::protocol_serde::shape_recursive_shapes_input_output_nested2::de_recursive_shapes_input_output_nested2(decoder)?;
   28     30   
                            Box::new(v)
   29     31   
                        }
   30     32   
                    )
   31     33   
                ))
   32     34   
                })?
   33     35   
            }
   34     36   
            _ => {
   35     37   
                decoder.skip()?;
   36     38   
                builder
   37     39   
            }
   38     40   
        };
   39     41   
        Ok(builder)
   40     42   
    }
   41     43   
   42     44   
    let mut builder = crate::model::recursive_shapes_input_output_nested1::Builder::default();
   43     45   
   44     46   
    match decoder.map()? {
   45     47   
        None => loop {
   46     48   
            match decoder.datatype()? {
   47     49   
                ::aws_smithy_cbor::data::Type::Break => {
   48     50   
                    decoder.skip()?;
   49     51   
                    break;
   50     52   
                }
   51     53   
                _ => {
   52     54   
                    builder = pair(builder, decoder)?;
   53     55   
                }
   54     56   
            };
   55     57   
        },
   56     58   
        Some(n) => {
   57     59   
            for _ in 0..n {
   58     60   
                builder = pair(builder, decoder)?;
   59     61   
            }
   60     62   
        }
   61     63   
    };
          64  +
    /* CborParserGenerator.kt:726 */
   62     65   
    #[allow(clippy::needless_question_mark)]
          66  +
    /* CborParserGenerator.kt:727 */
   63     67   
    {
          68  +
        /* CborParserGenerator.kt:728 */
   64     69   
        return Ok(builder.build());
          70  +
        /* CborParserGenerator.kt:727 */
   65     71   
    }
          72  +
    /* CborParserGenerator.kt:692 */
   66     73   
}
   67     74   
          75  +
/* CborSerializerGenerator.kt:369 */
   68     76   
pub fn ser_recursive_shapes_input_output_nested1(
   69     77   
    encoder: &mut ::aws_smithy_cbor::Encoder,
   70     78   
    #[allow(unused)] input: &crate::model::RecursiveShapesInputOutputNested1,
   71     79   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          80  +
    /* CborSerializerGenerator.kt:377 */
   72     81   
    encoder.begin_map();
          82  +
    /* CborSerializerGenerator.kt:414 */
   73     83   
    if let Some(var_1) = &input.foo {
          84  +
        /* CborSerializerGenerator.kt:462 */
   74     85   
        encoder.str("foo").str(var_1.as_str());
          86  +
        /* CborSerializerGenerator.kt:414 */
   75     87   
    }
          88  +
    /* CborSerializerGenerator.kt:414 */
   76     89   
    if let Some(var_2) = &input.nested {
          90  +
        /* CborSerializerGenerator.kt:486 */
   77     91   
        encoder.str("nested");
          92  +
        /* CborSerializerGenerator.kt:403 */
   78     93   
        crate::protocol_serde::shape_recursive_shapes_input_output_nested2::ser_recursive_shapes_input_output_nested2(encoder, var_2 )?;
          94  +
        /* CborSerializerGenerator.kt:414 */
   79     95   
    }
          96  +
    /* CborSerializerGenerator.kt:393 */
   80     97   
    encoder.end();
          98  +
    /* CborSerializerGenerator.kt:394 */
   81     99   
    Ok(())
         100  +
    /* CborSerializerGenerator.kt:369 */
   82    101   
}