Server Test Python

Server Test Python

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943

Files changed:

tmp-codegen-diff/codegen-server-test-python/constraints_without_public_constrained_types/rust-server-codegen-python/src/protocol_serde/shape_http_prefix_headers_targeting_length_map_operation.rs

@@ -1,1 +142,180 @@
    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_http_prefix_headers_targeting_length_map_operation_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::HttpPrefixHeadersTargetingLengthMapOperationInput,
    7      9   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
    8     10   
>
    9     11   
where
   10     12   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11     13   
    B::Data: Send,
   12     14   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
   13     15   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     16   
{
          17  +
    /* ServerHttpBoundProtocolGenerator.kt:399 */
   15     18   
    Ok({
          19  +
        /* RustType.kt:516 */
   16     20   
        #[allow(unused_mut)]
   17         -
        let mut input = crate::input::http_prefix_headers_targeting_length_map_operation_input_internal::Builder::default();
          21  +
        /* ServerHttpBoundProtocolGenerator.kt:723 */let mut input = crate::input::http_prefix_headers_targeting_length_map_operation_input_internal::Builder::default();
          22  +
        /* RustType.kt:516 */
   18     23   
        #[allow(unused_variables)]
          24  +
        /* ServerHttpBoundProtocolGenerator.kt:728 */
   19     25   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     26   
            uri, headers, body, ..
   21     27   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          28  +
        /* ServerHttpBoundProtocolGenerator.kt:794 */
   22     29   
        if let Some(value) = crate::protocol_serde::shape_http_prefix_headers_targeting_length_map_operation_input::de_length_map_prefix_header(&headers)? {
   23     30   
                                input = input.set_length_map(Some(value))
   24     31   
                            }
          32  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   25     33   
        input.build()?
          34  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   26     35   
    })
          36  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   27     37   
}
   28     38   
          39  +
/* RustType.kt:516 */
   29     40   
#[allow(clippy::unnecessary_wraps)]
          41  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   30     42   
pub fn ser_http_prefix_headers_targeting_length_map_operation_http_response(
   31     43   
    #[allow(unused_variables)]
   32     44   
    output: crate::output::HttpPrefixHeadersTargetingLengthMapOperationOutput,
   33     45   
) -> std::result::Result<
   34     46   
    ::aws_smithy_http_server::response::Response,
   35     47   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   36     48   
> {
          49  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   37     50   
    Ok({
          51  +
        /* RustType.kt:516 */
   38     52   
        #[allow(unused_mut)]
          53  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   39     54   
        let mut builder = ::http::Response::builder();
          55  +
        /* ServerHttpBoundProtocolGenerator.kt:629 */
   40     56   
        builder = crate::protocol_serde::shape_http_prefix_headers_targeting_length_map_operation::ser_http_prefix_headers_targeting_length_map_operation_headers(&output, builder)?;
          57  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   41     58   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   42     59   
            builder,
   43     60   
            ::http::header::CONTENT_TYPE,
   44     61   
            "application/json",
   45     62   
        );
          63  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   46     64   
        let http_status: u16 = 200;
   47     65   
        builder = builder.status(http_status);
          66  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
   48     67   
        let payload =
   49         -
            crate::protocol_serde::shape_http_prefix_headers_targeting_length_map_operation_output::ser_http_prefix_headers_targeting_length_map_operation_output_output_output(&output)?
   50         -
        ;
          68  +
            /* HttpBoundProtocolPayloadGenerator.kt:237 */crate::protocol_serde::shape_http_prefix_headers_targeting_length_map_operation_output::ser_http_prefix_headers_targeting_length_map_operation_output_output_output(&output)?
          69  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
          70  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   51     71   
        let content_length = payload.len();
   52     72   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   53     73   
            builder,
   54     74   
            ::http::header::CONTENT_LENGTH,
   55     75   
            content_length,
   56     76   
        );
          77  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   57     78   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          79  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   58     80   
        builder.body(body)?
          81  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   59     82   
    })
          83  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   60     84   
}
   61     85   
          86  +
/* RustType.kt:516 */
   62     87   
#[allow(clippy::unnecessary_wraps)]
          88  +
/* ServerHttpBoundProtocolGenerator.kt:447 */
   63     89   
pub fn ser_http_prefix_headers_targeting_length_map_operation_http_error(
   64     90   
    error: &crate::error::HttpPrefixHeadersTargetingLengthMapOperationError,
   65     91   
) -> std::result::Result<
   66     92   
    ::aws_smithy_http_server::response::Response,
   67     93   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   68     94   
> {
          95  +
    /* ServerHttpBoundProtocolGenerator.kt:452 */
   69     96   
    Ok({
          97  +
        /* ServerHttpBoundProtocolGenerator.kt:468 */
   70     98   
        match error {
   71         -
            crate::error::HttpPrefixHeadersTargetingLengthMapOperationError::ValidationException(output) => {
   72         -
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
   73         -
                #[allow(unused_mut)]
   74         -
                let mut builder = ::http::Response::builder();
   75         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          99  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */crate::error::HttpPrefixHeadersTargetingLengthMapOperationError::ValidationException(output) => {
         100  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
         101  +
                /* RustType.kt:516 */#[allow(unused_mut)]
         102  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */let mut builder = ::http::Response::builder();
         103  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */builder = ::aws_smithy_http::header::set_response_header_if_absent(
   76    104   
                                builder,
   77    105   
                                ::http::header::CONTENT_TYPE,
   78    106   
                                "application/json",
   79    107   
                            );
   80         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         108  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */builder = ::aws_smithy_http::header::set_response_header_if_absent(
   81    109   
                                builder,
   82    110   
                                ::http::header::HeaderName::from_static("x-amzn-errortype"),
   83    111   
                                "ValidationException",
   84    112   
                            );
   85         -
                let content_length = payload.len();
         113  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */let content_length = payload.len();
   86    114   
                            builder = ::aws_smithy_http::header::set_response_header_if_absent(builder, ::http::header::CONTENT_LENGTH, content_length);
   87         -
                builder.status(400).body(::aws_smithy_http_server::body::to_boxed(payload))?
   88         -
            }
   89         -
            crate::error::HttpPrefixHeadersTargetingLengthMapOperationError::InternalServerError(output) => {
   90         -
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
   91         -
                #[allow(unused_mut)]
   92         -
                let mut builder = ::http::Response::builder();
   93         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         115  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */builder.status(400).body(::aws_smithy_http_server::body::to_boxed(payload))?
         116  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */}
         117  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */crate::error::HttpPrefixHeadersTargetingLengthMapOperationError::InternalServerError(output) => {
         118  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
         119  +
                /* RustType.kt:516 */#[allow(unused_mut)]
         120  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */let mut builder = ::http::Response::builder();
         121  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */builder = ::aws_smithy_http::header::set_response_header_if_absent(
   94    122   
                                builder,
   95    123   
                                ::http::header::CONTENT_TYPE,
   96    124   
                                "application/json",
   97    125   
                            );
   98         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         126  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */builder = ::aws_smithy_http::header::set_response_header_if_absent(
   99    127   
                                builder,
  100    128   
                                ::http::header::HeaderName::from_static("x-amzn-errortype"),
  101    129   
                                "InternalServerError",
  102    130   
                            );
  103         -
                let content_length = payload.len();
         131  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */let content_length = payload.len();
  104    132   
                            builder = ::aws_smithy_http::header::set_response_header_if_absent(builder, ::http::header::CONTENT_LENGTH, content_length);
  105         -
                builder.status(500).body(::aws_smithy_http_server::body::to_boxed(payload))?
  106         -
            }
  107         -
        }
         133  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */builder.status(500).body(::aws_smithy_http_server::body::to_boxed(payload))?
         134  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */}
         135  +
        /* ServerHttpBoundProtocolGenerator.kt:468 */}
         136  +
        /* ServerHttpBoundProtocolGenerator.kt:452 */
  108    137   
    })
         138  +
    /* ServerHttpBoundProtocolGenerator.kt:447 */
  109    139   
}
  110    140   
         141  +
