Server Test

Server Test

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943 (ignoring whitespace)

Files changed:

tmp-codegen-diff/codegen-server-test/naming_test_ops/rust-server-codegen/src/protocol_serde/shape_rpc_echo.rs

@@ -1,1 +206,312 @@
    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_echo_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::RpcEchoInput,
    7      9   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection,
    8     10   
>
    9     11   
where
   10     12   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11     13   
    B::Data: Send,
   12     14   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection:
   13     15   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     16   
{
          17  +
    /* ServerHttpBoundProtocolGenerator.kt:399 */
   15     18   
    Ok({
          19  +
        /* RustType.kt:516 */
   16     20   
        #[allow(unused_mut)]
          21  +
        /* ServerHttpBoundProtocolGenerator.kt:723 */
   17     22   
        let mut input = crate::input::rpc_echo_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/x-amz-json-1.1"),
   27     37   
            )?;
   28     38   
            input = crate::protocol_serde::shape_rpc_echo::de_rpc_echo(bytes.as_ref(), input)?;
          39  +
            /* ServerHttpBoundProtocolGenerator.kt:768 */
   29     40   
        }
          41  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   30     42   
        input.build()?
          43  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   31     44   
    })
          45  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   32     46   
}
   33     47   
          48  +
/* RustType.kt:516 */
   34     49   
#[allow(clippy::unnecessary_wraps)]
          50  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   35     51   
pub fn ser_rpc_echo_http_response(
   36     52   
    #[allow(unused_variables)] output: crate::output::RpcEchoOutput,
   37     53   
) -> std::result::Result<
   38     54   
    ::aws_smithy_http_server::response::Response,
   39     55   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   40     56   
> {
          57  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   41     58   
    Ok({
          59  +
        /* RustType.kt:516 */
   42     60   
        #[allow(unused_mut)]
          61  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   43     62   
        let mut builder = ::http::Response::builder();
          63  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   44     64   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   45     65   
            builder,
   46     66   
            ::http::header::CONTENT_TYPE,
   47     67   
            "application/x-amz-json-1.1",
   48     68   
        );
          69  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   49     70   
        let http_status: u16 = 200;
   50     71   
        builder = builder.status(http_status);
   51         -
        let payload = "";
          72  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
          73  +
        let payload =
          74  +
            /* HttpBoundProtocolPayloadGenerator.kt:235 */""
          75  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
          76  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   52     77   
        let content_length = payload.len();
   53     78   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   54     79   
            builder,
   55     80   
            ::http::header::CONTENT_LENGTH,
   56     81   
            content_length,
   57     82   
        );
          83  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   58     84   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          85  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   59     86   
        builder.body(body)?
          87  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   60     88   
    })
          89  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   61     90   
}
   62     91   
          92  +
/* RustType.kt:516 */
   63     93   
#[allow(clippy::unnecessary_wraps)]
          94  +
/* ServerHttpBoundProtocolGenerator.kt:447 */
   64     95   
pub fn ser_rpc_echo_http_error(
   65     96   
    error: &crate::error::RPCEchoError,
   66     97   
) -> std::result::Result<
   67     98   
    ::aws_smithy_http_server::response::Response,
   68     99   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   69    100   
> {
         101  +
    /* ServerHttpBoundProtocolGenerator.kt:452 */
   70    102   
    Ok({
         103  +
        /* ServerHttpBoundProtocolGenerator.kt:468 */
   71    104   
        match error {
         105  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
   72    106   
            crate::error::RPCEchoError::ValidationException(output) => {
         107  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
   73    108   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
         109  +
                /* RustType.kt:516 */
   74    110   
                #[allow(unused_mut)]
         111  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
   75    112   
                let mut builder = ::http::Response::builder();
         113  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   76    114   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   77    115   
                    builder,
   78    116   
                    ::http::header::CONTENT_TYPE,
   79    117   
                    "application/x-amz-json-1.1",
   80    118   
                );
         119  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
   81    120   
                let content_length = payload.len();
   82    121   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   83    122   
                    builder,
   84    123   
                    ::http::header::CONTENT_LENGTH,
   85    124   
                    content_length,
   86    125   
                );
         126  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
   87    127   
                builder
   88    128   
                    .status(400)
   89    129   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         130  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
         131  +
            } /* ServerHttpBoundProtocolGenerator.kt:468 */
   90    132   
        }
   91         -
        }
         133  +
        /* ServerHttpBoundProtocolGenerator.kt:452 */
   92    134   
    })
         135  +
    /* ServerHttpBoundProtocolGenerator.kt:447 */
   93    136   
}
   94    137   
         138  +
/* JsonParserGenerator.kt:148 */
   95    139   
pub(crate) fn de_rpc_echo(
   96    140   
    value: &[u8],
   97    141   
    mut builder: crate::input::rpc_echo_input::Builder,
   98    142   
) -> ::std::result::Result<
   99    143   
    crate::input::rpc_echo_input::Builder,
  100    144   
    ::aws_smithy_json::deserialize::error::DeserializeError,
  101    145   
> {
         146  +
    /* JsonParserGenerator.kt:153 */
  102    147   
    let mut tokens_owned =
  103    148   
        ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value))
  104    149   
            .peekable();
  105    150   
    let tokens = &mut tokens_owned;
  106    151   
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
         152  +
    /* JsonParserGenerator.kt:684 */
  107    153   
    loop {
         154  +
        /* JsonParserGenerator.kt:685 */
  108    155   
        match tokens.next().transpose()? {
         156  +
            /* JsonParserGenerator.kt:686 */
  109    157   
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
  110    158   
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
         159  +
                /* JsonParserGenerator.kt:260 */
  111    160   
                match key.to_unescaped()?.as_ref() {
         161  +
                    /* JsonParserGenerator.kt:262 */
  112    162   
                    "as" => {
         163  +
                        /* JsonParserGenerator.kt:272 */
  113    164   
                        builder = builder.set_as(
         165  +
                            /* JsonParserGenerator.kt:365 */
  114    166   
                            ::aws_smithy_json::deserialize::token::expect_number_or_null(
  115    167   
                                tokens.next(),
  116    168   
                            )?
  117    169   
                            .map(i32::try_from)
  118         -
                            .transpose()?,
         170  +
                            .transpose()?, /* JsonParserGenerator.kt:272 */
  119    171   
                        );
         172  +
                        /* JsonParserGenerator.kt:262 */
  120    173   
                    }
         174  +
                    /* JsonParserGenerator.kt:262 */
  121    175   
                    "async" => {
         176  +
                        /* JsonParserGenerator.kt:272 */
  122    177   
                        builder = builder.set_async(
         178  +
                            /* JsonParserGenerator.kt:298 */
  123    179   
                            ::aws_smithy_json::deserialize::token::expect_bool_or_null(
  124    180   
                                tokens.next(),
  125         -
                            )?,
         181  +
                            )?, /* JsonParserGenerator.kt:272 */
  126    182   
                        );
         183  +
                        /* JsonParserGenerator.kt:262 */
  127    184   
                    }
         185  +
                    /* JsonParserGenerator.kt:262 */
  128    186   
                    "enum" => {
         187  +
                        /* JsonParserGenerator.kt:272 */
  129    188   
                        builder = builder.set_enum(
         189  +
                            /* JsonParserGenerator.kt:354 */
  130    190   
                            ::aws_smithy_json::deserialize::token::expect_string_or_null(
  131    191   
                                tokens.next(),
  132    192   
                            )?
  133         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  134         -
                            .transpose()?,
         193  +
                            .map(|s|
         194  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
         195  +
                                    /* JsonParserGenerator.kt:343 */u.into_owned()
         196  +
                                /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
         197  +
                            .transpose()?, /* JsonParserGenerator.kt:272 */
  135    198   
                        );
         199  +
                        /* JsonParserGenerator.kt:262 */
  136    200   
                    }
         201  +
                    /* JsonParserGenerator.kt:262 */
  137    202   
                    "self" => {
         203  +
                        /* JsonParserGenerator.kt:272 */
  138    204   
                        builder = builder.set_self(
         205  +
                            /* JsonParserGenerator.kt:298 */
  139    206   
                            ::aws_smithy_json::deserialize::token::expect_bool_or_null(
  140    207   
                                tokens.next(),
  141         -
                            )?,
         208  +
                            )?, /* JsonParserGenerator.kt:272 */
  142    209   
                        );
         210  +
                        /* JsonParserGenerator.kt:262 */
  143    211   
                    }
         212  +
                    /* JsonParserGenerator.kt:262 */
  144    213   
                    "crate" => {
         214  +
                        /* JsonParserGenerator.kt:272 */
  145    215   
                        builder = builder.set_crate(
         216  +
                            /* JsonParserGenerator.kt:298 */
  146    217   
                            ::aws_smithy_json::deserialize::token::expect_bool_or_null(
  147    218   
                                tokens.next(),
  148         -
                            )?,
         219  +
                            )?, /* JsonParserGenerator.kt:272 */
  149    220   
                        );
         221  +
                        /* JsonParserGenerator.kt:262 */
  150    222   
                    }
         223  +
                    /* JsonParserGenerator.kt:262 */
  151    224   
                    "super" => {
         225  +
                        /* JsonParserGenerator.kt:272 */
  152    226   
                        builder = builder.set_super(
         227  +
                            /* JsonParserGenerator.kt:298 */
  153    228   
                            ::aws_smithy_json::deserialize::token::expect_bool_or_null(
  154    229   
                                tokens.next(),
  155         -
                            )?,
         230  +
                            )?, /* JsonParserGenerator.kt:272 */
  156    231   
                        );
         232  +
                        /* JsonParserGenerator.kt:262 */
  157    233   
                    }
         234  +
                    /* JsonParserGenerator.kt:262 */
  158    235   
                    "build" => {
         236  +
                        /* JsonParserGenerator.kt:272 */
  159    237   
                        builder = builder.set_build(
         238  +
                            /* JsonParserGenerator.kt:354 */
  160    239   
                            ::aws_smithy_json::deserialize::token::expect_string_or_null(
  161    240   
                                tokens.next(),
  162    241   
                            )?
  163         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  164         -
                            .transpose()?,
         242  +
                            .map(|s|
         243  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
         244  +
                                    /* JsonParserGenerator.kt:348 */u.into_owned()
         245  +
                                /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
         246  +
                            .transpose()?, /* JsonParserGenerator.kt:272 */
  165    247   
                        );
         248  +
                        /* JsonParserGenerator.kt:262 */
  166    249   
                    }
         250  +
                    /* JsonParserGenerator.kt:262 */
  167    251   
                    "default" => {
         252  +
                        /* JsonParserGenerator.kt:272 */
  168    253   
                        builder = builder.set_default(
         254  +
                            /* JsonParserGenerator.kt:354 */
  169    255   
                            ::aws_smithy_json::deserialize::token::expect_string_or_null(
  170    256   
                                tokens.next(),
  171    257   
                            )?
  172         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  173         -
                            .transpose()?,
         258  +
                            .map(|s|
         259  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
         260  +
                                    /* JsonParserGenerator.kt:348 */u.into_owned()
         261  +
                                /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
         262  +
                            .transpose()?, /* JsonParserGenerator.kt:272 */
  174    263   
                        );
         264  +
                        /* JsonParserGenerator.kt:262 */
  175    265   
                    }
         266  +
                    /* JsonParserGenerator.kt:262 */
  176    267   
                    "send" => {
         268  +
                        /* JsonParserGenerator.kt:272 */
  177    269   
                        builder = builder.set_send(
         270  +
                            /* JsonParserGenerator.kt:354 */
  178    271   
                            ::aws_smithy_json::deserialize::token::expect_string_or_null(
  179    272   
                                tokens.next(),
  180    273   
                            )?
  181         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  182         -
                            .transpose()?,
         274  +
                            .map(|s|
         275  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
         276  +
                                    /* JsonParserGenerator.kt:348 */u.into_owned()
         277  +
                                /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
         278  +
                            .transpose()?, /* JsonParserGenerator.kt:272 */
  183    279   
                        );
         280  +
                        /* JsonParserGenerator.kt:262 */
  184    281   
                    }
  185         -
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
         282  +
                    /* JsonParserGenerator.kt:290 */
         283  +
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
  186    284   
                }
         285  +
                /* JsonParserGenerator.kt:686 */
  187    286   
            }
         287  +
            /* JsonParserGenerator.kt:695 */
  188    288   
            other => {
  189    289   
                return Err(
  190    290   
                    ::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  191    291   
                        "expected object key or end object, found: {:?}",
  192    292   
                        other
  193    293   
                    )),
  194    294   
                )
         295  +
            } /* JsonParserGenerator.kt:685 */
  195    296   
        }
         297  +
        /* JsonParserGenerator.kt:684 */
  196    298   
    }
  197         -
    }
         299  +
    /* JsonParserGenerator.kt:250 */
  198    300   
    if tokens.next().is_some() {
         301  +
        /* JsonParserGenerator.kt:251 */
  199    302   
        return Err(
  200    303   
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
  201    304   
                "found more JSON tokens after completing parsing",
  202    305   
            ),
  203    306   
        );
         307  +
        /* JsonParserGenerator.kt:250 */
  204    308   
    }
         309  +
    /* JsonParserGenerator.kt:163 */
  205    310   
    Ok(builder)
         311  +
    /* JsonParserGenerator.kt:148 */
  206    312   
}

