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_query_params_targeting_map_of_pattern_string_operation_output.rs

@@ -1,1 +27,45 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
    2      3   
pub fn ser_query_params_targeting_map_of_pattern_string_operation_output_output_output(
    3      4   
    value: &crate::output::QueryParamsTargetingMapOfPatternStringOperationOutput,
    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_query_params_targeting_map_of_pattern_string_operation_output::ser_query_params_targeting_map_of_pattern_string_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_query_params_targeting_map_of_pattern_string_operation_output_output(
   13     19   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   14     20   
    input: &crate::output::QueryParamsTargetingMapOfPatternStringOperationOutput,
   15     21   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          22  +
    /* JsonSerializerGenerator.kt:382 */
   16     23   
    if let Some(var_1) = &input.map_of_pattern_string {
          24  +
        /* JsonSerializerGenerator.kt:495 */
   17     25   
        #[allow(unused_mut)]
          26  +
        /* JsonSerializerGenerator.kt:496 */
   18     27   
        let mut object_2 = object.key("mapOfPatternString").start_object();
          28  +
        /* JsonSerializerGenerator.kt:537 */
   19     29   
        for (key_3, value_4) in var_1 {
          30  +
            /* SerializerUtil.kt:42 */
   20     31   
            {
          32  +
                /* JsonSerializerGenerator.kt:423 */
   21     33   
                object_2.key(key_3.as_str()).string(value_4.as_str());
          34  +
                /* SerializerUtil.kt:42 */
   22     35   
            }
          36  +
            /* JsonSerializerGenerator.kt:537 */
   23     37   
        }
          38  +
        /* JsonSerializerGenerator.kt:515 */
   24     39   
        object_2.finish();
          40  +
        /* JsonSerializerGenerator.kt:382 */
   25     41   
    }
          42  +
    /* JsonSerializerGenerator.kt:372 */
   26     43   
    Ok(())
          44  +
    /* JsonSerializerGenerator.kt:358 */
   27     45   
}

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

@@ -1,1 +117,157 @@
    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_query_params_targeting_map_of_set_of_length_string_operation_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::QueryParamsTargetingMapOfSetOfLengthStringOperationInput,
    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::query_params_targeting_map_of_set_of_length_string_operation_input_internal::Builder::default();
          21  +
        /* ServerHttpBoundProtocolGenerator.kt:723 */let mut input = crate::input::query_params_targeting_map_of_set_of_length_string_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:1073 */
   22     29   
        let query_string = uri.query().unwrap_or("");
   23     30   
        let pairs = ::form_urlencoded::parse(query_string.as_bytes());
          31  +
        /* ServerHttpBoundProtocolGenerator.kt:1088 */
   24     32   
        let mut query_params: crate::unconstrained::map_of_set_of_length_string_unconstrained::MapOfSetOfLengthStringUnconstrained =
   25         -
            crate::unconstrained::map_of_set_of_length_string_unconstrained::MapOfSetOfLengthStringUnconstrained(
   26         -
                ::std::collections::HashMap::new()
   27         -
            )
   28         -
        ;
          33  +
            /* ServerHttpBoundProtocolGenerator.kt:1089 */crate::unconstrained::map_of_set_of_length_string_unconstrained::MapOfSetOfLengthStringUnconstrained(
          34  +
                /* ServerHttpBoundProtocolGenerator.kt:1090 */::std::collections::HashMap::new()
          35  +
            /* ServerHttpBoundProtocolGenerator.kt:1089 */)
          36  +
        /* ServerHttpBoundProtocolGenerator.kt:1088 */;
          37  +
        /* ServerHttpBoundProtocolGenerator.kt:1105 */
   29     38   
        for (k, v) in pairs {
          39  +
            /* ServerHttpBoundProtocolGenerator.kt:1187 */
   30     40   
            let entry = query_params.0.entry(String::from(k)).or_insert_with(|| crate::unconstrained::set_of_length_string_unconstrained::SetOfLengthStringUnconstrained(std::vec::Vec::new()));
   31     41   
            entry.0.push(String::from(v));
          42  +
            /* ServerHttpBoundProtocolGenerator.kt:1105 */
   32     43   
        }
   33         -
        input = input.set_map_of_set_of_length_string(Some(query_params));
          44  +
        /* ServerHttpBoundProtocolGenerator.kt:1213 */
          45  +
        input = input.set_map_of_set_of_length_string(
          46  +
            /* ServerHttpBoundProtocolGenerator.kt:1214 */
          47  +
            Some(
          48  +
                /* ServerHttpBoundProtocolGenerator.kt:1215 */
          49  +
                query_params, /* ServerHttpBoundProtocolGenerator.kt:1214 */
          50  +
            ), /* ServerHttpBoundProtocolGenerator.kt:1213 */
          51  +
        );
          52  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   34     53   
        input.build()?
          54  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   35     55   
    })
          56  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   36     57   
}
   37     58   
          59  +