/* HttpBindingGenerator.kt:542 */
  111    142   
pub fn ser_http_prefix_headers_targeting_length_map_operation_headers(
  112    143   
    input: &crate::output::HttpPrefixHeadersTargetingLengthMapOperationOutput,
  113    144   
    mut builder: ::http::response::Builder,
  114    145   
) -> std::result::Result<::http::response::Builder, ::aws_smithy_types::error::operation::BuildError>
  115    146   
{
         147  +
    /* HttpBindingGenerator.kt:741 */
  116    148   
    if let ::std::option::Option::Some(inner_1) = &input.length_map {
         149  +
        /* HttpBindingGenerator.kt:741 */
  117    150   
        {
         151  +
            /* HttpBindingGenerator.kt:747 */
  118    152   
            for (k, v) in inner_1 {
  119    153   
                use std::str::FromStr;
  120    154   
                let header_name = http::header::HeaderName::from_str(&format!(
  121    155   
                    "{}{}",
  122    156   
                    "X-Prefix-Headers-LengthMap-", &k
  123    157   
                ))
  124    158   
                .map_err(|err| {
  125    159   
                    ::aws_smithy_types::error::operation::BuildError::invalid_field(
  126    160   
                        "length_map",
  127    161   
                        format!("`{k}` cannot be used as a header name: {err}"),
  128    162   
                    )
  129    163   
                })?;
  130    164   
                let header_value = v.as_str();
  131    165   
                let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  132    166   
                    ::aws_smithy_types::error::operation::BuildError::invalid_field(
  133    167   
                        "length_map",
  134    168   
                        format!("`{}` cannot be used as a header value: {}", v, err),
  135    169   
                    )
  136    170   
                })?;
  137    171   
                builder = builder.header(header_name, header_value);
  138    172   
            }
         173  +
            /* HttpBindingGenerator.kt:741 */
  139    174   
        }
         175  +
        /* HttpBindingGenerator.kt:741 */
  140    176   
    }
         177  +
    /* HttpBindingGenerator.kt:555 */
  141    178   
    Ok(builder)
         179  +
    /* HttpBindingGenerator.kt:542 */
  142    180   
}

tmp-codegen-diff/codegen-server-test-python/constraints_without_public_constrained_types/rust-server-codegen-python/src/protocol_serde/shape_http_prefix_headers_targeting_length_map_operation_input.rs

@@ -1,1 +26,34 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* HttpBindingGenerator.kt:184 */
    2      3   
pub(crate) fn de_length_map_prefix_header(
    3      4   
    header_map: &::aws_smithy_runtime_api::http::Headers,
    4      5   
) -> std::result::Result<
    5      6   
    ::std::option::Option<crate::unconstrained::con_b_map_unconstrained::ConBMapUnconstrained>,
    6      7   
    ::aws_smithy_http::header::ParseError,
    7      8   
> {
           9  +
    /* HttpBindingGenerator.kt:190 */
    8     10   
    let headers = ::aws_smithy_http::header::headers_for_prefix(
    9     11   
        header_map.iter().map(|(k, _)| k),
   10     12   
        "X-Prefix-Headers-LengthMap-",
   11     13   
    );
   12     14   
    let out: std::result::Result<_, _> = headers.map(|(key, header_name)| {
   13     15   
                            let values = header_map.get_all(header_name);
   14     16   
                            crate::protocol_serde::shape_http_prefix_headers_targeting_length_map_operation_input::de_length_map_inner(values).map(|v| (key.to_string(), v.expect(
   15     17   
                                "we have checked there is at least one value for this header name; please file a bug report under https://github.com/smithy-lang/smithy-rs/issues"
   16     18   
                            )))
   17     19   
                        }).collect();
          20  +
    /* ServerRequestBindingGenerator.kt:79 */
   18     21   
    let out = out.map(crate::unconstrained::con_b_map_unconstrained::ConBMapUnconstrained);
          22  +
    /* HttpBindingGenerator.kt:211 */
   19     23   
    out.map(Some)
          24  +
    /* HttpBindingGenerator.kt:184 */
   20     25   
}
   21     26   
          27  +
/* HttpBindingGenerator.kt:173 */
   22     28   
pub fn de_length_map_inner<'a>(
   23     29   
    headers: impl ::std::iter::Iterator<Item = &'a str>,
   24     30   
) -> std::result::Result<Option<::std::string::String>, ::aws_smithy_http::header::ParseError> {
          31  +
    /* HttpBindingGenerator.kt:375 */
   25     32   
    ::aws_smithy_http::header::one_or_none(headers)
          33  +
    /* HttpBindingGenerator.kt:173 */
   26     34   
}

tmp-codegen-diff/codegen-server-test-python/constraints_without_public_constrained_types/rust-server-codegen-python/src/protocol_serde/shape_http_prefix_headers_targeting_length_map_operation_output.rs

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

tmp-codegen-diff/codegen-server-test-python/constraints_without_public_constrained_types/rust-server-codegen-python/src/protocol_serde/shape_internal_server_error.rs

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

tmp-codegen-diff/codegen-server-test-python/constraints_without_public_constrained_types/rust-server-codegen-python/src/protocol_serde/shape_length_list.rs