tmp-codegen-diff/codegen-server-test/naming_test_ops/rust-server-codegen/src/protocol_serde/shape_structure_name_punning.rs

@@ -1,1 +117,172 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:516 */
    2      3   
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ServerHttpBoundProtocolGenerator.kt:383 */
    3      5   
pub async fn de_structure_name_punning_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::StructureNamePunningInput,
    7      9   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection,
    8     10   
>
    9     11   
where
   10     12   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11     13   
    B::Data: Send,
   12     14   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection:
   13     15   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     16   
{
          17  +
    /* ServerHttpBoundProtocolGenerator.kt:399 */
   15     18   
    Ok({
          19  +
        /* RustType.kt:516 */
   16     20   
        #[allow(unused_mut)]
          21  +
        /* ServerHttpBoundProtocolGenerator.kt:723 */
   17     22   
        let mut input = crate::input::structure_name_punning_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/x-amz-json-1.1"),
   27     37   
            )?;
   28     38   
            input = crate::protocol_serde::shape_structure_name_punning::de_structure_name_punning(
   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_structure_name_punning_http_response(
   39     55   
    #[allow(unused_variables)] output: crate::output::StructureNamePunningOutput,
   40     56   
) -> std::result::Result<
   41     57   
    ::aws_smithy_http_server::response::Response,
   42     58   
    ::aws_smithy_http_server::protocol::aws_json::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/x-amz-json-1.1",
   51     71   
        );
          72  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   52     73   
        let http_status: u16 = 200;
   53     74   
        builder = builder.status(http_status);
   54         -
        let payload = "";
          75  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
          76  +
        let payload =
          77  +
            /* HttpBoundProtocolPayloadGenerator.kt:235 */""
          78  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
          79  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   55     80   
        let content_length = payload.len();
   56     81   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   57     82   
            builder,
   58     83   
            ::http::header::CONTENT_LENGTH,
   59     84   
            content_length,
   60     85   
        );
          86  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   61     87   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          88  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   62     89   
        builder.body(body)?
          90  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   63     91   
    })
          92  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   64     93   
}
   65     94   
          95  +
/* JsonParserGenerator.kt:148 */
   66     96   
pub(crate) fn de_structure_name_punning(
   67     97   
    value: &[u8],
   68     98   
    mut builder: crate::input::structure_name_punning_input::Builder,
   69     99   
) -> ::std::result::Result<
   70    100   
    crate::input::structure_name_punning_input::Builder,
   71    101   
    ::aws_smithy_json::deserialize::error::DeserializeError,
   72    102   
> {
         103  +
    /* JsonParserGenerator.kt:153 */
   73    104   
    let mut tokens_owned =
   74    105   
        ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value))
   75    106   
            .peekable();
   76    107   
    let tokens = &mut tokens_owned;
   77    108   
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
         109  +
    /* JsonParserGenerator.kt:684 */
   78    110   
    loop {
         111  +
        /* JsonParserGenerator.kt:685 */
   79    112   
        match tokens.next().transpose()? {
         113  +
            /* JsonParserGenerator.kt:686 */
   80    114   
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   81    115   
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
         116  +
                /* JsonParserGenerator.kt:260 */
   82    117   
                match key.to_unescaped()?.as_ref() {
         118  +
                    /* JsonParserGenerator.kt:262 */
   83    119   
                    "regular_string" => {
         120  +
                        /* JsonParserGenerator.kt:272 */
   84    121   
                        builder = builder.set_regular_string(
         122  +
                            /* JsonParserGenerator.kt:354 */
   85    123   
                            ::aws_smithy_json::deserialize::token::expect_string_or_null(
   86    124   
                                tokens.next(),
   87    125   
                            )?
   88         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   89         -
                            .transpose()?,
         126  +
                            .map(|s|
         127  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
         128  +
                                    /* JsonParserGenerator.kt:348 */u.into_owned()
         129  +
                                /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
         130  +
                            .transpose()?, /* JsonParserGenerator.kt:272 */
   90    131   
                        );
         132  +
                        /* JsonParserGenerator.kt:262 */
   91    133   
                    }
         134  +
                    /* JsonParserGenerator.kt:262 */
   92    135   
                    "punned_vec" => {
   93         -
                        builder = builder
   94         -
                            .set_punned_vec(crate::protocol_serde::shape_vec::de_vec(tokens)?);
         136  +
                        /* JsonParserGenerator.kt:272 */
         137  +
                        builder = builder.set_punned_vec(
         138  +
                            /* JsonParserGenerator.kt:544 */crate::protocol_serde::shape_vec::de_vec(tokens)?
         139  +
                        /* JsonParserGenerator.kt:272 */);
         140  +
                        /* JsonParserGenerator.kt:262 */
   95    141   
                    }
   96         -
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
         142  +
                    /* JsonParserGenerator.kt:290 */
         143  +
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
   97    144   
                }
         145  +
                /* JsonParserGenerator.kt:686 */
   98    146   
            }
         147  +
            /* JsonParserGenerator.kt:695 */
   99    148   
            other => {
  100    149   
                return Err(
  101    150   
                    ::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  102    151   
                        "expected object key or end object, found: {:?}",
  103    152   
                        other
  104    153   
                    )),
  105    154   
                )
         155  +
            } /* JsonParserGenerator.kt:685 */
  106    156   
        }
         157  +
        /* JsonParserGenerator.kt:684 */
  107    158   
    }
  108         -
    }
         159  +
    /* JsonParserGenerator.kt:250 */
  109    160   
    if tokens.next().is_some() {
         161  +
        /* JsonParserGenerator.kt:251 */
  110    162   
        return Err(
  111    163   
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
  112    164   
                "found more JSON tokens after completing parsing",
  113    165   
            ),
  114    166   
        );
         167  +
        /* JsonParserGenerator.kt:250 */
  115    168   
    }
         169  +
    /* JsonParserGenerator.kt:163 */
  116    170   
    Ok(builder)
         171  +
    /* JsonParserGenerator.kt:148 */
  117    172   
}

tmp-codegen-diff/codegen-server-test/naming_test_ops/rust-server-codegen/src/protocol_serde/shape_validation_exception.rs

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

tmp-codegen-diff/codegen-server-test/naming_test_ops/rust-server-codegen/src/protocol_serde/shape_validation_exception_field.rs

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

tmp-codegen-diff/codegen-server-test/naming_test_ops/rust-server-codegen/src/protocol_serde/shape_vec.rs

@@ -1,1 +53,78 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:516 */
    2      3   
pub(crate) fn de_vec<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<crate::model::Vec>,
    6      7   
    ::aws_smithy_json::deserialize::error::DeserializeError,
    7      8   
>
    8      9   
where
    9     10   
    I: Iterator<
   10     11   
        Item = Result<
   11     12   
            ::aws_smithy_json::deserialize::Token<'a>,
   12     13   
            ::aws_smithy_json::deserialize::error::DeserializeError,
   13     14   
        >,
   14     15   
    >,
   15     16   
{
          17  +
    /* JsonParserGenerator.kt:712 */
   16     18   
    match tokens.next().transpose()? {
          19  +
        /* JsonParserGenerator.kt:713 */
   17     20   
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   18     21   
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
          22  +
            /* RustType.kt:516 */
   19     23   
            #[allow(unused_mut)]
          24  +
            /* JsonParserGenerator.kt:526 */
   20     25   
            let mut builder = crate::model::vec::Builder::default();
          26  +
            /* JsonParserGenerator.kt:684 */
   21     27   
            loop {
          28  +
                /* JsonParserGenerator.kt:685 */
   22     29   
                match tokens.next().transpose()? {
          30  +
                    /* JsonParserGenerator.kt:686 */
   23     31   
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   24     32   
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
          33  +
                        /* JsonParserGenerator.kt:260 */
   25     34   
                        match key.to_unescaped()?.as_ref() {
          35  +
                            /* JsonParserGenerator.kt:262 */
   26     36   
                            "pv_member" => {
          37  +
                                /* JsonParserGenerator.kt:272 */
   27     38   
                                builder = builder.set_pv_member(
          39  +
                                    /* JsonParserGenerator.kt:298 */
   28     40   
                                    ::aws_smithy_json::deserialize::token::expect_bool_or_null(
   29     41   
                                        tokens.next(),
   30         -
                                    )?,
          42  +
                                    )?, /* JsonParserGenerator.kt:272 */
   31     43   
                                );
          44  +
                                /* JsonParserGenerator.kt:262 */
   32     45   
                            }
   33         -
                            _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
          46  +
                            /* JsonParserGenerator.kt:290 */
          47  +
                            _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
   34     48   
                        }
          49  +
                        /* JsonParserGenerator.kt:686 */
   35     50   
                    }
          51  +
                    /* JsonParserGenerator.kt:695 */
   36     52   
                    other => {
   37     53   
                        return Err(
   38     54   
                            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   39     55   
                                format!("expected object key or end object, found: {:?}", other),
   40     56   
                            ),
   41     57   
                        )
          58  +
                    } /* JsonParserGenerator.kt:685 */
   42     59   
                }
          60  +
                /* JsonParserGenerator.kt:684 */
   43     61   
            }
   44         -
            }
          62  +
            /* JsonParserGenerator.kt:540 */
   45     63   
            Ok(Some(builder.build()))
          64  +
            /* JsonParserGenerator.kt:713 */
   46     65   
        }
   47         -
        _ => Err(
          66  +
        /* JsonParserGenerator.kt:722 */
          67  +
        _ => {
          68  +
            /* JsonParserGenerator.kt:723 */
          69  +
            Err(
   48     70   
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   49     71   
                    "expected start object or null",
   50     72   
                ),
   51         -
        ),
          73  +
            )
          74  +
            /* JsonParserGenerator.kt:722 */
          75  +
        } /* JsonParserGenerator.kt:712 */
   52     76   
    }
          77  +
    /* JsonParserGenerator.kt:516 */
   53     78   
}

tmp-codegen-diff/codegen-server-test/naming_test_ops/rust-server-codegen/src/service.rs

@@ -1,1 +31,32 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* ServerServiceGenerator.kt:795 */
    2      3   
/// The service builder for [`Config`].
    3      4   
///
    4      5   
/// Constructed via [`Config::builder`].
    5      6   