/* RustType.kt:516 */
   38     60   
#[allow(clippy::unnecessary_wraps)]
          61  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   39     62   
pub fn ser_query_params_targeting_map_of_set_of_length_string_operation_http_response(
   40     63   
    #[allow(unused_variables)]
   41     64   
    output: crate::output::QueryParamsTargetingMapOfSetOfLengthStringOperationOutput,
   42     65   
) -> std::result::Result<
   43     66   
    ::aws_smithy_http_server::response::Response,
   44     67   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   45     68   
> {
          69  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   46     70   
    Ok({
          71  +
        /* RustType.kt:516 */
   47     72   
        #[allow(unused_mut)]
          73  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   48     74   
        let mut builder = ::http::Response::builder();
          75  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   49     76   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   50     77   
            builder,
   51     78   
            ::http::header::CONTENT_TYPE,
   52     79   
            "application/json",
   53     80   
        );
          81  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   54     82   
        let http_status: u16 = 200;
   55     83   
        builder = builder.status(http_status);
          84  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
   56     85   
        let payload =
   57         -
            crate::protocol_serde::shape_query_params_targeting_map_of_set_of_length_string_operation_output::ser_query_params_targeting_map_of_set_of_length_string_operation_output_output_output(&output)?
   58         -
        ;
          86  +
            /* HttpBoundProtocolPayloadGenerator.kt:237 */crate::protocol_serde::shape_query_params_targeting_map_of_set_of_length_string_operation_output::ser_query_params_targeting_map_of_set_of_length_string_operation_output_output_output(&output)?
          87  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
          88  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   59     89   
        let content_length = payload.len();
   60     90   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   61     91   
            builder,
   62     92   
            ::http::header::CONTENT_LENGTH,
   63     93   
            content_length,
   64     94   
        );
          95  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   65     96   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          97  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   66     98   
        builder.body(body)?
          99  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   67    100   
    })
         101  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   68    102   
}
   69    103   
         104  +
/* RustType.kt:516 */
   70    105   
#[allow(clippy::unnecessary_wraps)]
         106  +
/* ServerHttpBoundProtocolGenerator.kt:447 */
   71    107   
pub fn ser_query_params_targeting_map_of_set_of_length_string_operation_http_error(
   72    108   
    error: &crate::error::QueryParamsTargetingMapOfSetOfLengthStringOperationError,
   73    109   
) -> std::result::Result<
   74    110   
    ::aws_smithy_http_server::response::Response,
   75    111   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   76    112   