@@ -1,1 +54,80 @@
    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_length_list<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<crate::unconstrained::length_list_unconstrained::LengthListUnconstrained>,
    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 = ::aws_smithy_json::deserialize::token::expect_string_or_null(
   28         -
                            tokens.next(),
   29         -
                        )?
   30         -
                        .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   31         -
                        .transpose()?;
          37  +
                        /* JsonParserGenerator.kt:419 */
          38  +
                        let value =
          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:419 */;
          45  +
                        /* JsonParserGenerator.kt:422 */
   32     46   
                        if let Some(value) = value {
   33     47   
                            items.push(value);
   34         -
                        } else {
          48  +
                        }
          49  +
                        /* JsonParserGenerator.kt:430 */
          50  +
                        else {
   35     51   
                            return Err(
   36     52   
                                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   37     53   
                                    "dense list cannot contain null values",
   38     54   
                                ),
   39     55   
                            );
   40     56   
                        }
   41         -
                    }
          57  +
                        /* JsonParserGenerator.kt:413 */
          58  +
                    } /* JsonParserGenerator.kt:409 */
   42     59   
                }
          60  +
                /* JsonParserGenerator.kt:408 */
   43     61   
            }
          62  +
            /* JsonParserGenerator.kt:444 */
   44     63   
            Ok(Some(
   45     64   
                crate::unconstrained::length_list_unconstrained::LengthListUnconstrained(items),
   46     65   
            ))
          66  +
            /* JsonParserGenerator.kt:713 */
   47     67   
        }
   48         -
        _ => Err(
   49         -
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   50         -
                "expected start array or null",
   51         -
            ),
   52         -
        ),
          68  +
        /* JsonParserGenerator.kt:722 */
          69  +
        _ => {
          70  +
            /* JsonParserGenerator.kt:723 */
          71  +
            Err(
          72  +
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
          73  +
                    "expected start array or null",
          74  +
                ),
          75  +
            )
          76  +
            /* JsonParserGenerator.kt:722 */
          77  +
        } /* JsonParserGenerator.kt:712 */
   53     78   
    }
          79  +
    /* JsonParserGenerator.kt:398 */
   54     80   
}

tmp-codegen-diff/codegen-server-test-python/constraints_without_public_constrained_types/rust-server-codegen-python/src/protocol_serde/shape_length_list_of_pattern_string.rs

@@ -1,1 +40,66 @@
    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_length_list_of_pattern_string<'a, I>(tokens: &mut ::std::iter::Peekable<I>) -> ::std::result::Result<Option<crate::unconstrained::length_list_of_pattern_string_unconstrained::LengthListOfPatternStringUnconstrained>, ::aws_smithy_json::deserialize::error::DeserializeError>
    3      4   
where I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>{
           5  +
    /* JsonParserGenerator.kt:712 */
    4      6   
    match tokens.next().transpose()? {
           7  +
        /* JsonParserGenerator.kt:713 */
    5      8   
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
    6      9   
        Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => {
          10  +
            /* JsonParserGenerator.kt:407 */
    7     11   
            let mut items = Vec::new();
          12  +
            /* JsonParserGenerator.kt:408 */
    8     13   
            loop {
          14  +
                /* JsonParserGenerator.kt:409 */
    9     15   
                match tokens.peek() {
          16  +
                    /* JsonParserGenerator.kt:410 */
   10     17   
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
          18  +
                        /* JsonParserGenerator.kt:411 */
   11     19   
                        tokens.next().transpose().unwrap();
   12     20   
                        break;
          21  +
                        /* JsonParserGenerator.kt:410 */
   13     22   
                    }
          23  +
                    /* JsonParserGenerator.kt:413 */
   14     24   
                    _ => {
   15         -
                        let value = ::aws_smithy_json::deserialize::token::expect_string_or_null(
   16         -
                            tokens.next(),
   17         -
                        )?
   18         -
                        .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   19         -
                        .transpose()?;
          25  +
                        /* JsonParserGenerator.kt:419 */
          26  +
                        let value =
          27  +
                            /* JsonParserGenerator.kt:354 */::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?.map(|s|
          28  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          29  +
                                    /* JsonParserGenerator.kt:348 */u.into_owned()
          30  +
                                /* JsonParserGenerator.kt:339 */)
          31  +
                            /* JsonParserGenerator.kt:354 */).transpose()?
          32  +
                        /* JsonParserGenerator.kt:419 */;
          33  +
                        /* JsonParserGenerator.kt:422 */
   20     34   
                        if let Some(value) = value {
   21     35   
                            items.push(value);
   22         -
                        } else {
          36  +
                        }
          37  +
                        /* JsonParserGenerator.kt:430 */
          38  +
                        else {
   23     39   
                            return Err(
   24     40   
                                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   25     41   
                                    "dense list cannot contain null values",
   26     42   
                                ),
   27     43   
                            );
   28     44   
                        }
   29         -
                    }
          45  +
                        /* JsonParserGenerator.kt:413 */
          46  +
                    } /* JsonParserGenerator.kt:409 */
   30     47   
                }
          48  +
                /* JsonParserGenerator.kt:408 */
   31     49   
            }
          50  +
            /* JsonParserGenerator.kt:444 */
   32     51   
            Ok(Some(crate::unconstrained::length_list_of_pattern_string_unconstrained::LengthListOfPatternStringUnconstrained(items)))
          52  +
            /* JsonParserGenerator.kt:713 */
   33     53   
        }
   34         -
        _ => Err(
   35         -
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   36         -
                "expected start array or null",
   37         -
            ),
   38         -
        ),
          54  +
        /* JsonParserGenerator.kt:722 */
          55  +
        _ => {
          56  +
            /* JsonParserGenerator.kt:723 */
          57  +
            Err(
          58  +
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
          59  +
                    "expected start array or null",
          60  +
                ),
          61  +
            )
          62  +
            /* JsonParserGenerator.kt:722 */
          63  +
        } /* JsonParserGenerator.kt:712 */
   39     64   
    }
          65  +
    /* JsonParserGenerator.kt:398 */
   40     66   
}

tmp-codegen-diff/codegen-server-test-python/constraints_without_public_constrained_types/rust-server-codegen-python/src/protocol_serde/shape_length_map.rs

@@ -1,1 +62,89 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:460 */
    2      3   