pub struct ConfigBuilder<Body, L, HttpPl, ModelPl> {
    6      7   
    err_collisions: Option<::aws_smithy_http_server::routing::Route<Body>>,
    7      8   
    r#match: Option<::aws_smithy_http_server::routing::Route<Body>>,
    8      9   
    option: Option<::aws_smithy_http_server::routing::Route<Body>>,
    9     10   
    reserved_words_as_members: Option<::aws_smithy_http_server::routing::Route<Body>>,
   10     11   
    result: Option<::aws_smithy_http_server::routing::Route<Body>>,
   11     12   
    rpc_echo: Option<::aws_smithy_http_server::routing::Route<Body>>,
@@ -1572,1573 +1631,1633 @@
 1592   1593   
impl<S> ::aws_smithy_http_server::service::ServiceShape for Config<S> {
 1593   1594   
    const ID: ::aws_smithy_http_server::shape_id::ShapeId =
 1594   1595   
        ::aws_smithy_http_server::shape_id::ShapeId::new("crate#Config", "crate", "Config");
 1595   1596   
 1596   1597   
    const VERSION: Option<&'static str> = Some("2006-03-01");
 1597   1598   
 1598   1599   
    type Protocol = ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1;
 1599   1600   
 1600   1601   
    type Operations = Operation;
 1601   1602   
}
        1603  +
/* ServiceConfigGenerator.kt:178 */
 1602   1604   
/// Configuration for the [`Config`]. This is the central place where to register and
 1603   1605   
/// configure [`::tower::Layer`]s, HTTP plugins, and model plugins.
 1604   1606   
///
 1605   1607   
/// ```rust,no_run
 1606   1608   
/// # use naming_test_ops::ConfigConfig;
 1607   1609   
/// # use ::aws_smithy_http_server::plugin::IdentityPlugin;
 1608   1610   
/// # use ::tower::layer::util::Identity;
 1609   1611   
/// # let authentication_plugin = IdentityPlugin;
 1610   1612   
/// # let authorization_plugin = IdentityPlugin;
 1611   1613   
/// # let server_request_id_provider_layer = Identity::new();
@@ -1687,1689 +1746,1749 @@
 1707   1709   
 1708   1710   
    /// Build the configuration.
 1709   1711   
    pub fn build(self) -> super::ConfigConfig<L, H, M> {
 1710   1712   
        super::ConfigConfig {
 1711   1713   
            layers: self.layers,
 1712   1714   
            http_plugins: self.http_plugins,
 1713   1715   
            model_plugins: self.model_plugins,
 1714   1716   
        }
 1715   1717   
    }
 1716   1718   
}
        1719  +
/* ScopeMacroGenerator.kt:81 */
 1717   1720   
/// A macro to help with scoping [plugins](crate::server::plugin) to a subset of all operations.
 1718   1721   
///
 1719   1722   
/// In contrast to [`crate::server::scope`](crate::server::scope), this macro has knowledge
 1720   1723   
/// of the service and any operations _not_ specified will be placed in the opposing group.
 1721   1724   
///
 1722   1725   
/// # Example
 1723   1726   
///
 1724   1727   
/// ```rust
 1725   1728   
/// scope! {
 1726   1729   
///     /// Includes [`ErrCollisions`], excluding all other operations.

tmp-codegen-diff/codegen-server-test/naming_test_ops/rust-server-codegen/src/types.rs

@@ -1,1 +0,7 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* SmithyTypesPubUseExtra.kt:66 */
    2      3   
pub use ::aws_smithy_types::date_time::Format as DateTimeFormat;
           4  +
/* ServerRequiredCustomizations.kt:69 */
    3      5   
pub use ::aws_smithy_types::error::display::DisplayErrorContext;
    4      6   
pub use ::aws_smithy_types::Blob;
    5         -
pub use ::aws_smithy_types::DateTime;
           7  +
/* SmithyTypesPubUseExtra.kt:69 */ pub use ::aws_smithy_types::DateTime;

tmp-codegen-diff/codegen-server-test/naming_test_structs/rust-server-codegen/src/input.rs

@@ -1,1 +155,264 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* StructureGenerator.kt:197 */
    2      3   
#[allow(missing_docs)] // documentation missing in model
           4  +
/* RustType.kt:516 */
    3      5   
#[derive(
    4      6   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
    5      7   
)]
    6         -
