Server Test Python

Server Test Python

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943 (ignoring whitespace)

Files changed:

tmp-codegen-diff/codegen-server-test-python/constraints/rust-server-codegen-python/src/protocol_serde/shape_map_of_length_blob.rs

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

tmp-codegen-diff/codegen-server-test-python/constraints/rust-server-codegen-python/src/protocol_serde/shape_map_of_length_pattern_string.rs

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

tmp-codegen-diff/codegen-server-test-python/constraints/rust-server-codegen-python/src/protocol_serde/shape_map_of_length_string.rs

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

tmp-codegen-diff/codegen-server-test-python/constraints/rust-server-codegen-python/src/protocol_serde/shape_map_of_list_of_list_of_con_b.rs

@@ -1,1 +44,71 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:460 */
    2      3   
pub(crate) fn de_map_of_list_of_list_of_con_b<'a, I>(tokens: &mut ::std::iter::Peekable<I>) -> ::std::result::Result<Option<crate::unconstrained::map_of_list_of_list_of_con_b_unconstrained::MapOfListOfListOfConBUnconstrained>, ::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::StartObject { .. }) => {
          10  +
            /* JsonParserGenerator.kt:469 */
    7     11   
            let mut map = ::std::collections::HashMap::new();
          12  +
            /* JsonParserGenerator.kt:684 */
    8     13   
            loop {
          14  +
                /* JsonParserGenerator.kt:685 */
    9     15   
                match tokens.next().transpose()? {
          16  +
                    /* JsonParserGenerator.kt:686 */
   10     17   
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   11     18   
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
   12         -
                        let key = key.to_unescaped().map(|u| u.into_owned())?;
   13         -
                        let value = crate::protocol_serde::shape_con_b_list::de_con_b_list(tokens)?;
          19  +
                        /* JsonParserGenerator.kt:471 */
          20  +
                        let key =
          21  +
                            /* JsonParserGenerator.kt:339 */key.to_unescaped().map(|u|
          22  +
                                /* JsonParserGenerator.kt:348 */u.into_owned()
          23  +
                            /* JsonParserGenerator.kt:339 */)
          24  +
                        /* JsonParserGenerator.kt:471 */?;
          25  +
                        /* JsonParserGenerator.kt:474 */
          26  +
                        let value =
          27  +
                            /* JsonParserGenerator.kt:451 */crate::protocol_serde::shape_con_b_list::de_con_b_list(tokens)?
          28  +
                        /* JsonParserGenerator.kt:474 */;
          29  +
                        /* JsonParserGenerator.kt:481 */
   14     30   
                        match value {
   15     31   
                            Some(value) => {
   16     32   
                                map.insert(key, value);
   17     33   
                            }
   18     34   
                            None => {
   19     35   
                                return Err(
   20     36   
                                    ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   21     37   
                                        "dense map cannot contain null values",
   22     38   
                                    ),
   23     39   
                                )
   24     40   
                            }
   25     41   
                        }
          42  +
                        /* JsonParserGenerator.kt:686 */
   26     43   
                    }
          44  +
                    /* JsonParserGenerator.kt:695 */
   27     45   
                    other => {
   28     46   
                        return Err(
   29     47   
                            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   30     48   
                                format!("expected object key or end object, found: {:?}", other),
   31     49   
                            ),
   32     50   
                        )
          51  +
                    } /* JsonParserGenerator.kt:685 */
   33     52   
                }
          53  +
                /* JsonParserGenerator.kt:684 */
   34     54   
            }
   35         -
            }
          55  +
            /* JsonParserGenerator.kt:502 */
   36     56   
            Ok(Some(crate::unconstrained::map_of_list_of_list_of_con_b_unconstrained::MapOfListOfListOfConBUnconstrained(map)))
          57  +
            /* JsonParserGenerator.kt:713 */
   37     58   
        }
   38         -
        _ => Err(
          59  +
        /* JsonParserGenerator.kt:722 */
          60  +
        _ => {
          61  +
            /* JsonParserGenerator.kt:723 */
          62  +
            Err(
   39     63   
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   40     64   
                    "expected start object or null",
   41     65   
                ),
   42         -
        ),
          66  +
            )
          67  +
            /* JsonParserGenerator.kt:722 */
          68  +
        } /* JsonParserGenerator.kt:712 */
   43     69   
    }
          70  +
    /* JsonParserGenerator.kt:460 */
   44     71   
}