pub(crate) fn de_length_map<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<crate::unconstrained::length_map_unconstrained::LengthMapUnconstrained>,
    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  +
            /* JsonParserGenerator.kt:469 */
   19     23   
            let mut map = ::std::collections::HashMap::new();
          24  +
            /* JsonParserGenerator.kt:684 */
   20     25   
            loop {
          26  +
                /* JsonParserGenerator.kt:685 */
   21     27   
                match tokens.next().transpose()? {
          28  +
                    /* JsonParserGenerator.kt:686 */
   22     29   
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   23     30   
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
   24         -
                        let key = key.to_unescaped().map(|u| u.into_owned())?;
   25         -
                        let value = ::aws_smithy_json::deserialize::token::expect_string_or_null(
   26         -
                            tokens.next(),
   27         -
                        )?
   28         -
                        .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   29         -
                        .transpose()?;
          31  +
                        /* JsonParserGenerator.kt:471 */
          32  +
                        let key =
          33  +
                            /* JsonParserGenerator.kt:339 */key.to_unescaped().map(|u|
          34  +
                                /* JsonParserGenerator.kt:348 */u.into_owned()
          35  +
                            /* JsonParserGenerator.kt:339 */)
          36  +
                        /* JsonParserGenerator.kt:471 */?;
          37  +
                        /* JsonParserGenerator.kt:474 */
          38  +
                        let value =
          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:474 */;
          45  +
                        /* JsonParserGenerator.kt:481 */
   30     46   
                        match value {
   31     47   
                            Some(value) => {
   32     48   
                                map.insert(key, value);
   33     49   
                            }
   34     50   
                            None => {
   35     51   
                                return Err(
   36     52   
                                    ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   37     53   
                                        "dense map cannot contain null values",
   38     54   
                                    ),
   39     55   
                                )
   40     56   
                            }
   41     57   
                        }
          58  +
                        /* JsonParserGenerator.kt:686 */
   42     59   
                    }
          60  +
                    /* JsonParserGenerator.kt:695 */
   43     61   
                    other => {
   44     62   
                        return Err(
   45     63   
                            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   46     64   
                                format!("expected object key or end object, found: {:?}", other),
   47     65   
                            ),
   48     66   
                        )
   49         -
                    }
          67  +
                    } /* JsonParserGenerator.kt:685 */
   50     68   
                }
          69  +
                /* JsonParserGenerator.kt:684 */
   51     70   
            }
          71  +
            /* JsonParserGenerator.kt:502 */
   52     72   
            Ok(Some(
   53     73   
                crate::unconstrained::length_map_unconstrained::LengthMapUnconstrained(map),
   54     74   
            ))
          75  +
            /* JsonParserGenerator.kt:713 */
   55     76   
        }
   56         -
        _ => Err(
   57         -
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   58         -
                "expected start object or null",
   59         -
            ),
   60         -
        ),
          77  +
        /* JsonParserGenerator.kt:722 */
          78  +
        _ => {
          79  +
            /* JsonParserGenerator.kt:723 */
          80  +
            Err(
          81  +
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
          82  +
                    "expected start object or null",
          83  +
                ),
          84  +
            )
          85  +
            /* JsonParserGenerator.kt:722 */
          86  +
        } /* JsonParserGenerator.kt:712 */
   61     87   
    }
          88  +
    /* JsonParserGenerator.kt:460 */
   62     89   
}

tmp-codegen-diff/codegen-server-test-python/constraints_without_public_constrained_types/rust-server-codegen-python/src/protocol_serde/shape_length_set_of_pattern_string.rs

@@ -1,1 +40,66 @@
    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_length_set_of_pattern_string<'a, I>(tokens: &mut ::std::iter::Peekable<I>) -> ::std::result::Result<Option<crate::unconstrained::length_set_of_pattern_string_unconstrained::LengthSetOfPatternStringUnconstrained>, ::aws_smithy_json::deserialize::error::DeserializeError>
    3      4   
where I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>{
           5  +
    /* JsonParserGenerator.kt:712 */
    4      6   
    match tokens.next().transpose()? {
           7  +
        /* JsonParserGenerator.kt:713 */
    5      8   
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
    6      9   
        Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => {
          10  +
            /* JsonParserGenerator.kt:407 */
    7     11   
            let mut items = Vec::new();
          12  +
            /* JsonParserGenerator.kt:408 */
    8     13   
            loop {
          14  +
                /* JsonParserGenerator.kt:409 */
    9     15   
                match tokens.peek() {
          16  +
                    /* JsonParserGenerator.kt:410 */
   10     17   
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
          18  +
                        /* JsonParserGenerator.kt:411 */
   11     19   
                        tokens.next().transpose().unwrap();
   12     20   
                        break;
          21  +
                        /* JsonParserGenerator.kt:410 */
   13     22   
                    }
          23  +
                    /* JsonParserGenerator.kt:413 */
   14     24   
                    _ => {
   15         -
                        let value = ::aws_smithy_json::deserialize::token::expect_string_or_null(
   16         -
                            tokens.next(),
   17         -
                        )?
   18         -
                        .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   19         -
                        .transpose()?;
          25  +
                        /* JsonParserGenerator.kt:419 */
          26  +
                        let value =
          27  +
                            /* JsonParserGenerator.kt:354 */::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?.map(|s|
          28  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          29  +
                                    /* JsonParserGenerator.kt:348 */u.into_owned()
          30  +
                                /* JsonParserGenerator.kt:339 */)
          31  +
                            /* JsonParserGenerator.kt:354 */).transpose()?
          32  +
                        /* JsonParserGenerator.kt:419 */;
          33  +
                        /* JsonParserGenerator.kt:422 */
   20     34   
                        if let Some(value) = value {
   21     35   
                            items.push(value);
   22         -
                        } else {
          36  +
                        }
          37  +
                        /* JsonParserGenerator.kt:430 */
          38  +
                        else {
   23     39   
                            return Err(
   24     40   
                                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   25     41   
                                    "dense list cannot contain null values",
   26     42   
                                ),
   27     43   
                            );
   28     44   
                        }
   29         -
                    }
          45  +
                        /* JsonParserGenerator.kt:413 */
          46  +
                    } /* JsonParserGenerator.kt:409 */
   30     47   
                }
          48  +
                /* JsonParserGenerator.kt:408 */
   31     49   
            }
          50  +
            /* JsonParserGenerator.kt:444 */
   32     51   
            Ok(Some(crate::unconstrained::length_set_of_pattern_string_unconstrained::LengthSetOfPatternStringUnconstrained(items)))
          52  +
            /* JsonParserGenerator.kt:713 */
   33     53   
        }
   34         -
        _ => Err(
   35         -
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   36         -
                "expected start array or null",
   37         -
            ),
   38         -
        ),
          54  +
        /* JsonParserGenerator.kt:722 */
          55  +
        _ => {
          56  +
            /* JsonParserGenerator.kt:723 */
          57  +
            Err(
          58  +
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
          59  +
                    "expected start array or null",
          60  +
                ),
          61  +
            )
          62  +
            /* JsonParserGenerator.kt:722 */
          63  +
        } /* JsonParserGenerator.kt:712 */
   39     64   
    }
          65  +
    /* JsonParserGenerator.kt:398 */
   40     66   
}