pub struct StructsInput {
           8  +
pub /* StructureGenerator.kt:201 */ struct StructsInput {
           9  +
    /* StructureGenerator.kt:231 */
    7     10   
    #[allow(missing_docs)] // documentation missing in model
    8     11   
    pub result: ::std::option::Option<crate::model::Result>,
          12  +
    /* StructureGenerator.kt:231 */
    9     13   
    #[allow(missing_docs)] // documentation missing in model
   10     14   
    pub result_list: ::std::option::Option<::std::vec::Vec<crate::model::Result>>,
          15  +
    /* StructureGenerator.kt:231 */
   11     16   
    #[allow(missing_docs)] // documentation missing in model
   12     17   
    pub option: ::std::option::Option<crate::model::Option>,
          18  +
    /* StructureGenerator.kt:231 */
   13     19   
    #[allow(missing_docs)] // documentation missing in model
   14     20   
    pub option_list: ::std::option::Option<::std::vec::Vec<crate::model::Result>>,
          21  +
    /* StructureGenerator.kt:231 */
   15     22   
    #[allow(missing_docs)] // documentation missing in model
   16     23   
    pub something_else: ::std::option::Option<crate::model::SomethingElse>,
          24  +
    /* StructureGenerator.kt:201 */
   17     25   
}
          26  +
/* StructureGenerator.kt:135 */
   18     27   
impl StructsInput {
          28  +
    /* StructureGenerator.kt:231 */
   19     29   
    #[allow(missing_docs)] // documentation missing in model
          30  +
                           /* StructureGenerator.kt:166 */
   20     31   
    pub fn result(&self) -> ::std::option::Option<&crate::model::Result> {
          32  +
        /* StructureGenerator.kt:170 */
   21     33   
        self.result.as_ref()
          34  +
        /* StructureGenerator.kt:166 */
   22     35   
    }
          36  +
    /* StructureGenerator.kt:231 */
   23     37   
    #[allow(missing_docs)] // documentation missing in model
          38  +
                           /* StructureGenerator.kt:166 */
   24     39   
    pub fn result_list(&self) -> ::std::option::Option<&[crate::model::Result]> {
          40  +
        /* StructureGenerator.kt:169 */
   25     41   
        self.result_list.as_deref()
          42  +
        /* StructureGenerator.kt:166 */
   26     43   
    }
          44  +
    /* StructureGenerator.kt:231 */
   27     45   
    #[allow(missing_docs)] // documentation missing in model
          46  +
                           /* StructureGenerator.kt:166 */
   28     47   
    pub fn option(&self) -> ::std::option::Option<&crate::model::Option> {
          48  +
        /* StructureGenerator.kt:170 */
   29     49   
        self.option.as_ref()
          50  +
        /* StructureGenerator.kt:166 */
   30     51   
    }
          52  +
    /* StructureGenerator.kt:231 */
   31     53   
    #[allow(missing_docs)] // documentation missing in model
          54  +
                           /* StructureGenerator.kt:166 */
   32     55   
    pub fn option_list(&self) -> ::std::option::Option<&[crate::model::Result]> {
          56  +
        /* StructureGenerator.kt:169 */
   33     57   
        self.option_list.as_deref()
          58  +
        /* StructureGenerator.kt:166 */
   34     59   
    }
          60  +
    /* StructureGenerator.kt:231 */
   35     61   
    #[allow(missing_docs)] // documentation missing in model
          62  +
                           /* StructureGenerator.kt:166 */
   36     63   
    pub fn something_else(&self) -> ::std::option::Option<&crate::model::SomethingElse> {
          64  +
        /* StructureGenerator.kt:170 */
   37     65   
        self.something_else.as_ref()
          66  +
        /* StructureGenerator.kt:166 */
   38     67   
    }
          68  +
    /* StructureGenerator.kt:135 */
   39     69   
}
          70  +
/* ServerCodegenVisitor.kt:345 */
   40     71   
impl StructsInput {
   41         -
    /// Creates a new builder-style object to manufacture [`StructsInput`](crate::input::StructsInput).
          72  +
    /// /* ServerBuilderGenerator.kt:294 */Creates a new builder-style object to manufacture [`StructsInput`](crate::input::StructsInput).
          73  +
    /* ServerBuilderGenerator.kt:295 */
   42     74   
    pub fn builder() -> crate::input::structs_input::Builder {
          75  +
        /* ServerBuilderGenerator.kt:296 */
   43     76   
        crate::input::structs_input::Builder::default()
          77  +
        /* ServerBuilderGenerator.kt:295 */
   44     78   
    }
          79  +
    /* ServerCodegenVisitor.kt:345 */
   45     80   
}
          81  +
/* ServerStructureConstrainedTraitImpl.kt:21 */
   46     82   
impl crate::constrained::Constrained for crate::input::StructsInput {
   47     83   
    type Unconstrained = crate::input::structs_input::Builder;
   48     84   
}
   49         -
/// See [`StructsInput`](crate::input::StructsInput).
          85  +
/// /* ServerBuilderGenerator.kt:171 */See [`StructsInput`](crate::input::StructsInput).
   50     86   
pub mod structs_input {
   51     87   
          88  +
    /* ServerBuilderGenerator.kt:461 */
   52     89   
    impl ::std::convert::From<Builder> for crate::input::StructsInput {
   53     90   
        fn from(builder: Builder) -> Self {
   54     91   
            builder.build()
   55     92   
        }
   56     93   
    }
   57         -
    /// A builder for [`StructsInput`](crate::input::StructsInput).
          94  +
    /// /* ServerBuilderGenerator.kt:201 */A builder for [`StructsInput`](crate::input::StructsInput).
          95  +
    /* RustType.kt:516 */
   58     96   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
          97  +
    /* ServerBuilderGenerator.kt:211 */
   59     98   
    pub struct Builder {
          99  +
        /* ServerBuilderGenerator.kt:308 */
   60    100   
        pub(crate) result: ::std::option::Option<crate::model::Result>,
         101  +
        /* ServerBuilderGenerator.kt:308 */
   61    102   
        pub(crate) result_list: ::std::option::Option<::std::vec::Vec<crate::model::Result>>,
         103  +
        /* ServerBuilderGenerator.kt:308 */
   62    104   
        pub(crate) option: ::std::option::Option<crate::model::Option>,
         105  +
        /* ServerBuilderGenerator.kt:308 */
   63    106   
        pub(crate) option_list: ::std::option::Option<::std::vec::Vec<crate::model::Result>>,
         107  +
        /* ServerBuilderGenerator.kt:308 */
   64    108   
        pub(crate) something_else: ::std::option::Option<crate::model::SomethingElse>,
         109  +
        /* ServerBuilderGenerator.kt:211 */
   65    110   
    }
         111  +
    /* ServerBuilderGenerator.kt:215 */
   66    112   
    impl Builder {
         113  +
        /* ServerBuilderGenerator.kt:331 */
   67    114   
        #[allow(missing_docs)] // documentation missing in model
         115  +
                               /* ServerBuilderGenerator.kt:343 */
   68    116   
        pub fn result(mut self, input: ::std::option::Option<crate::model::Result>) -> Self {
   69         -
            self.result = input;
         117  +
            /* ServerBuilderGenerator.kt:344 */
         118  +
            self.result =
         119  +
                /* ServerBuilderGenerator.kt:376 */input
         120  +
            /* ServerBuilderGenerator.kt:344 */;
   70    121   
            self
         122  +
            /* ServerBuilderGenerator.kt:343 */
   71    123   
        }
         124  +
        /* ServerBuilderGenerator.kt:426 */
   72    125   
        #[allow(missing_docs)] // documentation missing in model
         126  +
                               /* ServerBuilderGenerator.kt:428 */
   73    127   
        pub(crate) fn set_result(
   74    128   
            mut self,
   75    129   
            input: Option<impl ::std::convert::Into<crate::model::Result>>,
   76    130   
        ) -> Self {
         131  +
            /* ServerBuilderGenerator.kt:429 */
   77    132   
            self.result = input.map(|v| v.into());
   78    133   
            self
         134  +
            /* ServerBuilderGenerator.kt:428 */
   79    135   
        }
         136  +
        /* ServerBuilderGenerator.kt:331 */
   80    137   
        #[allow(missing_docs)] // documentation missing in model
         138  +
                               /* ServerBuilderGenerator.kt:343 */
   81    139   
        pub fn result_list(
   82    140   
            mut self,
   83    141   
            input: ::std::option::Option<::std::vec::Vec<crate::model::Result>>,
   84    142   
        ) -> Self {
   85         -
            self.result_list = input;
         143  +
            /* ServerBuilderGenerator.kt:344 */
         144  +
            self.result_list =
         145  +
                /* ServerBuilderGenerator.kt:376 */input
         146  +
            /* ServerBuilderGenerator.kt:344 */;
   86    147   
            self
         148  +
            /* ServerBuilderGenerator.kt:343 */
   87    149   
        }
         150  +
        /* ServerBuilderGenerator.kt:426 */
   88    151   
        #[allow(missing_docs)] // documentation missing in model
         152  +
                               /* ServerBuilderGenerator.kt:428 */
   89    153   
        pub(crate) fn set_result_list(
   90    154   
            mut self,
   91    155   
            input: Option<impl ::std::convert::Into<::std::vec::Vec<crate::model::Result>>>,
   92    156   
        ) -> Self {
         157  +
            /* ServerBuilderGenerator.kt:429 */
   93    158   
            self.result_list = input.map(|v| v.into());
   94    159   
            self
         160  +
            /* ServerBuilderGenerator.kt:428 */
   95    161   
        }
         162  +
        /* ServerBuilderGenerator.kt:331 */
   96    163   
        #[allow(missing_docs)] // documentation missing in model
         164  +
                               /* ServerBuilderGenerator.kt:343 */
   97    165   
        pub fn option(mut self, input: ::std::option::Option<crate::model::Option>) -> Self {
   98         -
            self.option = input;
         166  +
            /* ServerBuilderGenerator.kt:344 */
         167  +
            self.option =
         168  +
                /* ServerBuilderGenerator.kt:376 */input
         169  +
            /* ServerBuilderGenerator.kt:344 */;
   99    170   
            self
         171  +
            /* ServerBuilderGenerator.kt:343 */
  100    172   
        }
         173  +
        /* ServerBuilderGenerator.kt:426 */
  101    174   
        #[allow(missing_docs)] // documentation missing in model
         175  +
                               /* ServerBuilderGenerator.kt:428 */
  102    176   
        pub(crate) fn set_option(
  103    177   
            mut self,
  104    178   
            input: Option<impl ::std::convert::Into<crate::model::Option>>,
  105    179   
        ) -> Self {
         180  +
            /* ServerBuilderGenerator.kt:429 */
  106    181   
            self.option = input.map(|v| v.into());
  107    182   
            self
         183  +
            /* ServerBuilderGenerator.kt:428 */
  108    184   
        }
         185  +
        /* ServerBuilderGenerator.kt:331 */
  109    186   
        #[allow(missing_docs)] // documentation missing in model
         187  +
                               /* ServerBuilderGenerator.kt:343 */
  110    188   
        pub fn option_list(
  111    189   
            mut self,
  112    190   
            input: ::std::option::Option<::std::vec::Vec<crate::model::Result>>,
  113    191   
        ) -> Self {
  114         -
            self.option_list = input;
         192  +
            /* ServerBuilderGenerator.kt:344 */
         193  +
            self.option_list =
         194  +
                /* ServerBuilderGenerator.kt:376 */input
         195  +
            /* ServerBuilderGenerator.kt:344 */;
  115    196   
            self
         197  +
            /* ServerBuilderGenerator.kt:343 */
  116    198   
        }
         199  +
        /* ServerBuilderGenerator.kt:426 */
  117    200   
        #[allow(missing_docs)] // documentation missing in model
         201  +
                               /* ServerBuilderGenerator.kt:428 */
  118    202   
        pub(crate) fn set_option_list(
  119    203   
            mut self,
  120    204   
            input: Option<impl ::std::convert::Into<::std::vec::Vec<crate::model::Result>>>,
  121    205   
        ) -> Self {
         206  +
            /* ServerBuilderGenerator.kt:429 */
  122    207   
            self.option_list = input.map(|v| v.into());
  123    208   
            self
         209  +
            /* ServerBuilderGenerator.kt:428 */
  124    210   
        }
         211  +
        /* ServerBuilderGenerator.kt:331 */
  125    212   
        #[allow(missing_docs)] // documentation missing in model
         213  +
                               /* ServerBuilderGenerator.kt:343 */
  126    214   
        pub fn something_else(
  127    215   
            mut self,
  128    216   
            input: ::std::option::Option<crate::model::SomethingElse>,
  129    217   
        ) -> Self {
  130         -
            self.something_else = input;
         218  +
            /* ServerBuilderGenerator.kt:344 */
         219  +
            self.something_else =
         220  +
                /* ServerBuilderGenerator.kt:376 */input
         221  +
            /* ServerBuilderGenerator.kt:344 */;
  131    222   
            self
         223  +
            /* ServerBuilderGenerator.kt:343 */
  132    224   
        }
         225  +
        /* ServerBuilderGenerator.kt:426 */
  133    226   
        #[allow(missing_docs)] // documentation missing in model
         227  +
                               /* ServerBuilderGenerator.kt:428 */
  134    228   
        pub(crate) fn set_something_else(
  135    229   
            mut self,
  136    230   
            input: Option<impl ::std::convert::Into<crate::model::SomethingElse>>,
  137    231   
        ) -> Self {
         232  +
            /* ServerBuilderGenerator.kt:429 */
  138    233   
            self.something_else = input.map(|v| v.into());
  139    234   
            self
         235  +
            /* ServerBuilderGenerator.kt:428 */
  140    236   
        }
  141         -
        /// Consumes the builder and constructs a [`StructsInput`](crate::input::StructsInput).
         237  +
        /// /* ServerBuilderGenerator.kt:258 */Consumes the builder and constructs a [`StructsInput`](crate::input::StructsInput).
         238  +
        /* ServerBuilderGenerator.kt:271 */
  142    239   
        pub fn build(self) -> crate::input::StructsInput {
  143    240   
            self.build_enforcing_all_constraints()
  144    241   
        }
         242  +
        /* ServerBuilderGenerator.kt:283 */
  145    243   
        fn build_enforcing_all_constraints(self) -> crate::input::StructsInput {
         244  +
            /* ServerBuilderGenerator.kt:542 */
  146    245   
            crate::input::StructsInput {
         246  +
                /* ServerBuilderGenerator.kt:546 */
  147    247   
                result: self.result,
         248  +
                /* ServerBuilderGenerator.kt:546 */
  148    249   
                result_list: self.result_list,
         250  +
                /* ServerBuilderGenerator.kt:546 */
  149    251   
                option: self.option,
         252  +
                /* ServerBuilderGenerator.kt:546 */
  150    253   
                option_list: self.option_list,
         254  +
                /* ServerBuilderGenerator.kt:546 */
  151    255   
                something_else: self.something_else,
         256  +
                /* ServerBuilderGenerator.kt:542 */
  152    257   
            }
         258  +
            /* ServerBuilderGenerator.kt:283 */
  153    259   
        }
         260  +
        /* ServerBuilderGenerator.kt:215 */
  154    261   
    }
         262  +
         263  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  155    264   
}

tmp-codegen-diff/codegen-server-test/naming_test_structs/rust-server-codegen/src/lib.rs

@@ -1,1 +52,53 @@
   13     13   
#![allow(clippy::result_large_err)]
   14     14   
#![allow(clippy::unnecessary_map_on_constructor)]
   15     15   
#![allow(rustdoc::bare_urls)]
   16     16   
#![allow(rustdoc::redundant_explicit_links)]
   17     17   
#![allow(rustdoc::invalid_html_tags)]
   18     18   
#![forbid(unsafe_code)]
   19     19   
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
   20     20   
//! Confounds model generation machinery with lots of problematic names
   21     21   
   22     22   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
          23  +
/* ServerRootGenerator.kt:65 */
   23     24   
//! A fast and customizable Rust implementation of the NamingObstacleCourseStructs Smithy service.
   24     25   
//!
   25     26   
//! # Using NamingObstacleCourseStructs
   26     27   
//!
   27     28   
//! The primary entrypoint is [`NamingObstacleCourseStructs`]: it satisfies the [`Service<http::Request, Response = http::Response>`](::tower::Service)
   28     29   
//! trait and therefore can be handed to a [`hyper` server](https://github.com/hyperium/hyper) via [`NamingObstacleCourseStructs::into_make_service`]
   29     30   
//! or used in AWS Lambda
   30     31   
#![cfg_attr(
   31     32   
    feature = "aws-lambda",
   32     33   
    doc = " via [`LambdaHandler`](crate::server::routing::LambdaHandler)."
@@ -167,168 +243,251 @@
  187    188   
//! }
  188    189   
//!
  189    190   
//! ```
  190    191   
//!
  191    192   
//! [`serve`]: https://docs.rs/hyper/0.14.16/hyper/server/struct.Builder.html#method.serve
  192    193   
//! [`tower::make::MakeService`]: https://docs.rs/tower/latest/tower/make/trait.MakeService.html
  193    194   
//! [HTTP binding traits]: https://smithy.io/2.0/spec/http-bindings.html
  194    195   
//! [operations]: https://smithy.io/2.0/spec/service-types.html#operation
  195    196   
//! [hyper server]: https://docs.rs/hyper/latest/hyper/server/index.html
  196    197   
//! [Service]: https://docs.rs/tower-service/latest/tower_service/trait.Service.html
         198  +
/* ServerRootGenerator.kt:261 */
  197    199   
pub use crate::service::{
  198    200   
    MissingOperationsError, NamingObstacleCourseStructs, NamingObstacleCourseStructsBuilder,
  199    201   
    NamingObstacleCourseStructsConfig, NamingObstacleCourseStructsConfigBuilder,
  200    202   
};
  201    203   
  202         -
/// Contains the types that are re-exported from the `aws-smithy-http-server` crate.
         204  +
/// /* ServerRustModule.kt:55 */Contains the types that are re-exported from the `aws-smithy-http-server` crate.
  203    205   
pub mod server {
  204    206   
    // Re-export all types from the `aws-smithy-http-server` crate.
  205    207   
    pub use ::aws_smithy_http_server::*;
         208  +
         209  +
    /* CodegenDelegator.kt:200 */
  206    210   
}
  207    211   
         212  +
/* CrateVersionCustomization.kt:23 */
  208    213   
/// Crate version number.
  209    214   
pub static PKG_VERSION: &str = env!("CARGO_PKG_VERSION");
  210    215   
  211         -
/// All error types that operations can return. Documentation on these types is copied from the model.
         216  +
/// /* ServerRustModule.kt:55 */All error types that operations can return. Documentation on these types is copied from the model.
  212    217   
pub mod error;
  213    218   
  214         -
/// Input structures for operations. Documentation on these types is copied from the model.
         219  +
/// /* ServerRustModule.kt:55 */Input structures for operations. Documentation on these types is copied from the model.
  215    220   
pub mod input;
  216    221   
  217         -
/// Data structures used by operation inputs/outputs. Documentation on these types is copied from the model.
         222  +
/// /* ServerRustModule.kt:55 */Data structures used by operation inputs/outputs. Documentation on these types is copied from the model.
  218    223   
pub mod model;
  219    224   
  220         -
/// All operations that this crate can perform.
         225  +
/// /* ServerRustModule.kt:55 */All operations that this crate can perform.
  221    226   
pub mod operation;
  222    227   
         228  +
/* ServerRustModule.kt:79 */
  223    229   
/// A collection of types representing each operation defined in the service closure.
  224    230   
///
  225    231   
/// The [plugin system](::aws_smithy_http_server::plugin) makes use of these
  226    232   
/// [zero-sized types](https://doc.rust-lang.org/nomicon/exotic-sizes.html#zero-sized-types-zsts) (ZSTs) to
  227    233   
/// parameterize [`Plugin`](::aws_smithy_http_server::plugin::Plugin) implementations. Their traits, such as
  228    234   
/// [`OperationShape`](::aws_smithy_http_server::operation::OperationShape), can be used to provide
  229    235   
/// operation specific information to the [`Layer`](::tower::Layer) being applied.
  230    236   
pub mod operation_shape;
  231    237   
  232         -
/// Output structures for operations. Documentation on these types is copied from the model.
         238  +
/// /* ServerRustModule.kt:55 */Output structures for operations. Documentation on these types is copied from the model.
  233    239   
pub mod output;
  234    240   
         241  +
/* RustModule.kt:172 */
  235    242   
mod service;
  236    243   
  237         -
/// Data primitives referenced by other data types.
         244  +
/// /* ServerRustModule.kt:55 */Data primitives referenced by other data types.
  238    245   
pub mod types;
  239    246   
  240         -
/// Constrained types for constrained shapes.
         247  +
/// /* ServerRustModule.kt:55 */Constrained types for constrained shapes.
         248  +
/* RustModule.kt:172 */
  241    249   
mod constrained;
  242    250   
  243    251   
pub(crate) mod protocol_serde;

tmp-codegen-diff/codegen-server-test/naming_test_structs/rust-server-codegen/src/model.rs

@@ -1,1 +311,533 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* StructureGenerator.kt:197 */
    2      3   
#[allow(missing_docs)] // documentation missing in model
           4  +
/* RustType.kt:516 */
    3      5   
#[derive(
    4      6   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
    5      7   
)]
    6         -