> {
         113  +
    /* ServerHttpBoundProtocolGenerator.kt:452 */
   77    114   
    Ok({
         115  +
        /* ServerHttpBoundProtocolGenerator.kt:468 */
   78    116   
        match error {
   79         -
            crate::error::QueryParamsTargetingMapOfSetOfLengthStringOperationError::ValidationException(output) => {
   80         -
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
   81         -
                #[allow(unused_mut)]
   82         -
                let mut builder = ::http::Response::builder();
   83         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         117  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */crate::error::QueryParamsTargetingMapOfSetOfLengthStringOperationError::ValidationException(output) => {
         118  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_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(
   84    122   
                                builder,
   85    123   
                                ::http::header::CONTENT_TYPE,
   86    124   
                                "application/json",
   87    125   
                            );
   88         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         126  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */builder = ::aws_smithy_http::header::set_response_header_if_absent(
   89    127   
                                builder,
   90    128   
                                ::http::header::HeaderName::from_static("x-amzn-errortype"),
   91    129   
                                "ValidationException",
   92    130   
                            );
   93         -
                let content_length = payload.len();
         131  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */let content_length = payload.len();
   94    132   
                            builder = ::aws_smithy_http::header::set_response_header_if_absent(builder, ::http::header::CONTENT_LENGTH, content_length);
   95         -
                builder.status(400).body(::aws_smithy_http_server::body::to_boxed(payload))?
   96         -
            }
   97         -
            crate::error::QueryParamsTargetingMapOfSetOfLengthStringOperationError::InternalServerError(output) => {
   98         -
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
   99         -
                #[allow(unused_mut)]
  100         -
                let mut builder = ::http::Response::builder();
  101         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         133  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */builder.status(400).body(::aws_smithy_http_server::body::to_boxed(payload))?
         134  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */}
         135  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */crate::error::QueryParamsTargetingMapOfSetOfLengthStringOperationError::InternalServerError(output) => {
         136  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
         137  +
                /* RustType.kt:516 */#[allow(unused_mut)]
         138  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */let mut builder = ::http::Response::builder();
         139  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */builder = ::aws_smithy_http::header::set_response_header_if_absent(
  102    140   
                                builder,
  103    141   
                                ::http::header::CONTENT_TYPE,
  104    142   
                                "application/json",
  105    143   
                            );
  106         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         144  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */builder = ::aws_smithy_http::header::set_response_header_if_absent(
  107    145   
                                builder,
  108    146   
                                ::http::header::HeaderName::from_static("x-amzn-errortype"),
  109    147   
                                "InternalServerError",
  110    148   
                            );
  111         -
                let content_length = payload.len();
         149  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */let content_length = payload.len();
  112    150   
                            builder = ::aws_smithy_http::header::set_response_header_if_absent(builder, ::http::header::CONTENT_LENGTH, content_length);
  113         -
                builder.status(500).body(::aws_smithy_http_server::body::to_boxed(payload))?
  114         -
            }
  115         -
        }
         151  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */builder.status(500).body(::aws_smithy_http_server::body::to_boxed(payload))?
         152  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */}
         153  +
        /* ServerHttpBoundProtocolGenerator.kt:468 */}
         154  +
        /* ServerHttpBoundProtocolGenerator.kt:452 */
  116    155   
    })
         156  +
    /* ServerHttpBoundProtocolGenerator.kt:447 */
  117    157   
}

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

@@ -1,1 +33,57 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
    2      3   