tmp-codegen-diff/codegen-server-test-python/constraints/rust-server-codegen-python/src/protocol_serde/shape_map_of_map_of_list_of_list_of_con_b.rs

@@ -1,1 +46,71 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:460 */
    2      3   
pub(crate) fn de_map_of_map_of_list_of_list_of_con_b<'a, I>(tokens: &mut ::std::iter::Peekable<I>) -> ::std::result::Result<Option<crate::unconstrained::map_of_map_of_list_of_list_of_con_b_unconstrained::MapOfMapOfListOfListOfConBUnconstrained>, ::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::StartObject { .. }) => {
          10  +
            /* JsonParserGenerator.kt:469 */
    7     11   
            let mut map = ::std::collections::HashMap::new();
          12  +
            /* JsonParserGenerator.kt:684 */
    8     13   
            loop {
          14  +
                /* JsonParserGenerator.kt:685 */
    9     15   
                match tokens.next().transpose()? {
          16  +
                    /* JsonParserGenerator.kt:686 */
   10     17   
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   11     18   
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
   12         -
                        let key = key.to_unescaped().map(|u| u.into_owned())?;
          19  +
                        /* JsonParserGenerator.kt:471 */
          20  +
                        let key =
          21  +
                            /* JsonParserGenerator.kt:339 */key.to_unescaped().map(|u|
          22  +
                                /* JsonParserGenerator.kt:348 */u.into_owned()
          23  +
                            /* JsonParserGenerator.kt:339 */)
          24  +
                        /* JsonParserGenerator.kt:471 */?;
          25  +
                        /* JsonParserGenerator.kt:474 */
   13     26   
                        let value =
   14         -
                            crate::protocol_serde::shape_map_of_list_of_list_of_con_b::de_map_of_list_of_list_of_con_b(tokens)?
   15         -
                        ;
          27  +
                            /* JsonParserGenerator.kt:509 */crate::protocol_serde::shape_map_of_list_of_list_of_con_b::de_map_of_list_of_list_of_con_b(tokens)?
          28  +
                        /* JsonParserGenerator.kt:474 */;
          29  +
                        /* JsonParserGenerator.kt:481 */
   16     30   
                        match value {
   17     31   
                            Some(value) => {
   18     32   
                                map.insert(key, value);
   19     33   
                            }
   20     34   
                            None => {
   21     35   
                                return Err(
   22     36   
                                    ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   23     37   
                                        "dense map cannot contain null values",
   24     38   
                                    ),
   25     39   
                                )
   26     40   
                            }
   27     41   
                        }
          42  +
                        /* JsonParserGenerator.kt:686 */
   28     43   
                    }
          44  +
                    /* JsonParserGenerator.kt:695 */
   29     45   
                    other => {
   30     46   
                        return Err(
   31     47   
                            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   32     48   
                                format!("expected object key or end object, found: {:?}", other),
   33     49   
                            ),
   34     50   
                        )
          51  +
                    } /* JsonParserGenerator.kt:685 */
   35     52   
                }
          53  +
                /* JsonParserGenerator.kt:684 */
   36     54   
            }
   37         -
            }
          55  +
            /* JsonParserGenerator.kt:502 */
   38     56   
            Ok(Some(crate::unconstrained::map_of_map_of_list_of_list_of_con_b_unconstrained::MapOfMapOfListOfListOfConBUnconstrained(map)))
          57  +
            /* JsonParserGenerator.kt:713 */
   39     58   
        }
   40         -
        _ => Err(
          59  +
        /* JsonParserGenerator.kt:722 */
          60  +
        _ => {
          61  +
            /* JsonParserGenerator.kt:723 */
          62  +
            Err(
   41     63   
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   42     64   
                    "expected start object or null",
   43     65   
                ),
   44         -
        ),
          66  +
            )
          67  +
            /* JsonParserGenerator.kt:722 */
          68  +
        } /* JsonParserGenerator.kt:712 */
   45     69   
    }
          70  +
    /* JsonParserGenerator.kt:460 */
   46     71   
}

tmp-codegen-diff/codegen-server-test-python/constraints/rust-server-codegen-python/src/protocol_serde/shape_map_of_pattern_string.rs

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