pub struct SomethingElse {
           8  +
pub /* StructureGenerator.kt:201 */ struct SomethingElse {
           9  +
    /* StructureGenerator.kt:231 */
    7     10   
    #[allow(missing_docs)] // documentation missing in model
    8     11   
    pub result: ::std::option::Option<crate::model::Result>,
          12  +
    /* StructureGenerator.kt:231 */
    9     13   
    #[allow(missing_docs)] // documentation missing in model
   10     14   
    pub result_list: ::std::option::Option<::std::vec::Vec<crate::model::Result>>,
          15  +
    /* StructureGenerator.kt:231 */
   11     16   
    #[allow(missing_docs)] // documentation missing in model
   12     17   
    pub option: ::std::option::Option<crate::model::Option>,
          18  +
    /* StructureGenerator.kt:231 */
   13     19   
    #[allow(missing_docs)] // documentation missing in model
   14     20   
    pub option_list: ::std::option::Option<::std::vec::Vec<crate::model::Result>>,
          21  +
    /* StructureGenerator.kt:231 */
   15     22   
    #[allow(missing_docs)] // documentation missing in model
   16     23   
    pub some_union: ::std::option::Option<crate::model::SomeUnion>,
          24  +
    /* StructureGenerator.kt:201 */
   17     25   
}
          26  +
/* StructureGenerator.kt:135 */
   18     27   
impl SomethingElse {
          28  +
    /* StructureGenerator.kt:231 */
   19     29   
    #[allow(missing_docs)] // documentation missing in model
          30  +
                           /* StructureGenerator.kt:166 */
   20     31   
    pub fn result(&self) -> ::std::option::Option<&crate::model::Result> {
          32  +
        /* StructureGenerator.kt:170 */
   21     33   
        self.result.as_ref()
          34  +
        /* StructureGenerator.kt:166 */
   22     35   
    }
          36  +
    /* StructureGenerator.kt:231 */
   23     37   
    #[allow(missing_docs)] // documentation missing in model
          38  +
                           /* StructureGenerator.kt:166 */
   24     39   
    pub fn result_list(&self) -> ::std::option::Option<&[crate::model::Result]> {
          40  +
        /* StructureGenerator.kt:169 */
   25     41   
        self.result_list.as_deref()
          42  +
        /* StructureGenerator.kt:166 */
   26     43   
    }
          44  +
    /* StructureGenerator.kt:231 */
   27     45   
    #[allow(missing_docs)] // documentation missing in model
          46  +
                           /* StructureGenerator.kt:166 */
   28     47   
    pub fn option(&self) -> ::std::option::Option<&crate::model::Option> {
          48  +
        /* StructureGenerator.kt:170 */
   29     49   
        self.option.as_ref()
          50  +
        /* StructureGenerator.kt:166 */
   30     51   
    }
          52  +
    /* StructureGenerator.kt:231 */
   31     53   
    #[allow(missing_docs)] // documentation missing in model
          54  +
                           /* StructureGenerator.kt:166 */
   32     55   
    pub fn option_list(&self) -> ::std::option::Option<&[crate::model::Result]> {
          56  +
        /* StructureGenerator.kt:169 */
   33     57   
        self.option_list.as_deref()
          58  +
        /* StructureGenerator.kt:166 */
   34     59   
    }
          60  +
    /* StructureGenerator.kt:231 */
   35     61   
    #[allow(missing_docs)] // documentation missing in model
          62  +
                           /* StructureGenerator.kt:166 */
   36     63   
    pub fn some_union(&self) -> ::std::option::Option<&crate::model::SomeUnion> {
          64  +
        /* StructureGenerator.kt:170 */
   37     65   
        self.some_union.as_ref()
          66  +
        /* StructureGenerator.kt:166 */
   38     67   
    }
          68  +
    /* StructureGenerator.kt:135 */
   39     69   
}
          70  +
/* ServerCodegenVisitor.kt:345 */
   40     71   
impl SomethingElse {
   41         -
    /// Creates a new builder-style object to manufacture [`SomethingElse`](crate::model::SomethingElse).
          72  +
    /// /* ServerBuilderGenerator.kt:294 */Creates a new builder-style object to manufacture [`SomethingElse`](crate::model::SomethingElse).
          73  +
    /* ServerBuilderGenerator.kt:295 */
   42     74   
    pub fn builder() -> crate::model::something_else::Builder {
          75  +
        /* ServerBuilderGenerator.kt:296 */
   43     76   
        crate::model::something_else::Builder::default()
          77  +
        /* ServerBuilderGenerator.kt:295 */
   44     78   
    }
          79  +
    /* ServerCodegenVisitor.kt:345 */
   45     80   
}
          81  +
/* ServerStructureConstrainedTraitImpl.kt:21 */
   46     82   
impl crate::constrained::Constrained for crate::model::SomethingElse {
   47     83   
    type Unconstrained = crate::model::something_else::Builder;
   48     84   
}
   49     85   
          86  +
/* UnionGenerator.kt:67 */
   50     87   
#[allow(missing_docs)] // documentation missing in model
          88  +
/* RustType.kt:516 */
   51     89   
#[derive(
   52     90   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
   53     91   
)]
   54         -
pub enum SomeUnion {
          92  +
pub /* UnionGenerator.kt:85 */ enum SomeUnion {
          93  +
    /* UnionGenerator.kt:90 */
   55     94   
    #[allow(missing_docs)] // documentation missing in model
          95  +
    /* UnionGenerator.kt:190 */
   56     96   
    Option(crate::model::Option),
          97  +
    /* UnionGenerator.kt:90 */
   57     98   
    #[allow(missing_docs)] // documentation missing in model
          99  +
    /* UnionGenerator.kt:190 */
   58    100   
    Result(crate::model::Result),
         101  +
    /* UnionGenerator.kt:85 */
   59    102   
}
         103  +
/* UnionGenerator.kt:111 */
   60    104   
impl SomeUnion {
         105  +
    /* UnionGenerator.kt:217 */
   61    106   
    /// Tries to convert the enum instance into [`Option`](crate::model::SomeUnion::Option), extracting the inner [`Option`](crate::model::Option).
         107  +
    /* UnionGenerator.kt:222 */
   62    108   
    /// Returns `Err(&Self)` if it can't be converted.
         109  +
    /* UnionGenerator.kt:223 */
   63    110   
    pub fn as_option(&self) -> ::std::result::Result<&crate::model::Option, &Self> {
         111  +
        /* UnionGenerator.kt:227 */
   64    112   
        if let SomeUnion::Option(val) = &self {
   65    113   
            ::std::result::Result::Ok(val)
   66    114   
        } else {
   67    115   
            ::std::result::Result::Err(self)
   68    116   
        }
         117  +
        /* UnionGenerator.kt:223 */
   69    118   
    }
         119  +
    /* UnionGenerator.kt:121 */
   70    120   
    /// Returns true if this is a [`Option`](crate::model::SomeUnion::Option).
         121  +
    /* UnionGenerator.kt:122 */
   71    122   
    pub fn is_option(&self) -> bool {
         123  +
        /* UnionGenerator.kt:123 */
   72    124   
        self.as_option().is_ok()
         125  +
        /* UnionGenerator.kt:122 */
   73    126   
    }
         127  +
    /* UnionGenerator.kt:217 */
   74    128   
    /// Tries to convert the enum instance into [`Result`](crate::model::SomeUnion::Result), extracting the inner [`Result`](crate::model::Result).
         129  +
    /* UnionGenerator.kt:222 */
   75    130   
    /// Returns `Err(&Self)` if it can't be converted.
         131  +
    /* UnionGenerator.kt:223 */
   76    132   
    pub fn as_result(&self) -> ::std::result::Result<&crate::model::Result, &Self> {
         133  +
        /* UnionGenerator.kt:227 */
   77    134   
        if let SomeUnion::Result(val) = &self {
   78    135   
            ::std::result::Result::Ok(val)
   79    136   
        } else {
   80    137   
            ::std::result::Result::Err(self)
   81    138   
        }
         139  +
        /* UnionGenerator.kt:223 */
   82    140   
    }
         141  +
    /* UnionGenerator.kt:121 */
   83    142   
    /// Returns true if this is a [`Result`](crate::model::SomeUnion::Result).
         143  +
    /* UnionGenerator.kt:122 */
   84    144   
    pub fn is_result(&self) -> bool {
         145  +
        /* UnionGenerator.kt:123 */
   85    146   
        self.as_result().is_ok()
         147  +
        /* UnionGenerator.kt:122 */
   86    148   
    }
         149  +
    /* UnionGenerator.kt:111 */
   87    150   
}
   88    151   
         152  +
/* StructureGenerator.kt:197 */
   89    153   
#[allow(missing_docs)] // documentation missing in model
         154  +
/* RustType.kt:516 */
   90    155   
#[derive(
   91    156   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
   92    157   
)]
   93         -
pub struct Option {
         158  +
pub /* StructureGenerator.kt:201 */ struct Option {
         159  +
    /* StructureGenerator.kt:231 */
   94    160   
    #[allow(missing_docs)] // documentation missing in model
   95    161   
    pub value: ::std::option::Option<::std::string::String>,
         162  +
    /* StructureGenerator.kt:201 */
   96    163   
}
         164  +
/* StructureGenerator.kt:135 */
   97    165   
impl Option {
         166  +
    /* StructureGenerator.kt:231 */
   98    167   
    #[allow(missing_docs)] // documentation missing in model
         168  +
                           /* StructureGenerator.kt:166 */
   99    169   
    pub fn value(&self) -> ::std::option::Option<&str> {
         170  +
        /* StructureGenerator.kt:169 */
  100    171   
        self.value.as_deref()
         172  +
        /* StructureGenerator.kt:166 */
  101    173   
    }
         174  +
    /* StructureGenerator.kt:135 */
  102    175   
}
         176  +
/* ServerCodegenVisitor.kt:345 */
  103    177   
impl Option {
  104         -
    /// Creates a new builder-style object to manufacture [`Option`](crate::model::Option).
         178  +
    /// /* ServerBuilderGenerator.kt:294 */Creates a new builder-style object to manufacture [`Option`](crate::model::Option).
         179  +
    /* ServerBuilderGenerator.kt:295 */
  105    180   
    pub fn builder() -> crate::model::option::Builder {
         181  +
        /* ServerBuilderGenerator.kt:296 */
  106    182   
        crate::model::option::Builder::default()
         183  +
        /* ServerBuilderGenerator.kt:295 */
  107    184   
    }
         185  +
    /* ServerCodegenVisitor.kt:345 */
  108    186   
}
         187  +
/* ServerStructureConstrainedTraitImpl.kt:21 */
  109    188   
impl crate::constrained::Constrained for crate::model::Option {
  110    189   
    type Unconstrained = crate::model::option::Builder;
  111    190   
}
  112    191   
         192  +
/* StructureGenerator.kt:197 */
  113    193   
#[allow(missing_docs)] // documentation missing in model
         194  +
/* RustType.kt:516 */
  114    195   
#[derive(
  115    196   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
  116    197   
)]
  117         -