pub fn ser_query_params_targeting_map_of_set_of_length_string_operation_output_output_output(
    3      4   
    value: &crate::output::QueryParamsTargetingMapOfSetOfLengthStringOperationOutput,
    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_query_params_targeting_map_of_set_of_length_string_operation_output::ser_query_params_targeting_map_of_set_of_length_string_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_query_params_targeting_map_of_set_of_length_string_operation_output_output(
   13     19   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   14     20   
    input: &crate::output::QueryParamsTargetingMapOfSetOfLengthStringOperationOutput,
   15     21   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          22  +
    /* JsonSerializerGenerator.kt:382 */
   16     23   
    if let Some(var_1) = &input.map_of_set_of_length_string {
          24  +
        /* JsonSerializerGenerator.kt:495 */
   17     25   
        #[allow(unused_mut)]
          26  +
        /* JsonSerializerGenerator.kt:496 */
   18     27   
        let mut object_2 = object.key("mapOfSetOfLengthString").start_object();
          28  +
        /* JsonSerializerGenerator.kt:537 */
   19     29   
        for (key_3, value_4) in var_1 {
          30  +
            /* SerializerUtil.kt:42 */
   20     31   
            {
          32  +
                /* JsonSerializerGenerator.kt:484 */
   21     33   
                let mut array_5 = object_2.key(key_3.as_str()).start_array();
          34  +
                /* JsonSerializerGenerator.kt:524 */
   22     35   
                for item_6 in value_4 {
          36  +
                    /* SerializerUtil.kt:42 */
   23     37   
                    {
          38  +
                        /* JsonSerializerGenerator.kt:423 */
   24     39   
                        array_5.value().string(item_6.as_str());
          40  +
                        /* SerializerUtil.kt:42 */
   25     41   
                    }
          42  +
                    /* JsonSerializerGenerator.kt:524 */
   26     43   
                }
          44  +
                /* JsonSerializerGenerator.kt:486 */
   27     45   
                array_5.finish();
          46  +
                /* SerializerUtil.kt:42 */
   28     47   
            }
          48  +
            /* JsonSerializerGenerator.kt:537 */
   29     49   
        }
          50  +
        /* JsonSerializerGenerator.kt:515 */
   30     51   
        object_2.finish();
          52  +
        /* JsonSerializerGenerator.kt:382 */
   31     53   
    }
          54  +
    /* JsonSerializerGenerator.kt:372 */
   32     55   
    Ok(())
          56  +
    /* JsonSerializerGenerator.kt:358 */
   33     57   
}

tmp-codegen-diff/codegen-server-test-python/constraints_without_public_constrained_types/rust-server-codegen-python/src/protocol_serde/shape_recursive_list.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_recursive_list<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<crate::unconstrained::recursive_list_unconstrained::RecursiveListUnconstrained>,
    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   
                    _ => {
          37  +
                        /* JsonParserGenerator.kt:419 */
   27     38   
                        let value =
   28         -
                            crate::protocol_serde::shape_recursive_shapes_input_output_nested1::de_recursive_shapes_input_output_nested1(tokens)?
   29         -
                        ;
          39  +
                            /* JsonParserGenerator.kt:544 */crate::protocol_serde::shape_recursive_shapes_input_output_nested1::de_recursive_shapes_input_output_nested1(tokens)?
          40  +
                        /* JsonParserGenerator.kt:419 */;
          41  +
                        /* JsonParserGenerator.kt:422 */
   30     42   
                        if let Some(value) = value {
   31     43   
                            items.push(value);
   32         -
                        } else {
          44  +
                        }
          45  +
                        /* JsonParserGenerator.kt:430 */
          46  +
                        else {
   33     47   
                            return Err(
   34     48   
                                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   35     49   
                                    "dense list cannot contain null values",
   36     50   
                                ),
   37     51   
                            );
   38     52   
                        }
   39         -
                    }
          53  +
                        /* JsonParserGenerator.kt:413 */
          54  +
                    } /* JsonParserGenerator.kt:409 */
   40     55   
                }
          56  +
                /* JsonParserGenerator.kt:408 */
   41     57   
            }
          58  +
            /* JsonParserGenerator.kt:444 */
   42     59   
            Ok(Some(
   43     60   
                crate::unconstrained::recursive_list_unconstrained::RecursiveListUnconstrained(
   44     61   
                    items,
   45     62   
                ),
   46     63   
            ))
          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_recursive_shapes_input_output_nested1.rs