tmp-codegen-diff/codegen-server-test-python/constraints/rust-server-codegen-python/src/protocol_serde/shape_map_of_range_byte.rs

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

tmp-codegen-diff/codegen-server-test-python/constraints/rust-server-codegen-python/src/protocol_serde/shape_map_of_range_integer.rs

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

tmp-codegen-diff/codegen-server-test-python/constraints/rust-server-codegen-python/src/protocol_serde/shape_map_of_range_long.rs

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

tmp-codegen-diff/codegen-server-test-python/constraints/rust-server-codegen-python/src/protocol_serde/shape_map_of_range_short.rs

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

tmp-codegen-diff/codegen-server-test-python/constraints/rust-server-codegen-python/src/protocol_serde/shape_non_streaming_blob_operation.rs

@@ -1,1 +90,127 @@
    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_non_streaming_blob_operation_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::NonStreamingBlobOperationInput,
    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)]
          21  +
        /* ServerHttpBoundProtocolGenerator.kt:723 */
   17     22   
        let mut input =
   18     23   
            crate::input::non_streaming_blob_operation_input_internal::Builder::default();
          24  +
        /* RustType.kt:516 */
   19     25   
        #[allow(unused_variables)]
          26  +
        /* ServerHttpBoundProtocolGenerator.kt:728 */
   20     27   
        let ::aws_smithy_runtime_api::http::RequestParts {
   21     28   
            uri, headers, body, ..
   22     29   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          30  +
        /* ServerHttpBoundProtocolGenerator.kt:794 */
   23     31   
        if let Some(value) = {
   24     32   
            let bytes = ::hyper::body::to_bytes(body).await?;
   25     33   
   26     34   
            crate::protocol_serde::shape_non_streaming_blob_operation_input::de_non_streaming_blob_payload(&bytes)?
   27     35   
        } {
   28     36   
            input = input.set_non_streaming_blob(Some(value))
   29     37   
        }
          38  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   30     39   
        input.build()
          40  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   31     41   
    })
          42  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   32     43   
}
   33     44   
          45  +
/* RustType.kt:516 */
   34     46   
#[allow(clippy::unnecessary_wraps)]
          47  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   35     48   
pub fn ser_non_streaming_blob_operation_http_response(
   36     49   
    #[allow(unused_variables)] output: crate::output::NonStreamingBlobOperationOutput,
   37     50   
) -> std::result::Result<
   38     51   
    ::aws_smithy_http_server::response::Response,
   39     52   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   40     53   
> {
          54  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   41     55   
    Ok({
          56  +
        /* RustType.kt:516 */
   42     57   
        #[allow(unused_mut)]
          58  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   43     59   
        let mut builder = ::http::Response::builder();
          60  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   44     61   
        let http_status: u16 = 200;
   45     62   
        builder = builder.status(http_status);
          63  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
   46     64   
        let payload =
   47         -
            crate::protocol_serde::shape_non_streaming_blob_operation_output::ser_non_streaming_blob_http_payload( output.non_streaming_blob)?
   48         -
        ;
          65  +
            /* HttpBoundProtocolPayloadGenerator.kt:350 */crate::protocol_serde::shape_non_streaming_blob_operation_output::ser_non_streaming_blob_http_payload( output.non_streaming_blob)?
          66  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
          67  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   49     68   
        let content_length = payload.len();
   50     69   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   51     70   
            builder,
   52     71   
            ::http::header::CONTENT_LENGTH,
   53     72   
            content_length,
   54     73   
        );
          74  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   55     75   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          76  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   56     77   
        builder.body(body)?
          78  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   57     79   
    })
          80  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   58     81   
}
   59     82   
          83  +
/* RustType.kt:516 */
   60     84   
#[allow(clippy::unnecessary_wraps)]
          85  +
/* ServerHttpBoundProtocolGenerator.kt:447 */
   61     86   
pub fn ser_non_streaming_blob_operation_http_error(
   62     87   
    error: &crate::error::NonStreamingBlobOperationError,
   63     88   
) -> std::result::Result<
   64     89   
    ::aws_smithy_http_server::response::Response,
   65     90   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   66     91   