tmp-codegen-diff/codegen-server-test-python/constraints_without_public_constrained_types/rust-server-codegen-python/src/protocol_serde/shape_list_of_length_blob.rs

@@ -1,1 +51,75 @@
    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_list_of_length_blob<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<crate::unconstrained::list_of_length_blob_unconstrained::ListOfLengthBlobUnconstrained>,
    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 = ::aws_smithy_json::deserialize::token::expect_blob_or_null(
   28         -
                            tokens.next(),
   29         -
                        )?
   30         -
                        .map(::aws_smithy_http_server_python::types::Blob::from);
          37  +
                        /* JsonParserGenerator.kt:419 */
          38  +
                        let value =
          39  +
                            /* JsonParserGenerator.kt:326 */::aws_smithy_json::deserialize::token::expect_blob_or_null(tokens.next())?
          40  +
                            /* PythonServerProtocolLoader.kt:48 */.map(::aws_smithy_http_server_python::types::Blob::from)
          41  +
                        /* JsonParserGenerator.kt:419 */;
          42  +
                        /* JsonParserGenerator.kt:422 */
   31     43   
                        if let Some(value) = value {
   32     44   
                            items.push(value);
   33         -
                        } else {
          45  +
                        }
          46  +
                        /* JsonParserGenerator.kt:430 */
          47  +
                        else {
   34     48   
                            return Err(
   35     49   
                                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   36     50   
                                    "dense list cannot contain null values",
   37     51   
                                ),
   38     52   
                            );
   39     53   
                        }
   40         -
                    }
          54  +
                        /* JsonParserGenerator.kt:413 */
          55  +
                    } /* JsonParserGenerator.kt:409 */
   41     56   
                }
          57  +
                /* JsonParserGenerator.kt:408 */
   42     58   
            }
          59  +
            /* JsonParserGenerator.kt:444 */
   43     60   
            Ok(Some(crate::unconstrained::list_of_length_blob_unconstrained::ListOfLengthBlobUnconstrained(items)))
          61  +
            /* JsonParserGenerator.kt:713 */
   44     62   
        }
   45         -
        _ => Err(
   46         -
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   47         -
                "expected start array or null",
   48         -
            ),
   49         -
        ),
          63  +
        /* JsonParserGenerator.kt:722 */
          64  +
        _ => {
          65  +
            /* JsonParserGenerator.kt:723 */
          66  +
            Err(
          67  +
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
          68  +
                    "expected start array or null",
          69  +
                ),
          70  +
            )
          71  +
            /* JsonParserGenerator.kt:722 */
          72  +
        } /* JsonParserGenerator.kt:712 */
   50     73   
    }
          74  +
    /* JsonParserGenerator.kt:398 */
   51     75   
}

tmp-codegen-diff/codegen-server-test-python/constraints_without_public_constrained_types/rust-server-codegen-python/src/protocol_serde/shape_list_of_length_pattern_string.rs

@@ -1,1 +40,66 @@
    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_list_of_length_pattern_string<'a, I>(tokens: &mut ::std::iter::Peekable<I>) -> ::std::result::Result<Option<crate::unconstrained::list_of_length_pattern_string_unconstrained::ListOfLengthPatternStringUnconstrained>, ::aws_smithy_json::deserialize::error::DeserializeError>
    3      4   
where I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>{
           5  +
    /* JsonParserGenerator.kt:712 */
    4      6   
    match tokens.next().transpose()? {
           7  +
        /* JsonParserGenerator.kt:713 */
    5      8   
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
    6      9   
        Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => {
          10  +
            /* JsonParserGenerator.kt:407 */
    7     11   
            let mut items = Vec::new();
          12  +
            /* JsonParserGenerator.kt:408 */
    8     13   
            loop {
          14  +
                /* JsonParserGenerator.kt:409 */
    9     15   
                match tokens.peek() {
          16  +
                    /* JsonParserGenerator.kt:410 */
   10     17   
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
          18  +
                        /* JsonParserGenerator.kt:411 */
   11     19   
                        tokens.next().transpose().unwrap();
   12     20   
                        break;
          21  +
                        /* JsonParserGenerator.kt:410 */
   13     22   
                    }
          23  +
                    /* JsonParserGenerator.kt:413 */
   14     24   
                    _ => {
   15         -
                        let value = ::aws_smithy_json::deserialize::token::expect_string_or_null(
   16         -
                            tokens.next(),
   17         -
                        )?
   18         -
                        .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   19         -
                        .transpose()?;
          25  +
                        /* JsonParserGenerator.kt:419 */
          26  +
                        let value =
          27  +
                            /* JsonParserGenerator.kt:354 */::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?.map(|s|
          28  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          29  +
                                    /* JsonParserGenerator.kt:348 */u.into_owned()
          30  +
                                /* JsonParserGenerator.kt:339 */)
          31  +
                            /* JsonParserGenerator.kt:354 */).transpose()?
          32  +
                        /* JsonParserGenerator.kt:419 */;
          33  +
                        /* JsonParserGenerator.kt:422 */
   20     34   
                        if let Some(value) = value {
   21     35   
                            items.push(value);
   22         -
                        } else {
          36  +
                        }
          37  +
                        /* JsonParserGenerator.kt:430 */
          38  +
                        else {
   23     39   
                            return Err(
   24     40   
                                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   25     41   
                                    "dense list cannot contain null values",
   26     42   
                                ),
   27     43   
                            );
   28     44   
                        }
   29         -
                    }
          45  +
                        /* JsonParserGenerator.kt:413 */
          46  +
                    } /* JsonParserGenerator.kt:409 */
   30     47   
                }
          48  +
                /* JsonParserGenerator.kt:408 */
   31     49   
            }
          50  +
            /* JsonParserGenerator.kt:444 */
   32     51   
            Ok(Some(crate::unconstrained::list_of_length_pattern_string_unconstrained::ListOfLengthPatternStringUnconstrained(items)))
          52  +
            /* JsonParserGenerator.kt:713 */
   33     53   
        }
   34         -
        _ => Err(
   35         -
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   36         -
                "expected start array or null",
   37         -
            ),
   38         -
        ),
          54  +
        /* JsonParserGenerator.kt:722 */
          55  +
        _ => {
          56  +
            /* JsonParserGenerator.kt:723 */
          57  +
            Err(
          58  +
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
          59  +
                    "expected start array or null",
          60  +
                ),
          61  +
            )
          62  +
            /* JsonParserGenerator.kt:722 */
          63  +
        } /* JsonParserGenerator.kt:712 */
   39     64   
    }
          65  +
    /* JsonParserGenerator.kt:398 */
   40     66   
}