@@ -1,1 +63,102 @@
    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_recursive_shapes_input_output_nested1<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<crate::model::recursive_shapes_input_output_nested1_internal::Builder>,
    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 =
   21     26   
                crate::model::recursive_shapes_input_output_nested1_internal::Builder::default();
          27  +
            /* JsonParserGenerator.kt:684 */
   22     28   
            loop {
          29  +
                /* JsonParserGenerator.kt:685 */
   23     30   
                match tokens.next().transpose()? {
          31  +
                    /* JsonParserGenerator.kt:686 */
   24     32   
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   25         -
                                            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
          33  +
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
          34  +
                        /* JsonParserGenerator.kt:260 */
   26     35   
                        match key.to_unescaped()?.as_ref() {
          36  +
                            /* JsonParserGenerator.kt:262 */
   27     37   
                            "recursiveMember" => {
          38  +
                                /* JsonParserGenerator.kt:276 */
   28     39   
                                if let Some(v) =
   29         -
                                crate::protocol_serde::shape_recursive_shapes_input_output_nested2::de_recursive_shapes_input_output_nested2(tokens)?
   30         -
                                .map(|x| x.into())
   31         -
                                .map(Box::new)
   32         -
                                {
          40  +
                                /* JsonParserGenerator.kt:544 */crate::protocol_serde::shape_recursive_shapes_input_output_nested2::de_recursive_shapes_input_output_nested2(tokens)?
          41  +
                                /* ServerProtocol.kt:425 */.map(|x| x.into())
          42  +
                                /* JsonParserGenerator.kt:314 */.map(Box::new)
          43  +
                                /* JsonParserGenerator.kt:278 */{
   33     44   
                                                                            builder = builder.set_recursive_member(v);
   34     45   
                                                                        }
          46  +
                                /* JsonParserGenerator.kt:262 */
   35     47   
                            }
   36         -
                            _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?
          48  +
                            /* JsonParserGenerator.kt:290 */
          49  +
                            _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
   37     50   
                        }
          51  +
                        /* JsonParserGenerator.kt:686 */
   38     52   
                    }
   39         -
                    other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other)))
          53  +
                    /* JsonParserGenerator.kt:695 */
          54  +
                    other => {
          55  +
                        return Err(
          56  +
                            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
          57  +
                                format!("expected object key or end object, found: {:?}", other),
          58  +
                            ),
          59  +
                        )
          60  +
                    } /* JsonParserGenerator.kt:685 */
   40     61   
                }
          62  +
                /* JsonParserGenerator.kt:684 */
   41     63   
            }
          64  +
            /* JsonParserGenerator.kt:540 */
   42     65   
            Ok(Some(builder))
          66  +
            /* JsonParserGenerator.kt:713 */
   43     67   
        }
   44         -
        _ => Err(
   45         -
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   46         -
                "expected start object or null",
   47         -
            ),
   48         -
        ),
          68  +
        /* JsonParserGenerator.kt:722 */
          69  +
        _ => {
          70  +
            /* JsonParserGenerator.kt:723 */
          71  +
            Err(
          72  +
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
          73  +
                    "expected start object or null",
          74  +
                ),
          75  +
            )
          76  +
            /* JsonParserGenerator.kt:722 */
          77  +
        } /* JsonParserGenerator.kt:712 */
   49     78   
    }
          79  +
    /* JsonParserGenerator.kt:516 */
   50     80   
}
   51     81   
          82  +
/* JsonSerializerGenerator.kt:358 */
   52     83   
pub fn ser_recursive_shapes_input_output_nested1(
   53     84   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   54     85   
    input: &crate::model::RecursiveShapesInputOutputNested1,
   55     86   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          87  +
    /* SerializerUtil.kt:42 */
   56     88   
    {
          89  +
        /* JsonSerializerGenerator.kt:495 */
   57     90   
        #[allow(unused_mut)]
          91  +
        /* JsonSerializerGenerator.kt:496 */
   58     92   
        let mut object_1 = object.key("recursiveMember").start_object();
          93  +
        /* JsonSerializerGenerator.kt:375 */
   59     94   
        crate::protocol_serde::shape_recursive_shapes_input_output_nested2::ser_recursive_shapes_input_output_nested2(&mut object_1, &input.recursive_member)?;
          95  +
        /* JsonSerializerGenerator.kt:515 */
   60     96   
        object_1.finish();
          97  +
        /* SerializerUtil.kt:42 */
   61     98   
    }
          99  +
    /* JsonSerializerGenerator.kt:372 */
   62    100   
    Ok(())
         101  +
    /* JsonSerializerGenerator.kt:358 */
   63    102   
}

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

