Server Test

Server Test

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943 (ignoring whitespace)

Files changed:

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

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

tmp-codegen-diff/codegen-server-test/rpcv2Cbor/rust-server-codegen/src/protocol_serde/shape_recursive_shapes_output.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_recursive_shapes_output_output_output(
    3      4   
    value: &crate::output::RecursiveShapesOutput,
    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_recursive_shapes_output::ser_recursive_shapes_output_output(
   12     17   
            encoder, value,
   13     18   
        )?;
          19  +
        /* CborSerializerGenerator.kt:235 */
   14     20   
    }
          21  +
    /* CborSerializerGenerator.kt:242 */
   15     22   
    ::std::result::Result::Ok(encoder.into_writer())
          23  +
    /* CborSerializerGenerator.kt:228 */
   16     24   
}
   17     25   
          26  +
/* CborSerializerGenerator.kt:369 */
   18     27   
pub fn ser_recursive_shapes_output_output(
   19     28   
    encoder: &mut ::aws_smithy_cbor::Encoder,
   20     29   
    #[allow(unused)] input: &crate::output::RecursiveShapesOutput,
   21     30   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          31  +
    /* CborSerializerGenerator.kt:377 */
   22     32   
    encoder.begin_map();
          33  +
    /* CborSerializerGenerator.kt:414 */
   23     34   
    if let Some(var_1) = &input.nested {
          35  +
        /* CborSerializerGenerator.kt:486 */
   24     36   
        encoder.str("nested");
          37  +
        /* CborSerializerGenerator.kt:403 */
   25     38   
        crate::protocol_serde::shape_recursive_shapes_input_output_nested1::ser_recursive_shapes_input_output_nested1(encoder, var_1 )?;
          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_rpc_v2_cbor_dense_maps.rs

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

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

@@ -1,1 +77,142 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* CborSerializerGenerator.kt:228 */
    2      3   
pub fn ser_rpc_v2_cbor_dense_maps_output_output_output(
    3      4   
    value: &crate::output::RpcV2CborDenseMapsOutput,
    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_rpc_v2_cbor_dense_maps_output::ser_rpc_v2_cbor_dense_maps_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_rpc_v2_cbor_dense_maps_output_output(
   17     26   
    encoder: &mut ::aws_smithy_cbor::Encoder,
   18     27   
    #[allow(unused)] input: &crate::output::RpcV2CborDenseMapsOutput,
   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.dense_struct_map {
          33  +
        /* CborSerializerGenerator.kt:486 */
   22     34   
        encoder.str("denseStructMap");
          35  +
        /* CborSerializerGenerator.kt:517 */
   23     36   
        encoder.map((*var_1).len());
          37  +
        /* CborSerializerGenerator.kt:518 */
   24     38   
        for (key_2, value_3) in var_1 {
          39  +
            /* SerializerUtil.kt:42 */
   25     40   
            {
          41  +
                /* CborSerializerGenerator.kt:486 */
   26     42   
                encoder.str(key_2.as_str());
          43  +
                /* CborSerializerGenerator.kt:403 */
   27     44   
                crate::protocol_serde::shape_greeting_struct::ser_greeting_struct(
   28     45   
                    encoder, value_3,
   29     46   
                )?;
          47  +
                /* SerializerUtil.kt:42 */
   30     48   
            }
          49  +
            /* CborSerializerGenerator.kt:518 */
   31     50   
        }
          51  +
        /* CborSerializerGenerator.kt:414 */
   32     52   
    }
          53  +
    /* CborSerializerGenerator.kt:414 */
   33     54   
    if let Some(var_4) = &input.dense_number_map {
          55  +
        /* CborSerializerGenerator.kt:486 */
   34     56   
        encoder.str("denseNumberMap");
          57  +
        /* CborSerializerGenerator.kt:517 */
   35     58   
        encoder.map((*var_4).len());
          59  +
        /* CborSerializerGenerator.kt:518 */
   36     60   
        for (key_5, value_6) in var_4 {
          61  +
            /* SerializerUtil.kt:42 */
   37     62   
            {
          63  +
                /* CborSerializerGenerator.kt:466 */
   38     64   
                encoder.str(key_5.as_str()).integer(*value_6);
          65  +
                /* SerializerUtil.kt:42 */
   39     66   
            }
          67  +
            /* CborSerializerGenerator.kt:518 */
   40     68   
        }
          69  +
        /* CborSerializerGenerator.kt:414 */
   41     70   
    }
          71  +
    /* CborSerializerGenerator.kt:414 */
   42     72   
    if let Some(var_7) = &input.dense_boolean_map {
          73  +
        /* CborSerializerGenerator.kt:486 */
   43     74   
        encoder.str("denseBooleanMap");
          75  +
        /* CborSerializerGenerator.kt:517 */
   44     76   
        encoder.map((*var_7).len());
          77  +
        /* CborSerializerGenerator.kt:518 */
   45     78   
        for (key_8, value_9) in var_7 {
          79  +
            /* SerializerUtil.kt:42 */
   46     80   
            {
          81  +
                /* CborSerializerGenerator.kt:460 */
   47     82   
                encoder.str(key_8.as_str()).boolean(*value_9);
          83  +
                /* SerializerUtil.kt:42 */
   48     84   
            }
          85  +
            /* CborSerializerGenerator.kt:518 */
   49     86   
        }
          87  +
        /* CborSerializerGenerator.kt:414 */
   50     88   
    }
          89  +
    /* CborSerializerGenerator.kt:414 */
   51     90   
    if let Some(var_10) = &input.dense_string_map {
          91  +
        /* CborSerializerGenerator.kt:486 */
   52     92   
        encoder.str("denseStringMap");
          93  +
        /* CborSerializerGenerator.kt:517 */
   53     94   
        encoder.map((*var_10).len());
          95  +
        /* CborSerializerGenerator.kt:518 */
   54     96   
        for (key_11, value_12) in var_10 {
          97  +
            /* SerializerUtil.kt:42 */
   55     98   
            {
          99  +
                /* CborSerializerGenerator.kt:462 */
   56    100   
                encoder.str(key_11.as_str()).str(value_12.as_str());
         101  +
                /* SerializerUtil.kt:42 */
   57    102   
            }
         103  +
            /* CborSerializerGenerator.kt:518 */
   58    104   
        }
         105  +
        /* CborSerializerGenerator.kt:414 */
   59    106   
    }
         107  +
    /* CborSerializerGenerator.kt:414 */
   60    108   
    if let Some(var_13) = &input.dense_set_map {
         109  +
        /* CborSerializerGenerator.kt:486 */
   61    110   
        encoder.str("denseSetMap");
         111  +
        /* CborSerializerGenerator.kt:517 */
   62    112   
        encoder.map((*var_13).len());
         113  +
        /* CborSerializerGenerator.kt:518 */
   63    114   
        for (key_14, value_15) in var_13 {
         115  +
            /* SerializerUtil.kt:42 */
   64    116   
            {
         117  +
                /* CborSerializerGenerator.kt:486 */
   65    118   
                encoder.str(key_14.as_str());
         119  +
                /* CborSerializerGenerator.kt:504 */
   66    120   
                encoder.array((value_15.0).len());
         121  +
                /* CborSerializerGenerator.kt:506 */
   67    122   
                for item_16 in &value_15.0 {
         123  +
                    /* SerializerUtil.kt:42 */
   68    124   
                    {
         125  +
                        /* CborSerializerGenerator.kt:462 */
   69    126   
                        encoder.str(item_16.as_str());
         127  +
                        /* SerializerUtil.kt:42 */
   70    128   
                    }
         129  +
                    /* CborSerializerGenerator.kt:506 */
   71    130   
                }
         131  +
                /* SerializerUtil.kt:42 */
   72    132   
            }
         133  +
            /* CborSerializerGenerator.kt:518 */
   73    134   
        }
         135  +
        /* CborSerializerGenerator.kt:414 */
   74    136   
    }
         137  +
    /* CborSerializerGenerator.kt:393 */
   75    138   
    encoder.end();
         139  +
    /* CborSerializerGenerator.kt:394 */
   76    140   
    Ok(())
         141  +
    /* CborSerializerGenerator.kt:369 */
   77    142   
}

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

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

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

@@ -1,1 +122,230 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* CborSerializerGenerator.kt:228 */
    2      3   
pub fn ser_rpc_v2_cbor_lists_output_output_output(
    3      4   
    value: &crate::output::RpcV2CborListsOutput,
    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_rpc_v2_cbor_lists_output::ser_rpc_v2_cbor_lists_output_output(
   12     17   
            encoder, value,
   13     18   
        )?;
          19  +
        /* CborSerializerGenerator.kt:235 */
   14     20   
    }
          21  +
    /* CborSerializerGenerator.kt:242 */
   15     22   
    ::std::result::Result::Ok(encoder.into_writer())
          23  +
    /* CborSerializerGenerator.kt:228 */
   16     24   
}
   17     25   
          26  +
/* CborSerializerGenerator.kt:369 */
   18     27   
pub fn ser_rpc_v2_cbor_lists_output_output(
   19     28   
    encoder: &mut ::aws_smithy_cbor::Encoder,
   20     29   
    #[allow(unused)] input: &crate::output::RpcV2CborListsOutput,
   21     30   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          31  +
    /* CborSerializerGenerator.kt:377 */
   22     32   
    encoder.begin_map();
          33  +
    /* CborSerializerGenerator.kt:414 */
   23     34   
    if let Some(var_1) = &input.string_list {
          35  +
        /* CborSerializerGenerator.kt:486 */
   24     36   
        encoder.str("stringList");
          37  +
        /* CborSerializerGenerator.kt:504 */
   25     38   
        encoder.array((*var_1).len());
          39  +
        /* CborSerializerGenerator.kt:506 */
   26     40   
        for item_2 in var_1 {
          41  +
            /* SerializerUtil.kt:42 */
   27     42   
            {
          43  +
                /* CborSerializerGenerator.kt:462 */
   28     44   
                encoder.str(item_2.as_str());
          45  +
                /* SerializerUtil.kt:42 */
   29     46   
            }
          47  +
            /* CborSerializerGenerator.kt:506 */
   30     48   
        }
          49  +
        /* CborSerializerGenerator.kt:414 */
   31     50   
    }
          51  +
    /* CborSerializerGenerator.kt:414 */
   32     52   
    if let Some(var_3) = &input.string_set {
          53  +
        /* CborSerializerGenerator.kt:486 */
   33     54   
        encoder.str("stringSet");
          55  +
        /* CborSerializerGenerator.kt:504 */
   34     56   
        encoder.array((var_3.0).len());
          57  +
        /* CborSerializerGenerator.kt:506 */
   35     58   
        for item_4 in &var_3.0 {
          59  +
            /* SerializerUtil.kt:42 */
   36     60   
            {
          61  +
                /* CborSerializerGenerator.kt:462 */
   37     62   
                encoder.str(item_4.as_str());
          63  +
                /* SerializerUtil.kt:42 */
   38     64   
            }
          65  +
            /* CborSerializerGenerator.kt:506 */
   39     66   
        }
          67  +
        /* CborSerializerGenerator.kt:414 */
   40     68   
    }
          69  +
    /* CborSerializerGenerator.kt:414 */
   41     70   
    if let Some(var_5) = &input.integer_list {
          71  +
        /* CborSerializerGenerator.kt:486 */
   42     72   
        encoder.str("integerList");
          73  +
        /* CborSerializerGenerator.kt:504 */
   43     74   
        encoder.array((*var_5).len());
          75  +
        /* CborSerializerGenerator.kt:506 */
   44     76   
        for item_6 in var_5 {
          77  +
            /* SerializerUtil.kt:42 */
   45     78   
            {
          79  +
                /* CborSerializerGenerator.kt:466 */
   46     80   
                encoder.integer(*item_6);
          81  +
                /* SerializerUtil.kt:42 */
   47     82   
            }
          83  +
            /* CborSerializerGenerator.kt:506 */
   48     84   
        }
          85  +
        /* CborSerializerGenerator.kt:414 */
   49     86   
    }
          87  +
    /* CborSerializerGenerator.kt:414 */
   50     88   
    if let Some(var_7) = &input.boolean_list {
          89  +
        /* CborSerializerGenerator.kt:486 */
   51     90   
        encoder.str("booleanList");
          91  +
        /* CborSerializerGenerator.kt:504 */
   52     92   
        encoder.array((*var_7).len());
          93  +
        /* CborSerializerGenerator.kt:506 */
   53     94   
        for item_8 in var_7 {
          95  +
            /* SerializerUtil.kt:42 */
   54     96   
            {
          97  +
                /* CborSerializerGenerator.kt:460 */
   55     98   
                encoder.boolean(*item_8);
          99  +
                /* SerializerUtil.kt:42 */
   56    100   
            }
         101  +
            /* CborSerializerGenerator.kt:506 */
   57    102   
        }
         103  +
        /* CborSerializerGenerator.kt:414 */
   58    104   
    }
         105  +
    /* CborSerializerGenerator.kt:414 */
   59    106   
    if let Some(var_9) = &input.timestamp_list {
         107  +
        /* CborSerializerGenerator.kt:486 */
   60    108   
        encoder.str("timestampList");
         109  +
        /* CborSerializerGenerator.kt:504 */
   61    110   
        encoder.array((*var_9).len());
         111  +
        /* CborSerializerGenerator.kt:506 */
   62    112   
        for item_10 in var_9 {
         113  +
            /* SerializerUtil.kt:42 */
   63    114   
            {
         115  +
                /* CborSerializerGenerator.kt:472 */
   64    116   
                encoder.timestamp(item_10);
         117  +
                /* SerializerUtil.kt:42 */
   65    118   
            }
         119  +
            /* CborSerializerGenerator.kt:506 */
   66    120   
        }
         121  +
        /* CborSerializerGenerator.kt:414 */
   67    122   
    }
         123  +
    /* CborSerializerGenerator.kt:414 */
   68    124   
    if let Some(var_11) = &input.enum_list {
         125  +
        /* CborSerializerGenerator.kt:486 */
   69    126   
        encoder.str("enumList");
         127  +
        /* CborSerializerGenerator.kt:504 */
   70    128   
        encoder.array((*var_11).len());
         129  +
        /* CborSerializerGenerator.kt:506 */
   71    130   
        for item_12 in var_11 {
         131  +
            /* SerializerUtil.kt:42 */
   72    132   
            {
         133  +
                /* CborSerializerGenerator.kt:462 */
   73    134   
                encoder.str(item_12.as_str());
         135  +
                /* SerializerUtil.kt:42 */
   74    136   
            }
         137  +
            /* CborSerializerGenerator.kt:506 */
   75    138   
        }
         139  +
        /* CborSerializerGenerator.kt:414 */
   76    140   
    }
         141  +
    /* CborSerializerGenerator.kt:414 */
   77    142   
    if let Some(var_13) = &input.int_enum_list {
         143  +
        /* CborSerializerGenerator.kt:486 */
   78    144   
        encoder.str("intEnumList");
         145  +
        /* CborSerializerGenerator.kt:504 */
   79    146   
        encoder.array((*var_13).len());
         147  +
        /* CborSerializerGenerator.kt:506 */
   80    148   
        for item_14 in var_13 {
         149  +
            /* SerializerUtil.kt:42 */
   81    150   
            {
         151  +
                /* CborSerializerGenerator.kt:466 */
   82    152   
                encoder.integer(*item_14);
         153  +
                /* SerializerUtil.kt:42 */
   83    154   
            }
         155  +
            /* CborSerializerGenerator.kt:506 */
   84    156   
        }
         157  +
        /* CborSerializerGenerator.kt:414 */
   85    158   
    }
         159  +
    /* CborSerializerGenerator.kt:414 */
   86    160   
    if let Some(var_15) = &input.nested_string_list {
         161  +
        /* CborSerializerGenerator.kt:486 */
   87    162   
        encoder.str("nestedStringList");
         163  +
        /* CborSerializerGenerator.kt:504 */
   88    164   
        encoder.array((*var_15).len());
         165  +
        /* CborSerializerGenerator.kt:506 */
   89    166   
        for item_16 in var_15 {
         167  +
            /* SerializerUtil.kt:42 */
   90    168   
            {
         169  +
                /* CborSerializerGenerator.kt:504 */
   91    170   
                encoder.array((*item_16).len());
         171  +
                /* CborSerializerGenerator.kt:506 */
   92    172   
                for item_17 in item_16 {
         173  +
                    /* SerializerUtil.kt:42 */
   93    174   
                    {
         175  +
                        /* CborSerializerGenerator.kt:462 */
   94    176   
                        encoder.str(item_17.as_str());
         177  +
                        /* SerializerUtil.kt:42 */
   95    178   
                    }
         179  +
                    /* CborSerializerGenerator.kt:506 */
   96    180   
                }
         181  +
                /* SerializerUtil.kt:42 */
   97    182   
            }
         183  +
            /* CborSerializerGenerator.kt:506 */
   98    184   
        }
         185  +
        /* CborSerializerGenerator.kt:414 */
   99    186   
    }
         187  +
    /* CborSerializerGenerator.kt:414 */
  100    188   
    if let Some(var_18) = &input.structure_list {
         189  +
        /* CborSerializerGenerator.kt:486 */
  101    190   
        encoder.str("structureList");
         191  +
        /* CborSerializerGenerator.kt:504 */
  102    192   
        encoder.array((*var_18).len());
         193  +
        /* CborSerializerGenerator.kt:506 */
  103    194   
        for item_19 in var_18 {
         195  +
            /* SerializerUtil.kt:42 */
  104    196   
            {
         197  +
                /* CborSerializerGenerator.kt:403 */
  105    198   
                crate::protocol_serde::shape_structure_list_member::ser_structure_list_member(
  106    199   
                    encoder, item_19,
  107    200   
                )?;
         201  +
                /* SerializerUtil.kt:42 */
  108    202   
            }
         203  +
            /* CborSerializerGenerator.kt:506 */
  109    204   
        }
         205  +
        /* CborSerializerGenerator.kt:414 */
  110    206   
    }
         207  +
    /* CborSerializerGenerator.kt:414 */
  111    208   
    if let Some(var_20) = &input.blob_list {
         209  +
        /* CborSerializerGenerator.kt:486 */
  112    210   
        encoder.str("blobList");
         211  +
        /* CborSerializerGenerator.kt:504 */
  113    212   
        encoder.array((*var_20).len());
         213  +
        /* CborSerializerGenerator.kt:506 */
  114    214   
        for item_21 in var_20 {
         215  +
            /* SerializerUtil.kt:42 */
  115    216   
            {
         217  +
                /* CborSerializerGenerator.kt:459 */
  116    218   
                encoder.blob(item_21);
         219  +
                /* SerializerUtil.kt:42 */
  117    220   
            }
         221  +
            /* CborSerializerGenerator.kt:506 */
  118    222   
        }
         223  +
        /* CborSerializerGenerator.kt:414 */
  119    224   
    }
         225  +
    /* CborSerializerGenerator.kt:393 */
  120    226   
    encoder.end();
         227  +
    /* CborSerializerGenerator.kt:394 */
  121    228   
    Ok(())
         229  +
    /* CborSerializerGenerator.kt:369 */
  122    230   
}

tmp-codegen-diff/codegen-server-test/rpcv2Cbor/rust-server-codegen/src/protocol_serde/shape_rpc_v2_cbor_sparse_maps.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_rpc_v2_cbor_sparse_maps_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::RpcV2CborSparseMapsInput,
    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::rpc_v2_cbor_sparse_maps_input::Builder::default();
          23  +
        /* RustType.kt:516 */
   18     24   
        #[allow(unused_variables)]
          25  +
        /* ServerHttpBoundProtocolGenerator.kt:728 */
   19     26   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     27   
            uri, headers, body, ..
   21     28   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          29  +
        /* ServerHttpBoundProtocolGenerator.kt:745 */
   22     30   
        let bytes = ::hyper::body::to_bytes(body).await?;
          31  +
        /* ServerHttpBoundProtocolGenerator.kt:768 */
   23     32   
        if !bytes.is_empty() {
          33  +
            /* ServerHttpBoundProtocolGenerator.kt:769 */
   24     34   
            ::aws_smithy_http_server::protocol::content_type_header_classifier_smithy(
   25     35   
                &headers,
   26     36   
                Some("application/cbor"),
   27     37   
            )?;
   28     38   
            input =
   29     39   
                crate::protocol_serde::shape_rpc_v2_cbor_sparse_maps::de_rpc_v2_cbor_sparse_maps(
   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_rpc_v2_cbor_sparse_maps_http_response(
   40     56   
    #[allow(unused_variables)] output: crate::output::RpcV2CborSparseMapsOutput,
   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_rpc_v2_cbor_sparse_maps_output::ser_rpc_v2_cbor_sparse_maps_output_output_output(&output)?
   62         -
        ;
          84  +
            /* HttpBoundProtocolPayloadGenerator.kt:237 */crate::protocol_serde::shape_rpc_v2_cbor_sparse_maps_output::ser_rpc_v2_cbor_sparse_maps_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_rpc_v2_cbor_sparse_maps_http_error(
   76    106   
    error: &crate::error::RpcV2CborSparseMapsError,
   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::RpcV2CborSparseMapsError::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_rpc_v2_cbor_sparse_maps(
  112    156   
    value: &[u8],
  113    157   
    mut builder: crate::input::rpc_v2_cbor_sparse_maps_input::Builder,
  114    158   
) -> ::std::result::Result<
  115    159   
    crate::input::rpc_v2_cbor_sparse_maps_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::rpc_v2_cbor_sparse_maps_input::Builder,

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

@@ -1,1 +85,170 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* CborSerializerGenerator.kt:228 */
    2      3   
pub fn ser_rpc_v2_cbor_sparse_maps_output_output_output(
    3      4   
    value: &crate::output::RpcV2CborSparseMapsOutput,
    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_rpc_v2_cbor_sparse_maps_output::ser_rpc_v2_cbor_sparse_maps_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_rpc_v2_cbor_sparse_maps_output_output(
   17     26   
    encoder: &mut ::aws_smithy_cbor::Encoder,
   18     27   
    #[allow(unused)] input: &crate::output::RpcV2CborSparseMapsOutput,
   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.sparse_struct_map {
          33  +
        /* CborSerializerGenerator.kt:486 */
   22     34   
        encoder.str("sparseStructMap");
          35  +
        /* CborSerializerGenerator.kt:517 */
   23     36   
        encoder.map((*var_1).len());
          37  +
        /* CborSerializerGenerator.kt:518 */
   24     38   
        for (key_2, value_3) in var_1 {
          39  +
            /* CborSerializerGenerator.kt:414 */
   25     40   
            if let Some(var_4) = value_3 {
          41  +
                /* CborSerializerGenerator.kt:486 */
   26     42   
                encoder.str(key_2.as_str());
          43  +
                /* CborSerializerGenerator.kt:403 */
   27     44   
                crate::protocol_serde::shape_greeting_struct::ser_greeting_struct(encoder, var_4)?;
   28         -
            } else {
          45  +
            /* CborSerializerGenerator.kt:414 */
          46  +
            }
          47  +
            /* CborSerializerGenerator.kt:420 */
          48  +
            else {
          49  +
                /* CborSerializerGenerator.kt:421 */
   29     50   
                encoder.str(key_2.as_str()).null();
          51  +
                /* CborSerializerGenerator.kt:420 */
   30     52   
            }
          53  +
            /* CborSerializerGenerator.kt:518 */
   31     54   
        }
          55  +
        /* CborSerializerGenerator.kt:414 */
   32     56   
    }
          57  +
    /* CborSerializerGenerator.kt:414 */
   33     58   
    if let Some(var_5) = &input.sparse_number_map {
          59  +
        /* CborSerializerGenerator.kt:486 */
   34     60   
        encoder.str("sparseNumberMap");
          61  +
        /* CborSerializerGenerator.kt:517 */
   35     62   
        encoder.map((*var_5).len());
          63  +
        /* CborSerializerGenerator.kt:518 */
   36     64   
        for (key_6, value_7) in var_5 {
          65  +
            /* CborSerializerGenerator.kt:414 */
   37     66   
            if let Some(var_8) = value_7 {
          67  +
                /* CborSerializerGenerator.kt:466 */
   38     68   
                encoder.str(key_6.as_str()).integer(*var_8);
   39         -
            } else {
          69  +
            /* CborSerializerGenerator.kt:414 */
          70  +
            }
          71  +
            /* CborSerializerGenerator.kt:420 */
          72  +
            else {
          73  +
                /* CborSerializerGenerator.kt:421 */
   40     74   
                encoder.str(key_6.as_str()).null();
          75  +
                /* CborSerializerGenerator.kt:420 */
   41     76   
            }
          77  +
            /* CborSerializerGenerator.kt:518 */
   42     78   
        }
          79  +
        /* CborSerializerGenerator.kt:414 */
   43     80   
    }
          81  +
    /* CborSerializerGenerator.kt:414 */
   44     82   
    if let Some(var_9) = &input.sparse_boolean_map {
          83  +
        /* CborSerializerGenerator.kt:486 */
   45     84   
        encoder.str("sparseBooleanMap");
          85  +
        /* CborSerializerGenerator.kt:517 */
   46     86   
        encoder.map((*var_9).len());
          87  +
        /* CborSerializerGenerator.kt:518 */
   47     88   
        for (key_10, value_11) in var_9 {
          89  +
            /* CborSerializerGenerator.kt:414 */
   48     90   
            if let Some(var_12) = value_11 {
          91  +
                /* CborSerializerGenerator.kt:460 */
   49     92   
                encoder.str(key_10.as_str()).boolean(*var_12);
   50         -
            } else {
          93  +
            /* CborSerializerGenerator.kt:414 */
          94  +
            }
          95  +
            /* CborSerializerGenerator.kt:420 */
          96  +
            else {
          97  +
                /* CborSerializerGenerator.kt:421 */
   51     98   
                encoder.str(key_10.as_str()).null();
          99  +
                /* CborSerializerGenerator.kt:420 */
   52    100   
            }
         101  +
            /* CborSerializerGenerator.kt:518 */
   53    102   
        }
         103  +
        /* CborSerializerGenerator.kt:414 */
   54    104   
    }
         105  +
    /* CborSerializerGenerator.kt:414 */
   55    106   
    if let Some(var_13) = &input.sparse_string_map {
         107  +
        /* CborSerializerGenerator.kt:486 */
   56    108   
        encoder.str("sparseStringMap");
         109  +
        /* CborSerializerGenerator.kt:517 */
   57    110   
        encoder.map((*var_13).len());
         111  +
        /* CborSerializerGenerator.kt:518 */
   58    112   
        for (key_14, value_15) in var_13 {
         113  +
            /* CborSerializerGenerator.kt:414 */
   59    114   
            if let Some(var_16) = value_15 {
         115  +
                /* CborSerializerGenerator.kt:462 */
   60    116   
                encoder.str(key_14.as_str()).str(var_16.as_str());
   61         -
            } else {
         117  +
            /* CborSerializerGenerator.kt:414 */
         118  +
            }
         119  +
            /* CborSerializerGenerator.kt:420 */
         120  +
            else {
         121  +
                /* CborSerializerGenerator.kt:421 */
   62    122   
                encoder.str(key_14.as_str()).null();
         123  +
                /* CborSerializerGenerator.kt:420 */
   63    124   
            }
         125  +
            /* CborSerializerGenerator.kt:518 */
   64    126   
        }
         127  +
        /* CborSerializerGenerator.kt:414 */
   65    128   
    }
         129  +
    /* CborSerializerGenerator.kt:414 */
   66    130   
    if let Some(var_17) = &input.sparse_set_map {
         131  +
        /* CborSerializerGenerator.kt:486 */
   67    132   
        encoder.str("sparseSetMap");
         133  +
        /* CborSerializerGenerator.kt:517 */
   68    134   
        encoder.map((*var_17).len());
         135  +
        /* CborSerializerGenerator.kt:518 */
   69    136   
        for (key_18, value_19) in var_17 {
         137  +
            /* CborSerializerGenerator.kt:414 */
   70    138   
            if let Some(var_20) = value_19 {
         139  +
                /* CborSerializerGenerator.kt:486 */
   71    140   
                encoder.str(key_18.as_str());
         141  +
                /* CborSerializerGenerator.kt:504 */
   72    142   
                encoder.array((var_20.0).len());
         143  +
                /* CborSerializerGenerator.kt:506 */
   73    144   
                for item_21 in &var_20.0 {
         145  +
                    /* SerializerUtil.kt:42 */
   74    146   
                    {
         147  +
                        /* CborSerializerGenerator.kt:462 */
   75    148   
                        encoder.str(item_21.as_str());
         149  +
                        /* SerializerUtil.kt:42 */
         150  +
                    }
         151  +
                    /* CborSerializerGenerator.kt:506 */
   76    152   
                }
         153  +
            /* CborSerializerGenerator.kt:414 */
   77    154   
            }
   78         -
            } else {
         155  +
            /* CborSerializerGenerator.kt:420 */
         156  +
            else {
         157  +
                /* CborSerializerGenerator.kt:421 */
   79    158   
                encoder.str(key_18.as_str()).null();
         159  +
                /* CborSerializerGenerator.kt:420 */
   80    160   
            }
         161  +
            /* CborSerializerGenerator.kt:518 */
   81    162   
        }
         163  +
        /* CborSerializerGenerator.kt:414 */
   82    164   
    }
         165  +
    /* CborSerializerGenerator.kt:393 */
   83    166   
    encoder.end();
         167  +
    /* CborSerializerGenerator.kt:394 */
   84    168   
    Ok(())
         169  +
    /* CborSerializerGenerator.kt:369 */
   85    170   
}

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

@@ -1,1 +103,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_simple_scalar_properties_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::SimpleScalarPropertiesInput,
    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::simple_scalar_properties_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_simple_scalar_properties::de_simple_scalar_properties(
   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_simple_scalar_properties_http_response(
   40     56   
    #[allow(unused_variables)] output: crate::output::SimpleScalarPropertiesOutput,
   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_simple_scalar_properties_output::ser_simple_scalar_properties_output_output_output(&output)?
   62         -
        ;
          84  +
            /* HttpBoundProtocolPayloadGenerator.kt:237 */crate::protocol_serde::shape_simple_scalar_properties_output::ser_simple_scalar_properties_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  +
/* CborParserGenerator.kt:482 */
   74    103   
pub(crate) fn de_simple_scalar_properties(
   75    104   
    value: &[u8],
   76    105   
    mut builder: crate::input::simple_scalar_properties_input::Builder,
   77    106   
) -> ::std::result::Result<
   78    107   
    crate::input::simple_scalar_properties_input::Builder,
   79    108   
    ::aws_smithy_cbor::decode::DeserializeError,
   80    109   
> {
   81    110   
    #[allow(clippy::match_single_binding)]
   82    111   
    fn pair(
   83    112   
        mut builder: crate::input::simple_scalar_properties_input::Builder,

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

@@ -1,1 +53,96 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* CborSerializerGenerator.kt:228 */
    2      3   
pub fn ser_simple_scalar_properties_output_output_output(
    3      4   
    value: &crate::output::SimpleScalarPropertiesOutput,
    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_simple_scalar_properties_output::ser_simple_scalar_properties_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_simple_scalar_properties_output_output(
   17     26   
    encoder: &mut ::aws_smithy_cbor::Encoder,
   18     27   
    #[allow(unused)] input: &crate::output::SimpleScalarPropertiesOutput,
   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.true_boolean_value {
          33  +
        /* CborSerializerGenerator.kt:460 */
   22     34   
        encoder.str("trueBooleanValue").boolean(*var_1);
          35  +
        /* CborSerializerGenerator.kt:414 */
   23     36   
    }
          37  +
    /* CborSerializerGenerator.kt:414 */
   24     38   
    if let Some(var_2) = &input.false_boolean_value {
          39  +
        /* CborSerializerGenerator.kt:460 */
   25     40   
        encoder.str("falseBooleanValue").boolean(*var_2);
          41  +
        /* CborSerializerGenerator.kt:414 */
   26     42   
    }
          43  +
    /* CborSerializerGenerator.kt:414 */
   27     44   
    if let Some(var_3) = &input.byte_value {
          45  +
        /* CborSerializerGenerator.kt:464 */
   28     46   
        encoder.str("byteValue").byte(*var_3);
          47  +
        /* CborSerializerGenerator.kt:414 */
   29     48   
    }
          49  +
    /* CborSerializerGenerator.kt:414 */
   30     50   
    if let Some(var_4) = &input.double_value {
          51  +
        /* CborSerializerGenerator.kt:470 */
   31     52   
        encoder.str("doubleValue").double(*var_4);
          53  +
        /* CborSerializerGenerator.kt:414 */
   32     54   
    }
          55  +
    /* CborSerializerGenerator.kt:414 */
   33     56   
    if let Some(var_5) = &input.float_value {
          57  +
        /* CborSerializerGenerator.kt:469 */
   34     58   
        encoder.str("floatValue").float(*var_5);
          59  +
        /* CborSerializerGenerator.kt:414 */
   35     60   
    }
          61  +
    /* CborSerializerGenerator.kt:414 */
   36     62   
    if let Some(var_6) = &input.integer_value {
          63  +
        /* CborSerializerGenerator.kt:466 */
   37     64   
        encoder.str("integerValue").integer(*var_6);
          65  +
        /* CborSerializerGenerator.kt:414 */
   38     66   
    }
          67  +
    /* CborSerializerGenerator.kt:414 */
   39     68   
    if let Some(var_7) = &input.long_value {
          69  +
        /* CborSerializerGenerator.kt:467 */
   40     70   
        encoder.str("longValue").long(*var_7);
          71  +
        /* CborSerializerGenerator.kt:414 */
   41     72   
    }
          73  +
    /* CborSerializerGenerator.kt:414 */
   42     74   
    if let Some(var_8) = &input.short_value {
          75  +
        /* CborSerializerGenerator.kt:465 */
   43     76   
        encoder.str("shortValue").short(*var_8);
          77  +
        /* CborSerializerGenerator.kt:414 */
   44     78   
    }
          79  +
    /* CborSerializerGenerator.kt:414 */
   45     80   
    if let Some(var_9) = &input.string_value {
          81  +
        /* CborSerializerGenerator.kt:462 */
   46     82   
        encoder.str("stringValue").str(var_9.as_str());
          83  +
        /* CborSerializerGenerator.kt:414 */
   47     84   
    }
          85  +
    /* CborSerializerGenerator.kt:414 */
   48     86   
    if let Some(var_10) = &input.blob_value {
          87  +
        /* CborSerializerGenerator.kt:459 */
   49     88   
        encoder.str("blobValue").blob(var_10);
          89  +
        /* CborSerializerGenerator.kt:414 */
   50     90   
    }
          91  +
    /* CborSerializerGenerator.kt:393 */
   51     92   
    encoder.end();
          93  +
    /* CborSerializerGenerator.kt:394 */
   52     94   
    Ok(())
          95  +
    /* CborSerializerGenerator.kt:369 */
   53     96   
}

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

@@ -1,1 +31,32 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* CborParserGenerator.kt:659 */
    2      3   
pub(crate) fn de_sparse_boolean_map(
    3      4   
    decoder: &mut ::aws_smithy_cbor::Decoder,
    4      5   
) -> ::std::result::Result<
    5      6   
    ::std::collections::HashMap<::std::string::String, ::std::option::Option<bool>>,
    6      7   
    ::aws_smithy_cbor::decode::DeserializeError,
    7      8   
> {
    8      9   
    fn pair(
    9     10   
        mut map: ::std::collections::HashMap<::std::string::String, ::std::option::Option<bool>>,
   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_sparse_nulls_operation.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_sparse_nulls_operation_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::SparseNullsOperationInput,
    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::sparse_nulls_operation_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_sparse_nulls_operation::de_sparse_nulls_operation(
   29     39   
                bytes.as_ref(),
   30     40   
                input,
   31     41   
            )?;
          42  +
            /* ServerHttpBoundProtocolGenerator.kt:768 */
   32     43   
        }
          44  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   33     45   
        input.build()
          46  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   34     47   
    })
          48  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   35     49   
}
   36     50   
          51  +
/* RustType.kt:516 */
   37     52   
#[allow(clippy::unnecessary_wraps)]
          53  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   38     54   
pub fn ser_sparse_nulls_operation_http_response(
   39     55   
    #[allow(unused_variables)] output: crate::output::SparseNullsOperationOutput,
   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_sparse_nulls_operation_output::ser_sparse_nulls_operation_output_output_output(&output)?
   61         -
        ;
          83  +
            /* HttpBoundProtocolPayloadGenerator.kt:237 */crate::protocol_serde::shape_sparse_nulls_operation_output::ser_sparse_nulls_operation_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_sparse_nulls_operation(
   74    103   
    value: &[u8],
   75    104   
    mut builder: crate::input::sparse_nulls_operation_input::Builder,
   76    105   
) -> ::std::result::Result<
   77    106   
    crate::input::sparse_nulls_operation_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::sparse_nulls_operation_input::Builder,

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

@@ -1,1 +45,84 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* CborSerializerGenerator.kt:228 */
    2      3   
pub fn ser_sparse_nulls_operation_output_output_output(
    3      4   
    value: &crate::output::SparseNullsOperationOutput,
    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_sparse_nulls_operation_output::ser_sparse_nulls_operation_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_sparse_nulls_operation_output_output(
   17     26   
    encoder: &mut ::aws_smithy_cbor::Encoder,
   18     27   
    #[allow(unused)] input: &crate::output::SparseNullsOperationOutput,
   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.sparse_string_list {
          33  +
        /* CborSerializerGenerator.kt:486 */
   22     34   
        encoder.str("sparseStringList");
          35  +
        /* CborSerializerGenerator.kt:504 */
   23     36   
        encoder.array((*var_1).len());
          37  +
        /* CborSerializerGenerator.kt:506 */
   24     38   
        for item_2 in var_1 {
          39  +
            /* CborSerializerGenerator.kt:414 */
   25     40   
            if let Some(var_3) = item_2 {
          41  +
                /* CborSerializerGenerator.kt:462 */
   26     42   
                encoder.str(var_3.as_str());
   27         -
            } else {
          43  +
            /* CborSerializerGenerator.kt:414 */
          44  +
            }
          45  +
            /* CborSerializerGenerator.kt:420 */
          46  +
            else {
          47  +
                /* CborSerializerGenerator.kt:421 */
   28     48   
                encoder.null();
          49  +
                /* CborSerializerGenerator.kt:420 */
   29     50   
            }
          51  +
            /* CborSerializerGenerator.kt:506 */
   30     52   
        }
          53  +
        /* CborSerializerGenerator.kt:414 */
   31     54   
    }
          55  +
    /* CborSerializerGenerator.kt:414 */
   32     56   
    if let Some(var_4) = &input.sparse_string_map {
          57  +
        /* CborSerializerGenerator.kt:486 */
   33     58   
        encoder.str("sparseStringMap");
          59  +
        /* CborSerializerGenerator.kt:517 */
   34     60   
        encoder.map((*var_4).len());
          61  +
        /* CborSerializerGenerator.kt:518 */
   35     62   
        for (key_5, value_6) in var_4 {
          63  +
            /* CborSerializerGenerator.kt:414 */
   36     64   
            if let Some(var_7) = value_6 {
          65  +
                /* CborSerializerGenerator.kt:462 */
   37     66   
                encoder.str(key_5.as_str()).str(var_7.as_str());
   38         -
            } else {
          67  +
            /* CborSerializerGenerator.kt:414 */
          68  +
            }
          69  +
            /* CborSerializerGenerator.kt:420 */
          70  +
            else {
          71  +
                /* CborSerializerGenerator.kt:421 */
   39     72   
                encoder.str(key_5.as_str()).null();
          73  +
                /* CborSerializerGenerator.kt:420 */
   40     74   
            }
          75  +
            /* CborSerializerGenerator.kt:518 */
   41     76   
        }
          77  +
        /* CborSerializerGenerator.kt:414 */
   42     78   
    }
          79  +
    /* CborSerializerGenerator.kt:393 */
   43     80   
    encoder.end();
          81  +
    /* CborSerializerGenerator.kt:394 */
   44     82   
    Ok(())
          83  +
    /* CborSerializerGenerator.kt:369 */
   45     84   
}

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

@@ -1,1 +31,32 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* CborParserGenerator.kt:659 */
    2      3   
pub(crate) fn de_sparse_number_map(
    3      4   
    decoder: &mut ::aws_smithy_cbor::Decoder,
    4      5   
) -> ::std::result::Result<
    5      6   
    ::std::collections::HashMap<::std::string::String, ::std::option::Option<i32>>,
    6      7   
    ::aws_smithy_cbor::decode::DeserializeError,
    7      8   
> {
    8      9   
    fn pair(
    9     10   
        mut map: ::std::collections::HashMap<::std::string::String, ::std::option::Option<i32>>,
   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_sparse_set_map.rs

@@ -1,1 +31,32 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* CborParserGenerator.kt:659 */
    2      3   
pub(crate) fn de_sparse_set_map(
    3      4   
    decoder: &mut ::aws_smithy_cbor::Decoder,
    4      5   
) -> ::std::result::Result<
    5      6   
    crate::unconstrained::sparse_set_map_unconstrained::SparseSetMapUnconstrained,
    6      7   
    ::aws_smithy_cbor::decode::DeserializeError,
    7      8   
> {
    8      9   
    fn pair(
    9     10   
        mut map: crate::unconstrained::sparse_set_map_unconstrained::SparseSetMapUnconstrained,
   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_sparse_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_sparse_string_list(
    3      4   
    decoder: &mut ::aws_smithy_cbor::Decoder,
    4      5   
) -> ::std::result::Result<
    5      6   
    ::std::vec::Vec<::std::option::Option<::std::string::String>>,
    6      7   
    ::aws_smithy_cbor::decode::DeserializeError,
    7      8   
> {
    8      9   
    fn member(
    9     10   
        mut list: ::std::vec::Vec<::std::option::Option<::std::string::String>>,
   10     11   
        decoder: &mut ::aws_smithy_cbor::Decoder,
   11     12   
    ) -> ::std::result::Result<