tmp-codegen-diff/codegen-server-test-python/constraints_without_public_constrained_types/rust-server-codegen-python/src/protocol_serde/shape_list_of_length_string.rs

@@ -1,1 +54,80 @@
    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_list_of_length_string<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<
    6      7   
        crate::unconstrained::list_of_length_string_unconstrained::ListOfLengthStringUnconstrained,
    7      8   
    >,
    8      9   
    ::aws_smithy_json::deserialize::error::DeserializeError,
    9     10   
>
   10     11   
where
   11     12   
    I: Iterator<
   12     13   
        Item = Result<
   13     14   
            ::aws_smithy_json::deserialize::Token<'a>,
   14     15   
            ::aws_smithy_json::deserialize::error::DeserializeError,
   15     16   
        >,
   16     17   
    >,
   17     18   
{
          19  +
    /* JsonParserGenerator.kt:712 */
   18     20   
    match tokens.next().transpose()? {
          21  +
        /* JsonParserGenerator.kt:713 */
   19     22   
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   20     23   
        Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => {
          24  +
            /* JsonParserGenerator.kt:407 */
   21     25   
            let mut items = Vec::new();
          26  +
            /* JsonParserGenerator.kt:408 */
   22     27   
            loop {
          28  +
                /* JsonParserGenerator.kt:409 */
   23     29   
                match tokens.peek() {
          30  +
                    /* JsonParserGenerator.kt:410 */
   24     31   
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
          32  +
                        /* JsonParserGenerator.kt:411 */
   25     33   
                        tokens.next().transpose().unwrap();
   26     34   
                        break;
          35  +
                        /* JsonParserGenerator.kt:410 */
   27     36   
                    }
          37  +
                    /* JsonParserGenerator.kt:413 */
   28     38   
                    _ => {
   29         -
                        let value = ::aws_smithy_json::deserialize::token::expect_string_or_null(
   30         -
                            tokens.next(),
   31         -
                        )?
   32         -
                        .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   33         -
                        .transpose()?;
          39  +
                        /* JsonParserGenerator.kt:419 */
          40  +
                        let value =
          41  +
                            /* JsonParserGenerator.kt:354 */::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?.map(|s|
          42  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          43  +
                                    /* JsonParserGenerator.kt:348 */u.into_owned()
          44  +
                                /* JsonParserGenerator.kt:339 */)
          45  +
                            /* JsonParserGenerator.kt:354 */).transpose()?
          46  +
                        /* JsonParserGenerator.kt:419 */;
          47  +
                        /* JsonParserGenerator.kt:422 */
   34     48   
                        if let Some(value) = value {
   35     49   
                            items.push(value);
   36         -
                        } else {
          50  +
                        }
          51  +
                        /* JsonParserGenerator.kt:430 */
          52  +
                        else {
   37     53   
                            return Err(
   38     54   
                                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   39     55   
                                    "dense list cannot contain null values",
   40     56   
                                ),
   41     57   
                            );
   42     58   
                        }
   43         -
                    }
          59  +
                        /* JsonParserGenerator.kt:413 */
          60  +
                    } /* JsonParserGenerator.kt:409 */
   44     61   
                }
          62  +
                /* JsonParserGenerator.kt:408 */
   45     63   
            }
          64  +
            /* JsonParserGenerator.kt:444 */
   46     65   
            Ok(Some(crate::unconstrained::list_of_length_string_unconstrained::ListOfLengthStringUnconstrained(items)))
          66  +
            /* JsonParserGenerator.kt:713 */
   47     67   
        }
   48         -
        _ => Err(
   49         -
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   50         -
                "expected start array or null",
   51         -
            ),
   52         -
        ),
          68  +
        /* JsonParserGenerator.kt:722 */
          69  +
        _ => {
          70  +
            /* JsonParserGenerator.kt:723 */
          71  +
            Err(
          72  +
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
          73  +
                    "expected start array or null",
          74  +
                ),
          75  +
            )
          76  +
            /* JsonParserGenerator.kt:722 */
          77  +
        } /* JsonParserGenerator.kt:712 */
   53     78   
    }
          79  +
    /* JsonParserGenerator.kt:398 */
   54     80   
}

tmp-codegen-diff/codegen-server-test-python/constraints_without_public_constrained_types/rust-server-codegen-python/src/protocol_serde/shape_list_of_pattern_string.rs

@@ -1,1 +40,66 @@
    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_list_of_pattern_string<'a, I>(tokens: &mut ::std::iter::Peekable<I>) -> ::std::result::Result<Option<crate::unconstrained::list_of_pattern_string_unconstrained::ListOfPatternStringUnconstrained>, ::aws_smithy_json::deserialize::error::DeserializeError>
    3      4   
where I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>{
           5  +
    /* JsonParserGenerator.kt:712 */
    4      6   
    match tokens.next().transpose()? {
           7  +
        /* JsonParserGenerator.kt:713 */
    5      8   
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
    6      9   
        Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => {
          10  +
            /* JsonParserGenerator.kt:407 */
    7     11   
            let mut items = Vec::new();
          12  +
            /* JsonParserGenerator.kt:408 */
    8     13   
            loop {
          14  +
                /* JsonParserGenerator.kt:409 */
    9     15   
                match tokens.peek() {
          16  +
                    /* JsonParserGenerator.kt:410 */
   10     17   
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
          18  +
                        /* JsonParserGenerator.kt:411 */
   11     19   
                        tokens.next().transpose().unwrap();
   12     20   
                        break;
          21  +
                        /* JsonParserGenerator.kt:410 */
   13     22   
                    }
          23  +
                    /* JsonParserGenerator.kt:413 */
   14     24   
                    _ => {
   15         -
                        let value = ::aws_smithy_json::deserialize::token::expect_string_or_null(
   16         -
                            tokens.next(),
   17         -
                        )?
   18         -
                        .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   19         -
                        .transpose()?;
          25  +
                        /* JsonParserGenerator.kt:419 */
          26  +
                        let value =
          27  +
                            /* JsonParserGenerator.kt:354 */::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?.map(|s|
          28  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          29  +
                                    /* JsonParserGenerator.kt:348 */u.into_owned()
          30  +
                                /* JsonParserGenerator.kt:339 */)
          31  +
                            /* JsonParserGenerator.kt:354 */).transpose()?
          32  +
                        /* JsonParserGenerator.kt:419 */;
          33  +
                        /* JsonParserGenerator.kt:422 */
   20     34   
                        if let Some(value) = value {
   21     35   
                            items.push(value);
   22         -
                        } else {
          36  +
                        }
          37  +
                        /* JsonParserGenerator.kt:430 */
          38  +
                        else {
   23     39   
                            return Err(
   24     40   
                                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   25     41   
                                    "dense list cannot contain null values",
   26     42   
                                ),
   27     43   
                            );
   28     44   
                        }
   29         -
                    }
          45  +
                        /* JsonParserGenerator.kt:413 */
          46  +
                    } /* JsonParserGenerator.kt:409 */
   30     47   
                }
          48  +
                /* JsonParserGenerator.kt:408 */
   31     49   
            }
          50  +
            /* JsonParserGenerator.kt:444 */
   32     51   
            Ok(Some(crate::unconstrained::list_of_pattern_string_unconstrained::ListOfPatternStringUnconstrained(items)))
          52  +
            /* JsonParserGenerator.kt:713 */
   33     53   
        }
   34         -
        _ => Err(
   35         -
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   36         -
                "expected start array or null",
   37         -
            ),
   38         -
        ),
          54  +
        /* JsonParserGenerator.kt:722 */
          55  +
        _ => {
          56  +
            /* JsonParserGenerator.kt:723 */
          57  +
            Err(
          58  +
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
          59  +
                    "expected start array or null",
          60  +
                ),
          61  +
            )
          62  +
            /* JsonParserGenerator.kt:722 */
          63  +
        } /* JsonParserGenerator.kt:712 */
   39     64   
    }
          65  +
    /* JsonParserGenerator.kt:398 */
   40     66   
}