@@ -1,1 +65,98 @@
    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_recursive_shapes_input_output_nested2<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<crate::model::recursive_shapes_input_output_nested2_internal::Builder>,
    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 =
   21     26   
                crate::model::recursive_shapes_input_output_nested2_internal::Builder::default();
          27  +
            /* JsonParserGenerator.kt:684 */
   22     28   
            loop {
          29  +
                /* JsonParserGenerator.kt:685 */
   23     30   
                match tokens.next().transpose()? {
          31  +
                    /* JsonParserGenerator.kt:686 */
   24     32   
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   25     33   
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
          34  +
                        /* JsonParserGenerator.kt:260 */
   26     35   
                        match key.to_unescaped()?.as_ref() {
          36  +
                            /* JsonParserGenerator.kt:262 */
   27     37   
                            "recursiveMember" => {
          38  +
                                /* JsonParserGenerator.kt:272 */
   28     39   
                                builder = builder.set_recursive_member(
   29         -
                                    crate::protocol_serde::shape_recursive_shapes_input_output_nested1::de_recursive_shapes_input_output_nested1(tokens)?
   30         -
                                );
          40  +
                                    /* JsonParserGenerator.kt:544 */crate::protocol_serde::shape_recursive_shapes_input_output_nested1::de_recursive_shapes_input_output_nested1(tokens)?
          41  +
                                /* JsonParserGenerator.kt:272 */);
          42  +
                                /* JsonParserGenerator.kt:262 */
   31     43   
                            }
   32         -
                            _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
          44  +
                            /* JsonParserGenerator.kt:290 */
          45  +
                            _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
   33     46   
                        }
          47  +
                        /* JsonParserGenerator.kt:686 */
   34     48   
                    }
          49  +
                    /* JsonParserGenerator.kt:695 */
   35     50   
                    other => {
   36     51   
                        return Err(
   37     52   
                            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   38     53   
                                format!("expected object key or end object, found: {:?}", other),
   39     54   
                            ),
   40     55   
                        )
   41         -
                    }
          56  +
                    } /* JsonParserGenerator.kt:685 */
   42     57   
                }
          58  +
                /* JsonParserGenerator.kt:684 */
   43     59   
            }
          60  +
            /* JsonParserGenerator.kt:540 */
   44     61   
            Ok(Some(builder))
          62  +
            /* JsonParserGenerator.kt:713 */
   45     63   
        }
   46         -
        _ => Err(
   47         -
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   48         -
                "expected start object 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 object or null",
          70  +
                ),
          71  +
            )
          72  +
            /* JsonParserGenerator.kt:722 */
          73  +
        } /* JsonParserGenerator.kt:712 */
   51     74   
    }
          75  +
    /* JsonParserGenerator.kt:516 */
   52     76   
}
   53     77   
          78  +
/* JsonSerializerGenerator.kt:358 */
   54     79   
pub fn ser_recursive_shapes_input_output_nested2(
   55     80   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   56     81   
    input: &crate::model::RecursiveShapesInputOutputNested2,
   57     82   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          83  +
    /* JsonSerializerGenerator.kt:382 */
   58     84   
    if let Some(var_1) = &input.recursive_member {
          85  +
        /* JsonSerializerGenerator.kt:495 */
   59     86   
        #[allow(unused_mut)]
          87  +
        /* JsonSerializerGenerator.kt:496 */
   60     88   
        let mut object_2 = object.key("recursiveMember").start_object();
          89  +
        /* JsonSerializerGenerator.kt:375 */
   61     90   
        crate::protocol_serde::shape_recursive_shapes_input_output_nested1::ser_recursive_shapes_input_output_nested1(&mut object_2, var_1)?;
          91  +
        /* JsonSerializerGenerator.kt:515 */
   62     92   
        object_2.finish();
          93  +
        /* JsonSerializerGenerator.kt:382 */
   63     94   
    }
          95  +
    /* JsonSerializerGenerator.kt:372 */
   64     96   
    Ok(())
          97  +
    /* JsonSerializerGenerator.kt:358 */
   65     98   
}