> {
          92  +
    /* ServerHttpBoundProtocolGenerator.kt:452 */
   67     93   
    Ok({
          94  +
        /* ServerHttpBoundProtocolGenerator.kt:468 */
   68     95   
        match error {
          96  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
   69     97   
            crate::error::NonStreamingBlobOperationError::InternalServerError(output) => {
          98  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
   70     99   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
         100  +
                /* RustType.kt:516 */
   71    101   
                #[allow(unused_mut)]
         102  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
   72    103   
                let mut builder = ::http::Response::builder();
         104  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   73    105   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   74    106   
                    builder,
   75    107   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
   76    108   
                    "InternalServerError",
   77    109   
                );
         110  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
   78    111   
                let content_length = payload.len();
   79    112   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   80    113   
                    builder,
   81    114   
                    ::http::header::CONTENT_LENGTH,
   82    115   
                    content_length,
   83    116   
                );
         117  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
   84    118   
                builder
   85    119   
                    .status(500)
   86    120   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         121  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
         122  +
            } /* ServerHttpBoundProtocolGenerator.kt:468 */
   87    123   
        }
   88         -
        }
         124  +
        /* ServerHttpBoundProtocolGenerator.kt:452 */
   89    125   
    })
         126  +
    /* ServerHttpBoundProtocolGenerator.kt:447 */
   90    127   
}

tmp-codegen-diff/codegen-server-test-python/constraints/rust-server-codegen-python/src/protocol_serde/shape_non_streaming_blob_operation_input.rs

@@ -1,1 +11,18 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* HttpBindingGenerator.kt:248 */
    2      3   
pub(crate) fn de_non_streaming_blob_payload(
    3      4   
    body: &[u8],
    4      5   
) -> std::result::Result<
    5      6   
    ::std::option::Option<::aws_smithy_http_server_python::types::Blob>,
    6      7   
    ::aws_smithy_json::deserialize::error::DeserializeError,
    7      8   
> {
           9  +
    /* HttpBindingGenerator.kt:319 */
    8     10   
    (!body.is_empty())
    9         -
        .then(|| Ok(::aws_smithy_http_server_python::types::Blob::new(body)))
          11  +
        .then(|| {
          12  +
            /* HttpBindingGenerator.kt:349 */
          13  +
            Ok(::aws_smithy_http_server_python::types::Blob::new(body))
          14  +
            /* HttpBindingGenerator.kt:319 */
          15  +
        })
   10     16   
        .transpose()
          17  +
    /* HttpBindingGenerator.kt:248 */
   11     18   
}

tmp-codegen-diff/codegen-server-test-python/constraints/rust-server-codegen-python/src/protocol_serde/shape_non_streaming_blob_operation_output.rs

@@ -1,1 +10,22 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* HttpBoundProtocolPayloadGenerator.kt:311 */
    2      3   
pub fn ser_non_streaming_blob_http_payload(
    3      4   
    payload: ::std::option::Option<::aws_smithy_http_server_python::types::Blob>,
    4      5   
) -> ::std::result::Result<::std::vec::Vec<u8>, ::aws_smithy_types::error::operation::BuildError> {
           6  +
    /* HttpBoundProtocolPayloadGenerator.kt:320 */
    5      7   
    let payload = match payload {
    6      8   
        Some(t) => t,
    7         -
        None => return Ok(Vec::new()),
           9  +
        None => {
          10  +
            return Ok(
          11  +
                /* HttpBoundProtocolPayloadGenerator.kt:332 */
          12  +
                Vec::new(), /* HttpBoundProtocolPayloadGenerator.kt:320 */
          13  +
            )
          14  +
        }
    8     15   
    };
    9         -
    Ok(payload.into_inner())
          16  +
    /* HttpBoundProtocolPayloadGenerator.kt:345 */
          17  +
    Ok(
          18  +
        /* HttpBoundProtocolPayloadGenerator.kt:377 */
          19  +
        payload.into_inner(), /* HttpBoundProtocolPayloadGenerator.kt:345 */
          20  +
    )
          21  +
    /* HttpBoundProtocolPayloadGenerator.kt:311 */
   10     22   
}

tmp-codegen-diff/codegen-server-test-python/constraints/rust-server-codegen-python/src/protocol_serde/shape_query_params_targeting_length_map_operation.rs