pub struct Result {
         198  +
pub /* StructureGenerator.kt:201 */ struct Result {
         199  +
    /* StructureGenerator.kt:231 */
  118    200   
    #[allow(missing_docs)] // documentation missing in model
  119    201   
    pub value: ::std::option::Option<::std::string::String>,
         202  +
    /* StructureGenerator.kt:201 */
  120    203   
}
         204  +
/* StructureGenerator.kt:135 */
  121    205   
impl Result {
         206  +
    /* StructureGenerator.kt:231 */
  122    207   
    #[allow(missing_docs)] // documentation missing in model
         208  +
                           /* StructureGenerator.kt:166 */
  123    209   
    pub fn value(&self) -> ::std::option::Option<&str> {
         210  +
        /* StructureGenerator.kt:169 */
  124    211   
        self.value.as_deref()
         212  +
        /* StructureGenerator.kt:166 */
  125    213   
    }
         214  +
    /* StructureGenerator.kt:135 */
  126    215   
}
         216  +
/* ServerCodegenVisitor.kt:345 */
  127    217   
impl Result {
  128         -
    /// Creates a new builder-style object to manufacture [`Result`](crate::model::Result).
         218  +
    /// /* ServerBuilderGenerator.kt:294 */Creates a new builder-style object to manufacture [`Result`](crate::model::Result).
         219  +
    /* ServerBuilderGenerator.kt:295 */
  129    220   
    pub fn builder() -> crate::model::result::Builder {
         221  +
        /* ServerBuilderGenerator.kt:296 */
  130    222   
        crate::model::result::Builder::default()
         223  +
        /* ServerBuilderGenerator.kt:295 */
  131    224   
    }
         225  +
    /* ServerCodegenVisitor.kt:345 */
  132    226   
}
         227  +
/* ServerStructureConstrainedTraitImpl.kt:21 */
  133    228   
impl crate::constrained::Constrained for crate::model::Result {
  134    229   
    type Unconstrained = crate::model::result::Builder;
  135    230   
}
  136         -
/// See [`SomethingElse`](crate::model::SomethingElse).
         231  +
/// /* ServerBuilderGenerator.kt:171 */See [`SomethingElse`](crate::model::SomethingElse).
  137    232   
pub mod something_else {
  138    233   
         234  +
    /* ServerBuilderGenerator.kt:461 */
  139    235   
    impl ::std::convert::From<Builder> for crate::model::SomethingElse {
  140    236   
        fn from(builder: Builder) -> Self {
  141    237   
            builder.build()
  142    238   
        }
  143    239   
    }
  144         -
    /// A builder for [`SomethingElse`](crate::model::SomethingElse).
         240  +
    /// /* ServerBuilderGenerator.kt:201 */A builder for [`SomethingElse`](crate::model::SomethingElse).
         241  +
    /* RustType.kt:516 */
  145    242   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         243  +
    /* ServerBuilderGenerator.kt:211 */
  146    244   
    pub struct Builder {
         245  +
        /* ServerBuilderGenerator.kt:308 */
  147    246   
        pub(crate) result: ::std::option::Option<crate::model::Result>,
         247  +
        /* ServerBuilderGenerator.kt:308 */
  148    248   
        pub(crate) result_list: ::std::option::Option<::std::vec::Vec<crate::model::Result>>,
         249  +
        /* ServerBuilderGenerator.kt:308 */
  149    250   
        pub(crate) option: ::std::option::Option<crate::model::Option>,
         251  +
        /* ServerBuilderGenerator.kt:308 */
  150    252   
        pub(crate) option_list: ::std::option::Option<::std::vec::Vec<crate::model::Result>>,
         253  +
        /* ServerBuilderGenerator.kt:308 */
  151    254   
        pub(crate) some_union: ::std::option::Option<crate::model::SomeUnion>,
         255  +
        /* ServerBuilderGenerator.kt:211 */
  152    256   
    }
         257  +
    /* ServerBuilderGenerator.kt:215 */
  153    258   
    impl Builder {
         259  +
        /* ServerBuilderGenerator.kt:331 */
  154    260   
        #[allow(missing_docs)] // documentation missing in model
         261  +
                               /* ServerBuilderGenerator.kt:343 */
  155    262   
        pub fn result(mut self, input: ::std::option::Option<crate::model::Result>) -> Self {
  156         -
            self.result = input;
         263  +
            /* ServerBuilderGenerator.kt:344 */
         264  +
            self.result =
         265  +
                /* ServerBuilderGenerator.kt:376 */input
         266  +
            /* ServerBuilderGenerator.kt:344 */;
  157    267   
            self
         268  +
            /* ServerBuilderGenerator.kt:343 */
  158    269   
        }
         270  +
        /* ServerBuilderGenerator.kt:426 */
  159    271   
        #[allow(missing_docs)] // documentation missing in model
         272  +
                               /* ServerBuilderGenerator.kt:428 */
  160    273   
        pub(crate) fn set_result(
  161    274   
            mut self,
  162    275   
            input: Option<impl ::std::convert::Into<crate::model::Result>>,
  163    276   
        ) -> Self {
         277  +
            /* ServerBuilderGenerator.kt:429 */
  164    278   
            self.result = input.map(|v| v.into());
  165    279   
            self
         280  +
            /* ServerBuilderGenerator.kt:428 */
  166    281   
        }
         282  +
        /* ServerBuilderGenerator.kt:331 */
  167    283   
        #[allow(missing_docs)] // documentation missing in model
         284  +
                               /* ServerBuilderGenerator.kt:343 */
  168    285   
        pub fn result_list(
  169    286   
            mut self,
  170    287   
            input: ::std::option::Option<::std::vec::Vec<crate::model::Result>>,
  171    288   
        ) -> Self {
  172         -
            self.result_list = input;
         289  +
            /* ServerBuilderGenerator.kt:344 */
         290  +
            self.result_list =
         291  +
                /* ServerBuilderGenerator.kt:376 */input
         292  +
            /* ServerBuilderGenerator.kt:344 */;
  173    293   
            self
         294  +
            /* ServerBuilderGenerator.kt:343 */
  174    295   
        }
         296  +
        /* ServerBuilderGenerator.kt:426 */
  175    297   
        #[allow(missing_docs)] // documentation missing in model
         298  +
                               /* ServerBuilderGenerator.kt:428 */
  176    299   
        pub(crate) fn set_result_list(
  177    300   
            mut self,
  178    301   
            input: Option<impl ::std::convert::Into<::std::vec::Vec<crate::model::Result>>>,
  179    302   
        ) -> Self {
         303  +
            /* ServerBuilderGenerator.kt:429 */
  180    304   
            self.result_list = input.map(|v| v.into());
  181    305   
            self
         306  +
            /* ServerBuilderGenerator.kt:428 */
  182    307   
        }
         308  +
        /* ServerBuilderGenerator.kt:331 */
  183    309   
        #[allow(missing_docs)] // documentation missing in model
         310  +
                               /* ServerBuilderGenerator.kt:343 */
  184    311   
        pub fn option(mut self, input: ::std::option::Option<crate::model::Option>) -> Self {
  185         -
            self.option = input;
         312  +
            /* ServerBuilderGenerator.kt:344 */
         313  +
            self.option =
         314  +
                /* ServerBuilderGenerator.kt:376 */input
         315  +
            /* ServerBuilderGenerator.kt:344 */;
  186    316   
            self
         317  +
            /* ServerBuilderGenerator.kt:343 */
  187    318   
        }
         319  +
        /* ServerBuilderGenerator.kt:426 */
  188    320   
        #[allow(missing_docs)] // documentation missing in model
         321  +
                               /* ServerBuilderGenerator.kt:428 */
  189    322   
        pub(crate) fn set_option(
  190    323   
            mut self,
  191    324   
            input: Option<impl ::std::convert::Into<crate::model::Option>>,
  192    325   
        ) -> Self {
         326  +
            /* ServerBuilderGenerator.kt:429 */
  193    327   
            self.option = input.map(|v| v.into());
  194    328   
            self
         329  +
            /* ServerBuilderGenerator.kt:428 */
  195    330   
        }
         331  +
        /* ServerBuilderGenerator.kt:331 */
  196    332   
        #[allow(missing_docs)] // documentation missing in model
         333  +
                               /* ServerBuilderGenerator.kt:343 */
  197    334   
        pub fn option_list(
  198    335   
            mut self,
  199    336   
            input: ::std::option::Option<::std::vec::Vec<crate::model::Result>>,
  200    337   
        ) -> Self {
  201         -
            self.option_list = input;
         338  +
            /* ServerBuilderGenerator.kt:344 */
         339  +
            self.option_list =
         340  +
                /* ServerBuilderGenerator.kt:376 */input
         341  +
            /* ServerBuilderGenerator.kt:344 */;
  202    342   
            self
         343  +
            /* ServerBuilderGenerator.kt:343 */
  203    344   
        }
         345  +
        /* ServerBuilderGenerator.kt:426 */
  204    346   
        #[allow(missing_docs)] // documentation missing in model
         347  +
                               /* ServerBuilderGenerator.kt:428 */
  205    348   
        pub(crate) fn set_option_list(
  206    349   
            mut self,
  207    350   
            input: Option<impl ::std::convert::Into<::std::vec::Vec<crate::model::Result>>>,
  208    351   
        ) -> Self {
         352  +
            /* ServerBuilderGenerator.kt:429 */
  209    353   
            self.option_list = input.map(|v| v.into());
  210    354   
            self
         355  +
            /* ServerBuilderGenerator.kt:428 */
  211    356   
        }
         357  +
        /* ServerBuilderGenerator.kt:331 */
  212    358   
        #[allow(missing_docs)] // documentation missing in model
         359  +
                               /* ServerBuilderGenerator.kt:343 */
  213    360   
        pub fn some_union(mut self, input: ::std::option::Option<crate::model::SomeUnion>) -> Self {
  214         -
            self.some_union = input;
         361  +
            /* ServerBuilderGenerator.kt:344 */
         362  +
            self.some_union =
         363  +
                /* ServerBuilderGenerator.kt:376 */input
         364  +
            /* ServerBuilderGenerator.kt:344 */;
  215    365   
            self
         366  +
            /* ServerBuilderGenerator.kt:343 */
  216    367   
        }
         368  +
        /* ServerBuilderGenerator.kt:426 */
  217    369   
        #[allow(missing_docs)] // documentation missing in model
         370  +
                               /* ServerBuilderGenerator.kt:428 */
  218    371   
        pub(crate) fn set_some_union(
  219    372   
            mut self,
  220    373   
            input: Option<impl ::std::convert::Into<crate::model::SomeUnion>>,
  221    374   
        ) -> Self {
         375  +
            /* ServerBuilderGenerator.kt:429 */
  222    376   
            self.some_union = input.map(|v| v.into());
  223    377   
            self
         378  +
            /* ServerBuilderGenerator.kt:428 */
  224    379   
        }
  225         -
        /// Consumes the builder and constructs a [`SomethingElse`](crate::model::SomethingElse).
         380  +
        /// /* ServerBuilderGenerator.kt:258 */Consumes the builder and constructs a [`SomethingElse`](crate::model::SomethingElse).
         381  +
        /* ServerBuilderGenerator.kt:271 */
  226    382   
        pub fn build(self) -> crate::model::SomethingElse {
  227    383   
            self.build_enforcing_all_constraints()
  228    384   
        }
         385  +
        /* ServerBuilderGenerator.kt:283 */
  229    386   
        fn build_enforcing_all_constraints(self) -> crate::model::SomethingElse {
         387  +
            /* ServerBuilderGenerator.kt:542 */
  230    388   
            crate::model::SomethingElse {
         389  +
                /* ServerBuilderGenerator.kt:546 */
  231    390   
                result: self.result,
         391  +
                /* ServerBuilderGenerator.kt:546 */
  232    392   
                result_list: self.result_list,
         393  +
                /* ServerBuilderGenerator.kt:546 */
  233    394   
                option: self.option,
         395  +
                /* ServerBuilderGenerator.kt:546 */
  234    396   
                option_list: self.option_list,
         397  +
                /* ServerBuilderGenerator.kt:546 */
  235    398   
                some_union: self.some_union,
         399  +
                /* ServerBuilderGenerator.kt:542 */
  236    400   
            }
         401  +
            /* ServerBuilderGenerator.kt:283 */
  237    402   
        }
         403  +
        /* ServerBuilderGenerator.kt:215 */
  238    404   
    }
         405  +
         406  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  239    407   
}
  240         -
/// See [`Option`](crate::model::Option).
         408  +
/// /* ServerBuilderGenerator.kt:171 */See [`Option`](crate::model::Option).
  241    409   
pub mod option {
  242    410   
         411  +
    /* ServerBuilderGenerator.kt:461 */
  243    412   
    impl ::std::convert::From<Builder> for crate::model::Option {
  244    413   
        fn from(builder: Builder) -> Self {
  245    414   
            builder.build()
  246    415   
        }
  247    416   
    }
  248         -
    /// A builder for [`Option`](crate::model::Option).
         417  +
    /// /* ServerBuilderGenerator.kt:201 */A builder for [`Option`](crate::model::Option).
         418  +
    /* RustType.kt:516 */
  249    419   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         420  +
    /* ServerBuilderGenerator.kt:211 */
  250    421   
    pub struct Builder {
         422  +
        /* ServerBuilderGenerator.kt:308 */
  251    423   
        pub(crate) value: ::std::option::Option<::std::string::String>,
         424  +
        /* ServerBuilderGenerator.kt:211 */
  252    425   
    }
         426  +
    /* ServerBuilderGenerator.kt:215 */
  253    427   
    impl Builder {
         428  +
        /* ServerBuilderGenerator.kt:331 */
  254    429   
        #[allow(missing_docs)] // documentation missing in model
         430  +
                               /* ServerBuilderGenerator.kt:343 */
  255    431   
        pub fn value(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  256         -
            self.value = input;
         432  +
            /* ServerBuilderGenerator.kt:344 */
         433  +
            self.value =
         434  +
                /* ServerBuilderGenerator.kt:376 */input
         435  +
            /* ServerBuilderGenerator.kt:344 */;
  257    436   
            self
         437  +
            /* ServerBuilderGenerator.kt:343 */
  258    438   
        }
         439  +
        /* ServerBuilderGenerator.kt:426 */
  259    440   
        #[allow(missing_docs)] // documentation missing in model
         441  +
                               /* ServerBuilderGenerator.kt:428 */
  260    442   
        pub(crate) fn set_value(
  261    443   
            mut self,
  262    444   
            input: Option<impl ::std::convert::Into<::std::string::String>>,
  263    445   
        ) -> Self {
         446  +
            /* ServerBuilderGenerator.kt:429 */
  264    447   
            self.value = input.map(|v| v.into());
  265    448   
            self
         449  +
            /* ServerBuilderGenerator.kt:428 */
  266    450   
        }
  267         -
        /// Consumes the builder and constructs a [`Option`](crate::model::Option).
         451  +
        /// /* ServerBuilderGenerator.kt:258 */Consumes the builder and constructs a [`Option`](crate::model::Option).
         452  +
        /* ServerBuilderGenerator.kt:271 */
  268    453   
        pub fn build(self) -> crate::model::Option {
  269    454   
            self.build_enforcing_all_constraints()
  270    455   
        }
         456  +
        /* ServerBuilderGenerator.kt:283 */
  271    457   
        fn build_enforcing_all_constraints(self) -> crate::model::Option {
  272         -
            crate::model::Option { value: self.value }
         458  +
            /* ServerBuilderGenerator.kt:542 */
         459  +
            crate::model::Option {
         460  +
                /* ServerBuilderGenerator.kt:546 */
         461  +
                value: self.value,
         462  +
                /* ServerBuilderGenerator.kt:542 */
         463  +
            }
         464  +
            /* ServerBuilderGenerator.kt:283 */
  273    465   
        }
         466  +
        /* ServerBuilderGenerator.kt:215 */
  274    467   
    }
         468  +
         469  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  275    470   
}
  276         -
/// See [`Result`](crate::model::Result).
         471  +
/// /* ServerBuilderGenerator.kt:171 */See [`Result`](crate::model::Result).
  277    472   
pub mod result {
  278    473   
         474  +
    /* ServerBuilderGenerator.kt:461 */
  279    475   
    impl ::std::convert::From<Builder> for crate::model::Result {
  280    476   
        fn from(builder: Builder) -> Self {
  281    477   
            builder.build()
  282    478   
        }
  283    479   
    }
  284         -
    /// A builder for [`Result`](crate::model::Result).
         480  +
    /// /* ServerBuilderGenerator.kt:201 */A builder for [`Result`](crate::model::Result).
         481  +
    /* RustType.kt:516 */
  285    482   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         483  +
    /* ServerBuilderGenerator.kt:211 */
  286    484   
    pub struct Builder {
         485  +
        /* ServerBuilderGenerator.kt:308 */
  287    486   
        pub(crate) value: ::std::option::Option<::std::string::String>,
         487  +
        /* ServerBuilderGenerator.kt:211 */
  288    488   
    }
         489  +
    /* ServerBuilderGenerator.kt:215 */
  289    490   
    impl Builder {
         491  +
        /* ServerBuilderGenerator.kt:331 */
  290    492   
        #[allow(missing_docs)] // documentation missing in model
         493  +
                               /* ServerBuilderGenerator.kt:343 */
  291    494   
        pub fn value(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  292         -
            self.value = input;
         495  +
            /* ServerBuilderGenerator.kt:344 */
         496  +
            self.value =
         497  +
                /* ServerBuilderGenerator.kt:376 */input
         498  +
            /* ServerBuilderGenerator.kt:344 */;
  293    499   
            self
         500  +
            /* ServerBuilderGenerator.kt:343 */
  294    501   
        }
         502  +
        /* ServerBuilderGenerator.kt:426 */
  295    503   
        #[allow(missing_docs)] // documentation missing in model
         504  +
                               /* ServerBuilderGenerator.kt:428 */
  296    505   
        pub(crate) fn set_value(
  297    506   
            mut self,
  298    507   
            input: Option<impl ::std::convert::Into<::std::string::String>>,
  299    508   
        ) -> Self {
         509  +
            /* ServerBuilderGenerator.kt:429 */
  300    510   
            self.value = input.map(|v| v.into());
  301    511   
            self
         512  +
            /* ServerBuilderGenerator.kt:428 */
  302    513   
        }
  303         -
        /// Consumes the builder and constructs a [`Result`](crate::model::Result).
         514  +
        /// /* ServerBuilderGenerator.kt:258 */Consumes the builder and constructs a [`Result`](crate::model::Result).
         515  +
        /* ServerBuilderGenerator.kt:271 */
  304    516   
        pub fn build(self) -> crate::model::Result {
  305    517   
            self.build_enforcing_all_constraints()
  306    518   
        }
         519  +
        /* ServerBuilderGenerator.kt:283 */
  307    520   
        fn build_enforcing_all_constraints(self) -> crate::model::Result {
  308         -
            crate::model::Result { value: self.value }
         521  +
            /* ServerBuilderGenerator.kt:542 */
         522  +
            crate::model::Result {
         523  +
                /* ServerBuilderGenerator.kt:546 */
         524  +
                value: self.value,
         525  +
                /* ServerBuilderGenerator.kt:542 */
  309    526   
            }
         527  +
            /* ServerBuilderGenerator.kt:283 */
  310    528   
        }
         529  +
        /* ServerBuilderGenerator.kt:215 */
         530  +
    }
         531  +
         532  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  311    533   
}

tmp-codegen-diff/codegen-server-test/naming_test_structs/rust-server-codegen/src/operation.rs

@@ -1,1 +31,32 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* ServerHttpBoundProtocolGenerator.kt:266 */
    2      3   
static CONTENT_TYPE_STRUCTS: std::sync::LazyLock<::mime::Mime> = std::sync::LazyLock::new(|| {
    3      4   
    "application/x-amz-json-1.1"
    4      5   
        .parse::<::mime::Mime>()
    5      6   
        .expect("BUG: MIME parsing failed, content_type is not valid")
    6      7   
});
    7      8   
::pin_project_lite::pin_project! {
    8      9   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
    9     10   
    /// [`StructsInput`](crate::input::StructsInput) using modelled bindings.
   10     11   
    pub struct StructsInputFuture {
   11     12   
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::StructsInput, ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError>> + Send>>
@@ -40,41 +90,92 @@
   60     61   
            |e: ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection| {
   61     62   
                ::tracing::debug!(error = %e, "failed to deserialize request");
   62     63   
                ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e)
   63     64   
            },
   64     65   
        );
   65     66   
        StructsInputFuture {
   66     67   
            inner: Box::pin(fut),
   67     68   
        }
   68     69   
    }
   69     70   
}
          71  +