tmp-codegen-diff/codegen-server-test-python/constraints_without_public_constrained_types/rust-server-codegen-python/src/protocol_serde/shape_sensitive_length_list.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_sensitive_length_list<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<
    6      7   
        crate::unconstrained::sensitive_length_list_unconstrained::SensitiveLengthListUnconstrained,
    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   
                    _ => {
          39  +
                        /* JsonParserGenerator.kt:419 */
   29     40   
                        let value =
   30         -
                            crate::protocol_serde::shape_sensitive_structure::de_sensitive_structure(tokens)?
   31         -
                        ;
          41  +
                            /* JsonParserGenerator.kt:544 */crate::protocol_serde::shape_sensitive_structure::de_sensitive_structure(tokens)?
          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::sensitive_length_list_unconstrained::SensitiveLengthListUnconstrained(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_sensitive_structure.rs

@@ -1,1 +37,54 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:358 */
    2      3   
pub fn ser_sensitive_structure(
    3      4   
    #[allow(unused_variables)] object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4      5   
    #[allow(unused_variables)] input: &crate::model::SensitiveStructure,
    5      6   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
           7  +
    /* JsonSerializerGenerator.kt:372 */
    6      8   
    Ok(())
           9  +
    /* JsonSerializerGenerator.kt:358 */
    7     10   
}
    8     11   
          12  +
/* JsonParserGenerator.kt:516 */
    9     13   
pub(crate) fn de_sensitive_structure<'a, I>(
   10     14   
    tokens: &mut ::std::iter::Peekable<I>,
   11     15   
) -> ::std::result::Result<
   12     16   
    Option<crate::model::SensitiveStructure>,
   13     17   
    ::aws_smithy_json::deserialize::error::DeserializeError,
   14     18   
>
   15     19   
where
   16     20   
    I: Iterator<
   17     21   
        Item = Result<
   18     22   
            ::aws_smithy_json::deserialize::Token<'a>,
   19     23   
            ::aws_smithy_json::deserialize::error::DeserializeError,
   20     24   
        >,
   21     25   
    >,
   22     26   
{
          27  +
    /* JsonParserGenerator.kt:712 */
   23     28   
    match tokens.next().transpose()? {
          29  +
        /* JsonParserGenerator.kt:713 */
   24     30   
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   25     31   
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
          32  +
            /* RustType.kt:516 */
   26     33   
            #[allow(unused_mut)]
          34  +
            /* JsonParserGenerator.kt:526 */
   27     35   
            let mut builder = crate::model::sensitive_structure_internal::Builder::default();
          36  +
            /* JsonParserGenerator.kt:682 */
   28     37   
            ::aws_smithy_json::deserialize::token::skip_to_end(tokens)?;
          38  +
            /* JsonParserGenerator.kt:540 */
   29     39   
            Ok(Some(builder.build()))
          40  +
            /* JsonParserGenerator.kt:713 */
   30     41   
        }
   31         -
        _ => Err(
   32         -
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   33         -
                "expected start object or null",
   34         -
            ),
   35         -
        ),
          42  +
        /* JsonParserGenerator.kt:722 */
          43  +
        _ => {
          44  +
            /* JsonParserGenerator.kt:723 */
          45  +
            Err(
          46  +
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
          47  +
                    "expected start object or null",
          48  +
                ),
          49  +
            )
          50  +
            /* JsonParserGenerator.kt:722 */
          51  +
        } /* JsonParserGenerator.kt:712 */
   36     52   
    }
          53  +
    /* JsonParserGenerator.kt:516 */
   37     54   
}

tmp-codegen-diff/codegen-server-test-python/constraints_without_public_constrained_types/rust-server-codegen-python/src/protocol_serde/shape_set_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_set_of_length_pattern_string<'a, I>(tokens: &mut ::std::iter::Peekable<I>) -> ::std::result::Result<Option<crate::unconstrained::set_of_length_pattern_string_unconstrained::SetOfLengthPatternStringUnconstrained>, ::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::set_of_length_pattern_string_unconstrained::SetOfLengthPatternStringUnconstrained(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_set_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_set_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::set_of_length_string_unconstrained::SetOfLengthStringUnconstrained,
    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::set_of_length_string_unconstrained::SetOfLengthStringUnconstrained(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_set_of_pattern_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_set_of_pattern_string<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<
    6      7   
        crate::unconstrained::set_of_pattern_string_unconstrained::SetOfPatternStringUnconstrained,
    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::set_of_pattern_string_unconstrained::SetOfPatternStringUnconstrained(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_set_of_range_byte.rs

@@ -1,1 +56,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_set_of_range_byte<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<crate::unconstrained::set_of_range_byte_unconstrained::SetOfRangeByteUnconstrained>,
    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(
   45     62   
                crate::unconstrained::set_of_range_byte_unconstrained::SetOfRangeByteUnconstrained(
   46     63   
                    items,
   47     64   
                ),
   48     65   
            ))
          66  +
            /* JsonParserGenerator.kt:713 */
   49     67   
        }
   50         -
        _ => Err(
   51         -
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   52         -
                "expected start array or null",
   53         -
            ),
   54         -
        ),
          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 */
   55     78   
    }
          79  +
    /* JsonParserGenerator.kt:398 */
   56     80   
}