tmp-codegen-diff/codegen-server-test-python/constraints_without_public_constrained_types/rust-server-codegen-python/src/protocol_serde/shape_list_of_range_byte.rs

@@ -1,1 +52,76 @@
    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_list_of_range_byte<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<crate::unconstrained::list_of_range_byte_unconstrained::ListOfRangeByteUnconstrained>,
    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 = ::aws_smithy_json::deserialize::token::expect_number_or_null(
   28         -
                            tokens.next(),
   29         -
                        )?
   30         -
                        .map(i8::try_from)
   31         -
                        .transpose()?;
          37  +
                        /* JsonParserGenerator.kt:419 */
          38  +
                        let value =
          39  +
                            /* JsonParserGenerator.kt:365 */::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
          40  +
                                                .map(i8::try_from)
          41  +
                                                .transpose()?
          42  +
                        /* JsonParserGenerator.kt:419 */;
          43  +
                        /* JsonParserGenerator.kt:422 */
   32     44   
                        if let Some(value) = value {
   33     45   
                            items.push(value);
   34         -
                        } else {
          46  +
                        }
          47  +
                        /* JsonParserGenerator.kt:430 */
          48  +
                        else {
   35     49   
                            return Err(
   36     50   
                                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   37     51   
                                    "dense list cannot contain null values",
   38     52   
                                ),
   39     53   
                            );
   40     54   
                        }
   41         -
                    }
          55  +
                        /* JsonParserGenerator.kt:413 */
          56  +
                    } /* JsonParserGenerator.kt:409 */
   42     57   
                }
          58  +
                /* JsonParserGenerator.kt:408 */
   43     59   
            }
          60  +
            /* JsonParserGenerator.kt:444 */
   44     61   
            Ok(Some(crate::unconstrained::list_of_range_byte_unconstrained::ListOfRangeByteUnconstrained(items)))
          62  +
            /* JsonParserGenerator.kt:713 */
   45     63   
        }
   46         -
        _ => Err(
   47         -
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   48         -
                "expected start array or null",
   49         -
            ),
   50         -
        ),
          64  +
        /* JsonParserGenerator.kt:722 */
          65  +
        _ => {
          66  +
            /* JsonParserGenerator.kt:723 */
          67  +
            Err(
          68  +
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
          69  +
                    "expected start array or null",
          70  +
                ),
          71  +
            )
          72  +
            /* JsonParserGenerator.kt:722 */
          73  +
        } /* JsonParserGenerator.kt:712 */
   51     74   
    }
          75  +
    /* JsonParserGenerator.kt:398 */
   52     76   
}

tmp-codegen-diff/codegen-server-test-python/constraints_without_public_constrained_types/rust-server-codegen-python/src/protocol_serde/shape_list_of_range_integer.rs

@@ -1,1 +54,78 @@
    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_list_of_range_integer<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<
    6      7   
        crate::unconstrained::list_of_range_integer_unconstrained::ListOfRangeIntegerUnconstrained,
    7      8   
    >,
    8      9   
    ::aws_smithy_json::deserialize::error::DeserializeError,
    9     10   
>
   10     11   
where
   11     12   
    I: Iterator<
   12     13   
        Item = Result<
   13     14   
            ::aws_smithy_json::deserialize::Token<'a>,
   14     15   
            ::aws_smithy_json::deserialize::error::DeserializeError,
   15     16   
        >,
   16     17   
    >,
   17     18   
{
          19  +
    /* JsonParserGenerator.kt:712 */
   18     20   
    match tokens.next().transpose()? {
          21  +
        /* JsonParserGenerator.kt:713 */
   19     22   
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   20     23   
        Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => {
          24  +
            /* JsonParserGenerator.kt:407 */
   21     25   
            let mut items = Vec::new();
          26  +
            /* JsonParserGenerator.kt:408 */
   22     27   
            loop {
          28  +
                /* JsonParserGenerator.kt:409 */
   23     29   
                match tokens.peek() {
          30  +
                    /* JsonParserGenerator.kt:410 */
   24     31   
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
          32  +
                        /* JsonParserGenerator.kt:411 */
   25     33   
                        tokens.next().transpose().unwrap();
   26     34   
                        break;
          35  +
                        /* JsonParserGenerator.kt:410 */
   27     36   
                    }
          37  +
                    /* JsonParserGenerator.kt:413 */
   28     38   
                    _ => {
   29         -
                        let value = ::aws_smithy_json::deserialize::token::expect_number_or_null(
   30         -
                            tokens.next(),
   31         -
                        )?
   32         -
                        .map(i32::try_from)
   33         -
                        .transpose()?;
          39  +
                        /* JsonParserGenerator.kt:419 */
          40  +
                        let value =
          41  +
                            /* JsonParserGenerator.kt:365 */::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
          42  +
                                                .map(i32::try_from)
          43  +
                                                .transpose()?
          44  +
                        /* JsonParserGenerator.kt:419 */;
          45  +
                        /* JsonParserGenerator.kt:422 */
   34     46   
                        if let Some(value) = value {
   35     47   
                            items.push(value);
   36         -
                        } else {
          48  +
                        }
          49  +
                        /* JsonParserGenerator.kt:430 */
          50  +
                        else {
   37     51   
                            return Err(
   38     52   
                                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   39     53   
                                    "dense list cannot contain null values",
   40     54   
                                ),
   41     55   
                            );
   42     56   
                        }
   43         -
                    }
          57  +
                        /* JsonParserGenerator.kt:413 */
          58  +
                    } /* JsonParserGenerator.kt:409 */
   44     59   
                }
          60  +
                /* JsonParserGenerator.kt:408 */
   45     61   
            }
          62  +
            /* JsonParserGenerator.kt:444 */
   46     63   
            Ok(Some(crate::unconstrained::list_of_range_integer_unconstrained::ListOfRangeIntegerUnconstrained(items)))
          64  +
            /* JsonParserGenerator.kt:713 */
   47     65   
        }
   48         -
        _ => Err(
   49         -
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   50         -
                "expected start array or null",
   51         -
            ),
   52         -
        ),
          66  +
        /* JsonParserGenerator.kt:722 */
          67  +
        _ => {
          68  +
            /* JsonParserGenerator.kt:723 */
          69  +
            Err(
          70  +
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
          71  +
                    "expected start array or null",
          72  +
                ),
          73  +
            )
          74  +
            /* JsonParserGenerator.kt:722 */
          75  +
        } /* JsonParserGenerator.kt:712 */
   53     76   
    }
          77  +
    /* JsonParserGenerator.kt:398 */
   54     78   
}