/* ServerHttpBoundProtocolGenerator.kt:329 */
   70     72   
impl
   71     73   
    ::aws_smithy_http_server::response::IntoResponse<
   72     74   
        ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1,
   73     75   
    > for crate::output::StructsOutput
   74     76   
{
   75     77   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
   76     78   
        match crate::protocol_serde::shape_structs::ser_structs_http_response(self) {
   77     79   
            Ok(response) => response,
   78     80   
            Err(e) => {
   79     81   
                ::tracing::error!(error = %e, "failed to serialize response");

tmp-codegen-diff/codegen-server-test/naming_test_structs/rust-server-codegen/src/operation_shape.rs

@@ -1,1 +0,32 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* ServerOperationGenerator.kt:48 */
    2      3   
#[allow(missing_docs)] // documentation missing in model
           4  +
                       /* ServerOperationGenerator.kt:55 */
    3      5   
pub struct Structs;
    4      6   
    5      7   
impl ::aws_smithy_http_server::operation::OperationShape for Structs {
    6      8   
    const ID: ::aws_smithy_http_server::shape_id::ShapeId =
    7      9   
        ::aws_smithy_http_server::shape_id::ShapeId::new(
    8     10   
            "naming_obs_structs#Structs",
    9     11   
            "naming_obs_structs",
   10     12   
            "Structs",
   11     13   
        );
   12     14   
   13     15   
    type Input = crate::input::StructsInput;
   14     16   
    type Output = crate::output::StructsOutput;
   15     17   
    type Error = std::convert::Infallible;
   16     18   
}
   17     19   
   18     20   
impl ::aws_smithy_http_server::instrumentation::sensitivity::Sensitivity for Structs {
   19     21   
    type RequestFmt = ::aws_smithy_http_server::instrumentation::sensitivity::DefaultRequestFmt;
   20     22   
    type ResponseFmt = ::aws_smithy_http_server::instrumentation::sensitivity::DefaultResponseFmt;
   21     23   
   22     24   
    fn request_fmt() -> Self::RequestFmt {
   23     25   
        ::aws_smithy_http_server::instrumentation::sensitivity::RequestFmt::new()
   24     26   
    }
   25     27   
   26     28   
    fn response_fmt() -> Self::ResponseFmt {
   27     29   
        ::aws_smithy_http_server::instrumentation::sensitivity::ResponseFmt::new()
   28     30   
    }
   29     31   
}
          32  +
/* ServerOperationGenerator.kt:88 */

tmp-codegen-diff/codegen-server-test/naming_test_structs/rust-server-codegen/src/output.rs

@@ -1,1 +112,200 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* StructureGenerator.kt:197 */
    2      3   
#[allow(missing_docs)] // documentation missing in model
           4  +
/* RustType.kt:516 */
    3      5   
#[derive(
    4      6   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
    5      7   
)]
    6         -
pub struct StructsOutput {
           8  +
pub /* StructureGenerator.kt:201 */ struct StructsOutput {
           9  +
    /* StructureGenerator.kt:231 */
    7     10   
    #[allow(missing_docs)] // documentation missing in model
    8     11   
    pub result: ::std::option::Option<crate::model::Result>,
          12  +
    /* StructureGenerator.kt:231 */
    9     13   
    #[allow(missing_docs)] // documentation missing in model
   10     14   
    pub result_list: ::std::option::Option<::std::vec::Vec<crate::model::Result>>,
          15  +
    /* StructureGenerator.kt:231 */
   11     16   
    #[allow(missing_docs)] // documentation missing in model
   12     17   
    pub option: ::std::option::Option<crate::model::Option>,
          18  +
    /* StructureGenerator.kt:231 */
   13     19   
    #[allow(missing_docs)] // documentation missing in model
   14     20   
    pub option_list: ::std::option::Option<::std::vec::Vec<crate::model::Result>>,
          21  +
    /* StructureGenerator.kt:231 */
   15     22   
    #[allow(missing_docs)] // documentation missing in model
   16     23   
    pub something_else: ::std::option::Option<crate::model::SomethingElse>,
          24  +
    /* StructureGenerator.kt:201 */
   17     25   
}
          26  +
/* StructureGenerator.kt:135 */
   18     27   
impl StructsOutput {
          28  +
    /* StructureGenerator.kt:231 */
   19     29   
    #[allow(missing_docs)] // documentation missing in model
          30  +
                           /* StructureGenerator.kt:166 */
   20     31   
    pub fn result(&self) -> ::std::option::Option<&crate::model::Result> {
          32  +
        /* StructureGenerator.kt:170 */
   21     33   
        self.result.as_ref()
          34  +
        /* StructureGenerator.kt:166 */
   22     35   
    }
          36  +
    /* StructureGenerator.kt:231 */
   23     37   
    #[allow(missing_docs)] // documentation missing in model
          38  +
                           /* StructureGenerator.kt:166 */
   24     39   
    pub fn result_list(&self) -> ::std::option::Option<&[crate::model::Result]> {
          40  +
        /* StructureGenerator.kt:169 */
   25     41   
        self.result_list.as_deref()
          42  +
        /* StructureGenerator.kt:166 */
   26     43   
    }
          44  +
    /* StructureGenerator.kt:231 */
   27     45   
    #[allow(missing_docs)] // documentation missing in model
          46  +
                           /* StructureGenerator.kt:166 */
   28     47   
    pub fn option(&self) -> ::std::option::Option<&crate::model::Option> {
          48  +
        /* StructureGenerator.kt:170 */
   29     49   
        self.option.as_ref()
          50  +
        /* StructureGenerator.kt:166 */
   30     51   
    }
          52  +
    /* StructureGenerator.kt:231 */
   31     53   
    #[allow(missing_docs)] // documentation missing in model
          54  +
                           /* StructureGenerator.kt:166 */
   32     55   
    pub fn option_list(&self) -> ::std::option::Option<&[crate::model::Result]> {
          56  +
        /* StructureGenerator.kt:169 */
   33     57   
        self.option_list.as_deref()
          58  +
        /* StructureGenerator.kt:166 */
   34     59   
    }
          60  +
    /* StructureGenerator.kt:231 */
   35     61   
    #[allow(missing_docs)] // documentation missing in model
          62  +
                           /* StructureGenerator.kt:166 */
   36     63   
    pub fn something_else(&self) -> ::std::option::Option<&crate::model::SomethingElse> {
          64  +
        /* StructureGenerator.kt:170 */
   37     65   
        self.something_else.as_ref()
          66  +
        /* StructureGenerator.kt:166 */
   38     67   
    }
          68  +
    /* StructureGenerator.kt:135 */
   39     69   
}
          70  +
/* ServerCodegenVisitor.kt:345 */
   40     71   
impl StructsOutput {
   41         -
    /// Creates a new builder-style object to manufacture [`StructsOutput`](crate::output::StructsOutput).
          72  +
    /// /* ServerBuilderGenerator.kt:294 */Creates a new builder-style object to manufacture [`StructsOutput`](crate::output::StructsOutput).
          73  +
    /* ServerBuilderGenerator.kt:295 */
   42     74   
    pub fn builder() -> crate::output::structs_output::Builder {
          75  +
        /* ServerBuilderGenerator.kt:296 */
   43     76   
        crate::output::structs_output::Builder::default()
          77  +
        /* ServerBuilderGenerator.kt:295 */
   44     78   
    }
          79  +
    /* ServerCodegenVisitor.kt:345 */
   45     80   
}
   46         -
/// See [`StructsOutput`](crate::output::StructsOutput).
          81  +
/// /* ServerBuilderGenerator.kt:171 */See [`StructsOutput`](crate::output::StructsOutput).
   47     82   
pub mod structs_output {
   48     83   
          84  +
    /* ServerBuilderGenerator.kt:461 */
   49     85   
    impl ::std::convert::From<Builder> for crate::output::StructsOutput {
   50     86   
        fn from(builder: Builder) -> Self {
   51     87   
            builder.build()
   52     88   
        }
   53     89   
    }
   54         -
    /// A builder for [`StructsOutput`](crate::output::StructsOutput).
          90  +
    /// /* ServerBuilderGenerator.kt:201 */A builder for [`StructsOutput`](crate::output::StructsOutput).
          91  +
    /* RustType.kt:516 */
   55     92   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
          93  +
    /* ServerBuilderGenerator.kt:211 */
   56     94   
    pub struct Builder {
          95  +
        /* ServerBuilderGenerator.kt:308 */
   57     96   
        pub(crate) result: ::std::option::Option<crate::model::Result>,
          97  +
        /* ServerBuilderGenerator.kt:308 */
   58     98   
        pub(crate) result_list: ::std::option::Option<::std::vec::Vec<crate::model::Result>>,
          99  +
        /* ServerBuilderGenerator.kt:308 */
   59    100   
        pub(crate) option: ::std::option::Option<crate::model::Option>,
         101  +
        /* ServerBuilderGenerator.kt:308 */
   60    102   
        pub(crate) option_list: ::std::option::Option<::std::vec::Vec<crate::model::Result>>,
         103  +
        /* ServerBuilderGenerator.kt:308 */
   61    104   
        pub(crate) something_else: ::std::option::Option<crate::model::SomethingElse>,
         105  +
        /* ServerBuilderGenerator.kt:211 */
   62    106   
    }
         107  +
    /* ServerBuilderGenerator.kt:215 */
   63    108   
    impl Builder {
         109  +
        /* ServerBuilderGenerator.kt:331 */
   64    110   
        #[allow(missing_docs)] // documentation missing in model
         111  +
                               /* ServerBuilderGenerator.kt:343 */
   65    112   
        pub fn result(mut self, input: ::std::option::Option<crate::model::Result>) -> Self {
   66         -
            self.result = input;
         113  +
            /* ServerBuilderGenerator.kt:344 */
         114  +
            self.result =
         115  +
                /* ServerBuilderGenerator.kt:376 */input
         116  +
            /* ServerBuilderGenerator.kt:344 */;
   67    117   
            self
         118  +
            /* ServerBuilderGenerator.kt:343 */
   68    119   
        }
         120  +
        /* ServerBuilderGenerator.kt:331 */
   69    121   
        #[allow(missing_docs)] // documentation missing in model
         122  +
                               /* ServerBuilderGenerator.kt:343 */
   70    123   
        pub fn result_list(
   71    124   
            mut self,
   72    125   
            input: ::std::option::Option<::std::vec::Vec<crate::model::Result>>,
   73    126   
        ) -> Self {
   74         -
            self.result_list = input;
         127  +
            /* ServerBuilderGenerator.kt:344 */
         128  +
            self.result_list =
         129  +
                /* ServerBuilderGenerator.kt:376 */input
         130  +
            /* ServerBuilderGenerator.kt:344 */;
   75    131   
            self
         132  +
            /* ServerBuilderGenerator.kt:343 */
   76    133   
        }
         134  +
        /* ServerBuilderGenerator.kt:331 */
   77    135   
        #[allow(missing_docs)] // documentation missing in model
         136  +
                               /* ServerBuilderGenerator.kt:343 */
   78    137   
        pub fn option(mut self, input: ::std::option::Option<crate::model::Option>) -> Self {
   79         -
            self.option = input;
         138  +
            /* ServerBuilderGenerator.kt:344 */
         139  +
            self.option =
         140  +
                /* ServerBuilderGenerator.kt:376 */input
         141  +
            /* ServerBuilderGenerator.kt:344 */;
   80    142   
            self
         143  +
            /* ServerBuilderGenerator.kt:343 */
   81    144   
        }
         145  +
        /* ServerBuilderGenerator.kt:331 */
   82    146   
        #[allow(missing_docs)] // documentation missing in model
         147  +
                               /* ServerBuilderGenerator.kt:343 */
   83    148   
        pub fn option_list(
   84    149   
            mut self,
   85    150   
            input: ::std::option::Option<::std::vec::Vec<crate::model::Result>>,
   86    151   
        ) -> Self {
   87         -
            self.option_list = input;
         152  +
            /* ServerBuilderGenerator.kt:344 */
         153  +
            self.option_list =
         154  +
                /* ServerBuilderGenerator.kt:376 */input
         155  +
            /* ServerBuilderGenerator.kt:344 */;
   88    156   
            self
         157  +
            /* ServerBuilderGenerator.kt:343 */
   89    158   
        }
         159  +
        /* ServerBuilderGenerator.kt:331 */
   90    160   
        #[allow(missing_docs)] // documentation missing in model
         161  +
                               /* ServerBuilderGenerator.kt:343 */
   91    162   
        pub fn something_else(
   92    163   
            mut self,
   93    164   
            input: ::std::option::Option<crate::model::SomethingElse>,
   94    165   
        ) -> Self {
   95         -
            self.something_else = input;
         166  +
            /* ServerBuilderGenerator.kt:344 */
         167  +
            self.something_else =
         168  +
                /* ServerBuilderGenerator.kt:376 */input
         169  +
            /* ServerBuilderGenerator.kt:344 */;
   96    170   
            self
         171  +
            /* ServerBuilderGenerator.kt:343 */
   97    172   
        }
   98         -
        /// Consumes the builder and constructs a [`StructsOutput`](crate::output::StructsOutput).
         173  +
        /// /* ServerBuilderGenerator.kt:258 */Consumes the builder and constructs a [`StructsOutput`](crate::output::StructsOutput).
         174  +
        /* ServerBuilderGenerator.kt:271 */
   99    175   
        pub fn build(self) -> crate::output::StructsOutput {
  100    176   
            self.build_enforcing_all_constraints()
  101    177   
        }
         178  +
        /* ServerBuilderGenerator.kt:283 */
  102    179   
        fn build_enforcing_all_constraints(self) -> crate::output::StructsOutput {
         180  +
            /* ServerBuilderGenerator.kt:542 */
  103    181   
            crate::output::StructsOutput {
         182  +
                /* ServerBuilderGenerator.kt:546 */
  104    183   
                result: self.result,
         184  +
                /* ServerBuilderGenerator.kt:546 */
  105    185   
                result_list: self.result_list,
         186  +
                /* ServerBuilderGenerator.kt:546 */
  106    187   
                option: self.option,
         188  +
                /* ServerBuilderGenerator.kt:546 */
  107    189   
                option_list: self.option_list,
         190  +
                /* ServerBuilderGenerator.kt:546 */
  108    191   
                something_else: self.something_else,
         192  +
                /* ServerBuilderGenerator.kt:542 */
  109    193   
            }
         194  +
            /* ServerBuilderGenerator.kt:283 */
  110    195   
        }
         196  +
        /* ServerBuilderGenerator.kt:215 */
  111    197   
    }
         198  +
         199  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  112    200   
}

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

@@ -1,1 +24,25 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
pub(crate) mod shape_structs;
    3      3   
           4  +
/* JsonParserGenerator.kt:227 */
    4      5   
pub(crate) fn or_empty_doc(data: &[u8]) -> &[u8] {
    5      6   
    if data.is_empty() {
    6      7   
        b"{}"
    7      8   
    } else {
    8      9   
        data
    9     10   
    }
   10     11   
}
   11     12   
   12     13   
pub(crate) mod shape_structs_output;
   13     14   

tmp-codegen-diff/codegen-server-test/naming_test_structs/rust-server-codegen/src/protocol_serde/shape_option.rs

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

tmp-codegen-diff/codegen-server-test/naming_test_structs/rust-server-codegen/src/protocol_serde/shape_option_list.rs

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