tmp-codegen-diff/codegen-server-test-python/constraints_without_public_constrained_types/rust-server-codegen-python/src/protocol_serde/shape_set_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_set_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::set_of_range_integer_unconstrained::SetOfRangeIntegerUnconstrained,
    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::set_of_range_integer_unconstrained::SetOfRangeIntegerUnconstrained(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_set_of_range_long.rs

@@ -1,1 +56,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_set_of_range_long<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<crate::unconstrained::set_of_range_long_unconstrained::SetOfRangeLongUnconstrained>,
    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(
   45     62   
                crate::unconstrained::set_of_range_long_unconstrained::SetOfRangeLongUnconstrained(
   46     63   
                    items,
   47     64   
                ),
   48     65   
            ))
          66  +
            /* JsonParserGenerator.kt:713 */
   49     67   
        }
   50         -
        _ => Err(
   51         -
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   52         -
                "expected start array or null",
   53         -
            ),
   54         -
        ),
          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 */
   55     78   
    }
          79  +
    /* JsonParserGenerator.kt:398 */
   56     80   
}

tmp-codegen-diff/codegen-server-test-python/constraints_without_public_constrained_types/rust-server-codegen-python/src/protocol_serde/shape_set_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_set_of_range_short<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<crate::unconstrained::set_of_range_short_unconstrained::SetOfRangeShortUnconstrained>,
    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::set_of_range_short_unconstrained::SetOfRangeShortUnconstrained(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_sparse_length_list.rs

@@ -1,1 +45,70 @@
    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_sparse_length_list<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<crate::unconstrained::sparse_length_list_unconstrained::SparseLengthListUnconstrained>,
    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   
                    _ => {
          37  +
                        /* JsonParserGenerator.kt:415 */
   27     38   
                        items.push(
          39  +
                            /* JsonParserGenerator.kt:354 */
   28     40   
                            ::aws_smithy_json::deserialize::token::expect_string_or_null(
   29     41   
                                tokens.next(),
   30     42   
                            )?
   31         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   32         -
                            .transpose()?,
          43  +
                            .map(|s|
          44  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          45  +
                                    /* JsonParserGenerator.kt:348 */u.into_owned()
          46  +
                                /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
          47  +
                            .transpose()?, /* JsonParserGenerator.kt:415 */
   33     48   
                        );
   34         -
                    }
          49  +
                        /* JsonParserGenerator.kt:413 */
          50  +
                    } /* JsonParserGenerator.kt:409 */
   35     51   
                }
          52  +
                /* JsonParserGenerator.kt:408 */
   36     53   
            }
          54  +
            /* JsonParserGenerator.kt:444 */
   37     55   
            Ok(Some(crate::unconstrained::sparse_length_list_unconstrained::SparseLengthListUnconstrained(items)))
          56  +
            /* JsonParserGenerator.kt:713 */
   38     57   
        }
   39         -
        _ => Err(
   40         -
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   41         -
                "expected start array or null",
   42         -
            ),
   43         -
        ),
          58  +
        /* JsonParserGenerator.kt:722 */
          59  +
        _ => {
          60  +
            /* JsonParserGenerator.kt:723 */
          61  +
            Err(
          62  +
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
          63  +
                    "expected start array or null",
          64  +
                ),
          65  +
            )
          66  +
            /* JsonParserGenerator.kt:722 */
          67  +
        } /* JsonParserGenerator.kt:712 */
   44     68   
    }
          69  +
    /* JsonParserGenerator.kt:398 */
   45     70   
}