@@ -1,1 +133,192 @@
    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_length_map_operation_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::QueryParamsTargetingLengthMapOperationInput,
    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_length_map_operation_input_internal::Builder::default();
          21  +
        /* ServerHttpBoundProtocolGenerator.kt:723 */let mut input = crate::input::query_params_targeting_length_map_operation_input_internal::Builder::default();
          22  +
        /* RustType.kt:516 */
   18     23   
        #[allow(unused_variables)]
          24  +
        /* ServerHttpBoundProtocolGenerator.kt:728 */
   19     25   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     26   
            uri, headers, body, ..
   21     27   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          28  +
        /* ServerHttpBoundProtocolGenerator.kt: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::con_b_map_unconstrained::ConBMapUnconstrained =
   25         -
            crate::unconstrained::con_b_map_unconstrained::ConBMapUnconstrained(
   26         -
                ::std::collections::HashMap::new(),
   27         -
            );
          33  +
            /* ServerHttpBoundProtocolGenerator.kt:1089 */crate::unconstrained::con_b_map_unconstrained::ConBMapUnconstrained(
          34  +
                /* ServerHttpBoundProtocolGenerator.kt:1090 */::std::collections::HashMap::new()
          35  +
            /* ServerHttpBoundProtocolGenerator.kt:1089 */)
          36  +
        /* ServerHttpBoundProtocolGenerator.kt:1088 */;
          37  +
        /* ServerHttpBoundProtocolGenerator.kt:1105 */
   28     38   
        for (k, v) in pairs {
          39  +
            /* ServerHttpBoundProtocolGenerator.kt:1180 */
   29     40   
            query_params
   30     41   
                .0
   31     42   
                .entry(String::from(k))
   32     43   
                .or_insert_with(|| String::from(v));
          44  +
            /* ServerHttpBoundProtocolGenerator.kt:1105 */
   33     45   
        }
   34         -
        input = input.set_length_map(Some(query_params));
          46  +
        /* ServerHttpBoundProtocolGenerator.kt:1213 */
          47  +
        input = input.set_length_map(
          48  +
            /* ServerHttpBoundProtocolGenerator.kt:1214 */
          49  +
            Some(
          50  +
                /* ServerHttpBoundProtocolGenerator.kt:1215 */
          51  +
                query_params, /* ServerHttpBoundProtocolGenerator.kt:1214 */
          52  +
            ), /* ServerHttpBoundProtocolGenerator.kt:1213 */
          53  +
        );
          54  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   35     55   
        input.build()?
          56  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   36     57   
    })
          58  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   37     59   
}
   38     60   
          61  +
/* RustType.kt:516 */
   39     62   
#[allow(clippy::unnecessary_wraps)]
          63  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   40     64   
pub fn ser_query_params_targeting_length_map_operation_http_response(
   41     65   
    #[allow(unused_variables)] output: crate::output::QueryParamsTargetingLengthMapOperationOutput,
   42     66   
) -> std::result::Result<
   43     67   
    ::aws_smithy_http_server::response::Response,
   44     68   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   45     69   
> {
          70  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   46     71   
    Ok({
          72  +
        /* RustType.kt:516 */
   47     73   
        #[allow(unused_mut)]
          74  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   48     75   
        let mut builder = ::http::Response::builder();
          76  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   49     77   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   50     78   
            builder,
   51     79   
            ::http::header::CONTENT_TYPE,
   52     80   
            "application/json",
   53     81   
        );
          82  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   54     83   
        let http_status: u16 = 200;
   55     84   
        builder = builder.status(http_status);
          85  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
   56     86   
        let payload =
   57         -
            crate::protocol_serde::shape_query_params_targeting_length_map_operation_output::ser_query_params_targeting_length_map_operation_output_output_output(&output)?
   58         -
        ;
          87  +
            /* HttpBoundProtocolPayloadGenerator.kt:237 */crate::protocol_serde::shape_query_params_targeting_length_map_operation_output::ser_query_params_targeting_length_map_operation_output_output_output(&output)?
          88  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
          89  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   59     90   
        let content_length = payload.len();
   60     91   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   61     92   
            builder,
   62     93   
            ::http::header::CONTENT_LENGTH,
   63     94   
            content_length,
   64     95   
        );
          96  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   65     97   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          98  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   66     99   
        builder.body(body)?
         100  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   67    101   
    })
         102  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   68    103   
}
   69    104   
         105  +
/* RustType.kt:516 */
   70    106   
#[allow(clippy::unnecessary_wraps)]
         107  +
/* ServerHttpBoundProtocolGenerator.kt:447 */
   71    108   