tmp-codegen-diff/codegen-server-test-python/constraints_without_public_constrained_types/rust-server-codegen-python/src/protocol_serde/shape_list_of_range_long.rs

@@ -1,1 +52,76 @@
    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_list_of_range_long<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<crate::unconstrained::list_of_range_long_unconstrained::ListOfRangeLongUnconstrained>,
    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 = ::aws_smithy_json::deserialize::token::expect_number_or_null(
   28         -
                            tokens.next(),
   29         -
                        )?
   30         -
                        .map(i64::try_from)
   31         -
                        .transpose()?;
          37  +
                        /* JsonParserGenerator.kt:419 */
          38  +
                        let value =
          39  +
                            /* JsonParserGenerator.kt:365 */::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
          40  +
                                                .map(i64::try_from)
          41  +
                                                .transpose()?
          42  +
                        /* JsonParserGenerator.kt:419 */;
          43  +
                        /* JsonParserGenerator.kt:422 */
   32     44   
                        if let Some(value) = value {
   33     45   
                            items.push(value);
   34         -
                        } else {
          46  +
                        }
          47  +
                        /* JsonParserGenerator.kt:430 */
          48  +
                        else {
   35     49   
                            return Err(
   36     50   
                                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   37     51   
                                    "dense list cannot contain null values",
   38     52   
                                ),
   39     53   
                            );
   40     54   
                        }
   41         -
                    }
          55  +
                        /* JsonParserGenerator.kt:413 */
          56  +
                    } /* JsonParserGenerator.kt:409 */
   42     57   
                }
          58  +
                /* JsonParserGenerator.kt:408 */
   43     59   
            }
          60  +
            /* JsonParserGenerator.kt:444 */
   44     61   
            Ok(Some(crate::unconstrained::list_of_range_long_unconstrained::ListOfRangeLongUnconstrained(items)))
          62  +
            /* JsonParserGenerator.kt:713 */
   45     63   
        }
   46         -
        _ => Err(
   47         -
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   48         -
                "expected start array or null",
   49         -
            ),
   50         -
        ),
          64  +
        /* JsonParserGenerator.kt:722 */
          65  +
        _ => {
          66  +
            /* JsonParserGenerator.kt:723 */
          67  +
            Err(
          68  +
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
          69  +
                    "expected start array or null",
          70  +
                ),
          71  +
            )
          72  +
            /* JsonParserGenerator.kt:722 */
          73  +
        } /* JsonParserGenerator.kt:712 */
   51     74   
    }
          75  +
    /* JsonParserGenerator.kt:398 */
   52     76   
}

tmp-codegen-diff/codegen-server-test-python/constraints_without_public_constrained_types/rust-server-codegen-python/src/protocol_serde/shape_list_of_range_short.rs

@@ -1,1 +52,76 @@
    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_list_of_range_short<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<crate::unconstrained::list_of_range_short_unconstrained::ListOfRangeShortUnconstrained>,
    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 = ::aws_smithy_json::deserialize::token::expect_number_or_null(
   28         -
                            tokens.next(),
   29         -
                        )?
   30         -
                        .map(i16::try_from)
   31         -
                        .transpose()?;
          37  +
                        /* JsonParserGenerator.kt:419 */
          38  +
                        let value =
          39  +
                            /* JsonParserGenerator.kt:365 */::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
          40  +
                                                .map(i16::try_from)
          41  +
                                                .transpose()?
          42  +
                        /* JsonParserGenerator.kt:419 */;
          43  +
                        /* JsonParserGenerator.kt:422 */
   32     44   
                        if let Some(value) = value {
   33     45   
                            items.push(value);
   34         -
                        } else {
          46  +
                        }
          47  +
                        /* JsonParserGenerator.kt:430 */
          48  +
                        else {
   35     49   
                            return Err(
   36     50   
                                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   37     51   
                                    "dense list cannot contain null values",
   38     52   
                                ),
   39     53   
                            );
   40     54   
                        }
   41         -
                    }
          55  +
                        /* JsonParserGenerator.kt:413 */
          56  +
                    } /* JsonParserGenerator.kt:409 */
   42     57   
                }
          58  +
                /* JsonParserGenerator.kt:408 */
   43     59   
            }
          60  +
            /* JsonParserGenerator.kt:444 */
   44     61   
            Ok(Some(crate::unconstrained::list_of_range_short_unconstrained::ListOfRangeShortUnconstrained(items)))
          62  +
            /* JsonParserGenerator.kt:713 */
   45     63   
        }
   46         -
        _ => Err(
   47         -
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   48         -
                "expected start array or null",
   49         -
            ),
   50         -
        ),
          64  +
        /* JsonParserGenerator.kt:722 */
          65  +
        _ => {
          66  +
            /* JsonParserGenerator.kt:723 */
          67  +
            Err(
          68  +
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
          69  +
                    "expected start array or null",
          70  +
                ),
          71  +
            )
          72  +
            /* JsonParserGenerator.kt:722 */
          73  +
        } /* JsonParserGenerator.kt:712 */
   51     74   
    }
          75  +
    /* JsonParserGenerator.kt:398 */
   52     76   
}