pub fn ser_query_params_targeting_length_map_operation_http_error(
   72    109   
    error: &crate::error::QueryParamsTargetingLengthMapOperationError,
   73    110   
) -> std::result::Result<
   74    111   
    ::aws_smithy_http_server::response::Response,
   75    112   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   76    113   
> {
         114  +
    /* ServerHttpBoundProtocolGenerator.kt:452 */
   77    115   
    Ok({
         116  +
        /* ServerHttpBoundProtocolGenerator.kt:468 */
   78    117   
        match error {
         118  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
   79    119   
            crate::error::QueryParamsTargetingLengthMapOperationError::ValidationException(
   80    120   
                output,
   81    121   
            ) => {
         122  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
   82    123   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
         124  +
                /* RustType.kt:516 */
   83    125   
                #[allow(unused_mut)]
         126  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
   84    127   
                let mut builder = ::http::Response::builder();
         128  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   85    129   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   86    130   
                    builder,
   87    131   
                    ::http::header::CONTENT_TYPE,
   88    132   
                    "application/json",
   89    133   
                );
         134  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   90    135   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   91    136   
                    builder,
   92    137   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
   93    138   
                    "ValidationException",
   94    139   
                );
         140  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
   95    141   
                let content_length = payload.len();
   96    142   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   97    143   
                    builder,
   98    144   
                    ::http::header::CONTENT_LENGTH,
   99    145   
                    content_length,
  100    146   
                );
         147  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  101    148   
                builder
  102    149   
                    .status(400)
  103    150   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         151  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
  104    152   
            }
         153  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
  105    154   
            crate::error::QueryParamsTargetingLengthMapOperationError::InternalServerError(
  106    155   
                output,
  107    156   
            ) => {
         157  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
  108    158   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
         159  +
                /* RustType.kt:516 */
  109    160   
                #[allow(unused_mut)]
         161  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
  110    162   
                let mut builder = ::http::Response::builder();
         163  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  111    164   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  112    165   
                    builder,
  113    166   
                    ::http::header::CONTENT_TYPE,
  114    167   
                    "application/json",
  115    168   
                );
         169  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  116    170   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  117    171   
                    builder,
  118    172   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  119    173   
                    "InternalServerError",
  120    174   
                );
         175  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  121    176   
                let content_length = payload.len();
  122    177   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  123    178   
                    builder,
  124    179   
                    ::http::header::CONTENT_LENGTH,
  125    180   
                    content_length,
  126    181   
                );
         182  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  127    183   
                builder
  128    184   
                    .status(500)
  129    185   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         186  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
         187  +
            } /* ServerHttpBoundProtocolGenerator.kt:468 */
  130    188   
        }
  131         -
        }
         189  +
        /* ServerHttpBoundProtocolGenerator.kt:452 */
  132    190   
    })
         191  +
    /* ServerHttpBoundProtocolGenerator.kt:447 */
  133    192   
}

tmp-codegen-diff/codegen-server-test-python/constraints/rust-server-codegen-python/src/protocol_serde/shape_query_params_targeting_length_map_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_length_map_operation_output_output_output(
    3      4   
    value: &crate::output::QueryParamsTargetingLengthMapOperationOutput,
    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_length_map_operation_output::ser_query_params_targeting_length_map_operation_output_output(&mut object, value)?;
          11  +
    /* JsonSerializerGenerator.kt:227 */
    8     12   
    object.finish();
    9     13   
    Ok(out)
          14  +
    /* JsonSerializerGenerator.kt:213 */
   10     15   
}
   11     16   
          17  +
/* JsonSerializerGenerator.kt:358 */
   12     18   
pub fn ser_query_params_targeting_length_map_operation_output_output(
   13     19   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   14     20   
    input: &crate::output::QueryParamsTargetingLengthMapOperationOutput,
   15     21   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          22  +
    /* JsonSerializerGenerator.kt:382 */
   16     23   
    if let Some(var_1) = &input.length_map {
          24  +
        /* JsonSerializerGenerator.kt:495 */
   17     25   
        #[allow(unused_mut)]
          26  +
        /* JsonSerializerGenerator.kt:496 */
   18     27   
        let mut object_2 = object.key("lengthMap").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/rust-server-codegen-python/src/protocol_serde/shape_query_params_targeting_map_of_enum_string_operation.rs

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