Server Test Python

Server Test Python

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943 (ignoring whitespace)

Files changed:

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

@@ -182,182 +299,303 @@
  202    202   
pub(crate) mod shape_unit_input_and_output;
  203    203   
  204    204   
pub(crate) mod shape_all_query_string_types_input;
  205    205   
  206    206   
pub(crate) mod shape_complex_error;
  207    207   
  208    208   
pub(crate) mod shape_constant_and_variable_query_string_input;
  209    209   
  210    210   
pub(crate) mod shape_constant_query_string_input;
  211    211   
         212  +
/* JsonParserGenerator.kt:227 */
  212    213   
pub(crate) fn or_empty_doc(data: &[u8]) -> &[u8] {
  213    214   
    if data.is_empty() {
  214    215   
        b"{}"
  215    216   
    } else {
  216    217   
        data
  217    218   
    }
  218    219   
}
  219    220   
  220    221   
pub(crate) mod shape_content_type_parameters_output;
  221    222   
  222    223   
pub(crate) mod shape_datetime_offsets_output;
  223    224   
  224    225   
pub(crate) mod shape_document_type_as_map_value_output;
  225    226   
  226    227   
pub(crate) mod shape_document_type_as_payload_input;
  227    228   
         229  +
/* JsonSerializerGenerator.kt:303 */
  228    230   
pub fn serialize_document(input: &::aws_smithy_types::Document) -> ::std::vec::Vec<u8> {
  229    231   
    let mut out = String::new();
  230    232   
    ::aws_smithy_json::serialize::JsonValueWriter::new(&mut out).document(input);
  231    233   
    out.into_bytes()
  232    234   
}
  233    235   
  234    236   
pub(crate) mod shape_document_type_as_payload_output;
  235    237   
  236    238   
pub(crate) mod shape_document_type_output;
  237    239   
  238    240   
pub(crate) mod shape_empty_input_and_empty_output_output;
  239    241   
  240    242   
pub(crate) mod shape_foo_error;
  241    243   
  242    244   
pub(crate) mod shape_fractional_seconds_output;
  243    245   
  244    246   
pub(crate) mod shape_greeting_with_errors_output;
  245    247   
  246    248   
pub(crate) mod shape_http_checksum_required_output;
  247    249   
  248    250   
pub(crate) mod shape_http_enum_payload_input;
  249    251   
  250    252   
pub(crate) mod shape_http_enum_payload_output;
  251    253   
  252    254   
pub(crate) mod shape_http_payload_traits_input;
  253    255   
  254    256   
pub(crate) mod shape_http_payload_traits_output;
  255    257   
  256    258   
pub(crate) mod shape_http_payload_traits_with_media_type_input;
  257    259   
  258    260   
pub(crate) mod shape_http_payload_traits_with_media_type_output;
  259    261   
  260    262   
pub(crate) mod shape_http_payload_with_structure_input;
  261    263   
         264  +
/* JsonSerializerGenerator.kt:260 */
  262    265   
pub fn rest_json_unset_struct_payload() -> ::std::vec::Vec<u8> {
  263    266   
    b"{}"[..].into()
  264    267   
}
  265    268   
  266    269   
pub(crate) mod shape_http_payload_with_structure_output;
  267    270   
  268    271   
pub(crate) mod shape_http_payload_with_union_input;
  269    272   
         273  +
/* JsonSerializerGenerator.kt:272 */
  270    274   
pub fn rest_json_unset_union_payload() -> ::std::vec::Vec<u8> {
  271    275   
    ::std::vec::Vec::new()
  272    276   
}
  273    277   
  274    278   
pub(crate) mod shape_http_payload_with_union_output;
  275    279   
  276    280   
pub(crate) mod shape_http_prefix_headers_in_response_output;
  277    281   
  278    282   
pub(crate) mod shape_http_prefix_headers_input;
  279    283   

tmp-codegen-diff/codegen-server-test-python/rest_json/rust-server-codegen-python/src/protocol_serde/shape_all_query_string_types.rs

@@ -1,1 +288,499 @@
    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_all_query_string_types_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::AllQueryStringTypesInput,
    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 = crate::input::all_query_string_types_input_internal::Builder::default();
          23  +
        /* RustType.kt:516 */
   18     24   
        #[allow(unused_variables)]
          25  +
        /* ServerHttpBoundProtocolGenerator.kt:728 */
   19     26   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     27   
            uri, headers, body, ..
   21     28   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          29  +
        /* ServerHttpBoundProtocolGenerator.kt:1073 */
   22     30   
        let query_string = uri.query().unwrap_or("");
   23     31   
        let pairs = ::form_urlencoded::parse(query_string.as_bytes());
   24         -
        let mut query_params: ::std::collections::HashMap<
   25         -
            ::std::string::String,
   26         -
            ::std::vec::Vec<::std::string::String>,
   27         -
        > = ::std::collections::HashMap::new();
          32  +
        /* ServerHttpBoundProtocolGenerator.kt:1088 */
          33  +
        let mut query_params: ::std::collections::HashMap::<::std::string::String, ::std::vec::Vec::<::std::string::String>> =
          34  +
            /* ServerHttpBoundProtocolGenerator.kt:1090 */::std::collections::HashMap::new()
          35  +
        /* ServerHttpBoundProtocolGenerator.kt:1088 */;
          36  +
        /* ServerHttpBoundProtocolGenerator.kt:1099 */
   28     37   
        let mut query_boolean_seen = false;
          38  +
        /* ServerHttpBoundProtocolGenerator.kt:1099 */
   29     39   
        let mut query_byte_seen = false;
          40  +
        /* ServerHttpBoundProtocolGenerator.kt:1099 */
   30     41   
        let mut query_double_seen = false;
          42  +
        /* ServerHttpBoundProtocolGenerator.kt:1099 */
   31     43   
        let mut query_enum_seen = false;
          44  +
        /* ServerHttpBoundProtocolGenerator.kt:1099 */
   32     45   
        let mut query_float_seen = false;
          46  +
        /* ServerHttpBoundProtocolGenerator.kt:1099 */
   33     47   
        let mut query_integer_seen = false;
          48  +
        /* ServerHttpBoundProtocolGenerator.kt:1099 */
   34     49   
        let mut query_integer_enum_seen = false;
          50  +
        /* ServerHttpBoundProtocolGenerator.kt:1099 */
   35     51   
        let mut query_long_seen = false;
          52  +
        /* ServerHttpBoundProtocolGenerator.kt:1099 */
   36     53   
        let mut query_short_seen = false;
          54  +
        /* ServerHttpBoundProtocolGenerator.kt:1099 */
   37     55   
        let mut query_string_seen = false;
          56  +
        /* ServerHttpBoundProtocolGenerator.kt:1099 */
   38     57   
        let mut query_timestamp_seen = false;
          58  +
        /* ServerHttpBoundProtocolGenerator.kt:1102 */
   39     59   
        let mut query_boolean_list = Vec::new();
          60  +
        /* ServerHttpBoundProtocolGenerator.kt:1102 */
   40     61   
        let mut query_double_list = Vec::new();
          62  +
        /* ServerHttpBoundProtocolGenerator.kt:1102 */
   41     63   
        let mut query_enum_list = Vec::new();
          64  +
        /* ServerHttpBoundProtocolGenerator.kt:1102 */
   42     65   
        let mut query_integer_enum_list = Vec::new();
          66  +
        /* ServerHttpBoundProtocolGenerator.kt:1102 */
   43     67   
        let mut query_integer_list = Vec::new();
          68  +
        /* ServerHttpBoundProtocolGenerator.kt:1102 */
   44     69   
        let mut query_integer_set = Vec::new();
          70  +
        /* ServerHttpBoundProtocolGenerator.kt:1102 */
   45     71   
        let mut query_string_list = Vec::new();
          72  +
        /* ServerHttpBoundProtocolGenerator.kt:1102 */
   46     73   
        let mut query_string_set = Vec::new();
          74  +
        /* ServerHttpBoundProtocolGenerator.kt:1102 */
   47     75   
        let mut query_timestamp_list = Vec::new();
          76  +
        /* ServerHttpBoundProtocolGenerator.kt:1105 */
   48     77   
        for (k, v) in pairs {
          78  +
            /* ServerHttpBoundProtocolGenerator.kt:1109 */
   49     79   
            if !query_boolean_seen && k == "Boolean" {
   50     80   
                input = input.set_query_boolean(
   51     81   
                    crate::protocol_serde::shape_all_query_string_types_input::de_query_boolean(
   52     82   
                        &v,
   53     83   
                    )?,
   54     84   
                );
   55     85   
                query_boolean_seen = true;
   56     86   
            }
          87  +
            /* ServerHttpBoundProtocolGenerator.kt:1109 */
   57     88   
            if !query_byte_seen && k == "Byte" {
   58     89   
                input = input.set_query_byte(
   59     90   
                    crate::protocol_serde::shape_all_query_string_types_input::de_query_byte(&v)?,
   60     91   
                );
   61     92   
                query_byte_seen = true;
   62     93   
            }
          94  +
            /* ServerHttpBoundProtocolGenerator.kt:1109 */
   63     95   
            if !query_double_seen && k == "Double" {
   64     96   
                input = input.set_query_double(
   65     97   
                    crate::protocol_serde::shape_all_query_string_types_input::de_query_double(&v)?,
   66     98   
                );
   67     99   
                query_double_seen = true;
   68    100   
            }
         101  +
            /* ServerHttpBoundProtocolGenerator.kt:1109 */
   69    102   
            if !query_enum_seen && k == "Enum" {
   70    103   
                input = input.set_query_enum(
   71    104   
                    crate::protocol_serde::shape_all_query_string_types_input::de_query_enum(&v)?,
   72    105   
                );
   73    106   
                query_enum_seen = true;
   74    107   
            }
         108  +
            /* ServerHttpBoundProtocolGenerator.kt:1109 */
   75    109   
            if !query_float_seen && k == "Float" {
   76    110   
                input = input.set_query_float(
   77    111   
                    crate::protocol_serde::shape_all_query_string_types_input::de_query_float(&v)?,
   78    112   
                );
   79    113   
                query_float_seen = true;
   80    114   
            }
         115  +
            /* ServerHttpBoundProtocolGenerator.kt:1109 */
   81    116   
            if !query_integer_seen && k == "Integer" {
   82    117   
                input = input.set_query_integer(
   83    118   
                    crate::protocol_serde::shape_all_query_string_types_input::de_query_integer(
   84    119   
                        &v,
   85    120   
                    )?,
   86    121   
                );
   87    122   
                query_integer_seen = true;
   88    123   
            }
         124  +
            /* ServerHttpBoundProtocolGenerator.kt:1109 */
   89    125   
            if !query_integer_enum_seen && k == "IntegerEnum" {
   90    126   
                input = input.set_query_integer_enum(
   91    127   
                    crate::protocol_serde::shape_all_query_string_types_input::de_query_integer_enum(&v)?
   92    128   
                );
   93    129   
                query_integer_enum_seen = true;
   94    130   
            }
         131  +
            /* ServerHttpBoundProtocolGenerator.kt:1109 */
   95    132   
            if !query_long_seen && k == "Long" {
   96    133   
                input = input.set_query_long(
   97    134   
                    crate::protocol_serde::shape_all_query_string_types_input::de_query_long(&v)?,
   98    135   
                );
   99    136   
                query_long_seen = true;
  100    137   
            }
         138  +
            /* ServerHttpBoundProtocolGenerator.kt:1109 */
  101    139   
            if !query_short_seen && k == "Short" {
  102    140   
                input = input.set_query_short(
  103    141   
                    crate::protocol_serde::shape_all_query_string_types_input::de_query_short(&v)?,
  104    142   
                );
  105    143   
                query_short_seen = true;
  106    144   
            }
         145  +
            /* ServerHttpBoundProtocolGenerator.kt:1109 */
  107    146   
            if !query_string_seen && k == "String" {
  108    147   
                input = input.set_query_string(
  109    148   
                    crate::protocol_serde::shape_all_query_string_types_input::de_query_string(&v)?,
  110    149   
                );
  111    150   
                query_string_seen = true;
  112    151   
            }
         152  +
            /* ServerHttpBoundProtocolGenerator.kt:1109 */
  113    153   
            if !query_timestamp_seen && k == "Timestamp" {
  114    154   
                input = input.set_query_timestamp(
  115    155   
                    crate::protocol_serde::shape_all_query_string_types_input::de_query_timestamp(
  116    156   
                        &v,
  117    157   
                    )?,
  118    158   
                );
  119    159   
                query_timestamp_seen = true;
  120    160   
            }
         161  +
            /* ServerHttpBoundProtocolGenerator.kt:1122 */
  121    162   
            if k == "BooleanList" {
         163  +
                /* ServerHttpBoundProtocolGenerator.kt:1159 */
  122    164   
                let v = <_ as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(&v)?;
         165  +
                /* ServerHttpBoundProtocolGenerator.kt:1168 */
  123    166   
                query_boolean_list.push(v);
  124         -
            } else if k == "DoubleList" {
         167  +
            /* ServerHttpBoundProtocolGenerator.kt:1122 */
         168  +
            }
         169  +
            /* ServerHttpBoundProtocolGenerator.kt:1122 */
         170  +
            else if k == "DoubleList" {
         171  +
                /* ServerHttpBoundProtocolGenerator.kt:1159 */
  125    172   
                let v = <_ as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(&v)?;
         173  +
                /* ServerHttpBoundProtocolGenerator.kt:1168 */
  126    174   
                query_double_list.push(v);
  127         -
            } else if k == "EnumList" {
         175  +
            /* ServerHttpBoundProtocolGenerator.kt:1122 */
         176  +
            }
         177  +
            /* ServerHttpBoundProtocolGenerator.kt:1122 */
         178  +
            else if k == "EnumList" {
         179  +
                /* ServerHttpBoundProtocolGenerator.kt:1132 */
  128    180   
                let v = v.clone().into_owned();
         181  +
                /* ServerHttpBoundProtocolGenerator.kt:1168 */
  129    182   
                query_enum_list.push(v);
  130         -
            } else if k == "IntegerEnumList" {
         183  +
            /* ServerHttpBoundProtocolGenerator.kt:1122 */
         184  +
            }
         185  +
            /* ServerHttpBoundProtocolGenerator.kt:1122 */
         186  +
            else if k == "IntegerEnumList" {
         187  +
                /* ServerHttpBoundProtocolGenerator.kt:1159 */
  131    188   
                let v = <_ as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(&v)?;
         189  +
                /* ServerHttpBoundProtocolGenerator.kt:1168 */
  132    190   
                query_integer_enum_list.push(v);
  133         -
            } else if k == "IntegerList" {
         191  +
            /* ServerHttpBoundProtocolGenerator.kt:1122 */
         192  +
            }
         193  +
            /* ServerHttpBoundProtocolGenerator.kt:1122 */
         194  +
            else if k == "IntegerList" {
         195  +
                /* ServerHttpBoundProtocolGenerator.kt:1159 */
  134    196   
                let v = <_ as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(&v)?;
         197  +
                /* ServerHttpBoundProtocolGenerator.kt:1168 */
  135    198   
                query_integer_list.push(v);
  136         -
            } else if k == "IntegerSet" {
         199  +
            /* ServerHttpBoundProtocolGenerator.kt:1122 */
         200  +
            }
         201  +
            /* ServerHttpBoundProtocolGenerator.kt:1122 */
         202  +
            else if k == "IntegerSet" {
         203  +
                /* ServerHttpBoundProtocolGenerator.kt:1159 */
  137    204   
                let v = <_ as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(&v)?;
         205  +
                /* ServerHttpBoundProtocolGenerator.kt:1168 */
  138    206   
                query_integer_set.push(v);
  139         -
            } else if k == "StringList" {
         207  +
            /* ServerHttpBoundProtocolGenerator.kt:1122 */
         208  +
            }
         209  +
            /* ServerHttpBoundProtocolGenerator.kt:1122 */
         210  +
            else if k == "StringList" {
         211  +
                /* ServerHttpBoundProtocolGenerator.kt:1132 */
  140    212   
                let v = v.clone().into_owned();
         213  +
                /* ServerHttpBoundProtocolGenerator.kt:1168 */
  141    214   
                query_string_list.push(v);
  142         -
            } else if k == "StringSet" {
         215  +
            /* ServerHttpBoundProtocolGenerator.kt:1122 */
         216  +
            }
         217  +
            /* ServerHttpBoundProtocolGenerator.kt:1122 */
         218  +
            else if k == "StringSet" {
         219  +
                /* ServerHttpBoundProtocolGenerator.kt:1132 */
  143    220   
                let v = v.clone().into_owned();
         221  +
                /* ServerHttpBoundProtocolGenerator.kt:1168 */
  144    222   
                query_string_set.push(v);
  145         -
            } else if k == "TimestampList" {
  146         -
                let v = ::aws_smithy_types::DateTime::from_str(
  147         -
                    &v,
  148         -
                    ::aws_smithy_types::date_time::Format::DateTime,
  149         -
                )?
  150         -
                .into();
         223  +
            /* ServerHttpBoundProtocolGenerator.kt:1122 */
         224  +
            }
         225  +
            /* ServerHttpBoundProtocolGenerator.kt:1122 */
         226  +
            else if k == "TimestampList" {
         227  +
                /* ServerHttpBoundProtocolGenerator.kt:1146 */
         228  +
                let v = ::aws_smithy_types::DateTime::from_str(&v, ::aws_smithy_types::date_time::Format::DateTime)?
         229  +
                /* PythonServerProtocolLoader.kt:68 */.into()
         230  +
                /* ServerHttpBoundProtocolGenerator.kt:1156 */;
         231  +
                /* ServerHttpBoundProtocolGenerator.kt:1168 */
  151    232   
                query_timestamp_list.push(v);
         233  +
                /* ServerHttpBoundProtocolGenerator.kt:1122 */
  152    234   
            }
         235  +
            /* ServerHttpBoundProtocolGenerator.kt:1197 */
  153    236   
            let entry = query_params.entry(String::from(k)).or_default();
  154    237   
            entry.push(String::from(v));
         238  +
            /* ServerHttpBoundProtocolGenerator.kt:1105 */
  155    239   
        }
  156         -
        input = input.set_query_params_map_of_string_list(Some(query_params));
         240  +
        /* ServerHttpBoundProtocolGenerator.kt:1213 */
         241  +
        input = input.set_query_params_map_of_string_list(
         242  +
            /* ServerHttpBoundProtocolGenerator.kt:1214 */
         243  +
            Some(
         244  +
                /* ServerHttpBoundProtocolGenerator.kt:1215 */
         245  +
                query_params, /* ServerHttpBoundProtocolGenerator.kt:1214 */
         246  +
            ), /* ServerHttpBoundProtocolGenerator.kt:1213 */
         247  +
        );
         248  +
        /* ServerHttpBoundProtocolGenerator.kt:1228 */
  157    249   
        if !query_boolean_list.is_empty() {
  158         -
            input = input.set_query_boolean_list(Some(query_boolean_list));
         250  +
            /* ServerHttpBoundProtocolGenerator.kt:1229 */
         251  +
            input = input.set_query_boolean_list(
         252  +
                /* ServerHttpBoundProtocolGenerator.kt:1235 */
         253  +
                Some(
         254  +
                    /* ServerHttpBoundProtocolGenerator.kt:1244 */
         255  +
                    query_boolean_list, /* ServerHttpBoundProtocolGenerator.kt:1235 */
         256  +
                ), /* ServerHttpBoundProtocolGenerator.kt:1229 */
         257  +
            );
         258  +
            /* ServerHttpBoundProtocolGenerator.kt:1228 */
  159    259   
        }
         260  +
        /* ServerHttpBoundProtocolGenerator.kt:1228 */
  160    261   
        if !query_double_list.is_empty() {
  161         -
            input = input.set_query_double_list(Some(query_double_list));
         262  +
            /* ServerHttpBoundProtocolGenerator.kt:1229 */
         263  +
            input = input.set_query_double_list(
         264  +
                /* ServerHttpBoundProtocolGenerator.kt:1235 */
         265  +
                Some(
         266  +
                    /* ServerHttpBoundProtocolGenerator.kt:1244 */
         267  +
                    query_double_list, /* ServerHttpBoundProtocolGenerator.kt:1235 */
         268  +
                ), /* ServerHttpBoundProtocolGenerator.kt:1229 */
         269  +
            );
         270  +
            /* ServerHttpBoundProtocolGenerator.kt:1228 */
  162    271   
        }
         272  +
        /* ServerHttpBoundProtocolGenerator.kt:1228 */
  163    273   
        if !query_enum_list.is_empty() {
  164         -
            input = input.set_query_enum_list(Some(
         274  +
            /* ServerHttpBoundProtocolGenerator.kt:1229 */
         275  +
            input = input.set_query_enum_list(
         276  +
                /* ServerHttpBoundProtocolGenerator.kt:1235 */
         277  +
                Some(
         278  +
                    /* ServerHttpBoundProtocolGenerator.kt:1236 */
  165    279   
                    crate::unconstrained::foo_enum_list_unconstrained::FooEnumListUnconstrained(
  166         -
                    query_enum_list,
  167         -
                ),
  168         -
            ));
         280  +
                        /* ServerHttpBoundProtocolGenerator.kt:1244 */
         281  +
                        query_enum_list, /* ServerHttpBoundProtocolGenerator.kt:1236 */
         282  +
                    ), /* ServerHttpBoundProtocolGenerator.kt:1235 */
         283  +
                ), /* ServerHttpBoundProtocolGenerator.kt:1229 */
         284  +
            );
         285  +
            /* ServerHttpBoundProtocolGenerator.kt:1228 */
  169    286   
        }
         287  +
        /* ServerHttpBoundProtocolGenerator.kt:1228 */
  170    288   
        if !query_integer_enum_list.is_empty() {
  171         -
            input = input.set_query_integer_enum_list(Some(query_integer_enum_list));
         289  +
            /* ServerHttpBoundProtocolGenerator.kt:1229 */
         290  +
            input = input.set_query_integer_enum_list(
         291  +
                /* ServerHttpBoundProtocolGenerator.kt:1235 */
         292  +
                Some(
         293  +
                    /* ServerHttpBoundProtocolGenerator.kt:1244 */
         294  +
                    query_integer_enum_list, /* ServerHttpBoundProtocolGenerator.kt:1235 */
         295  +
                ), /* ServerHttpBoundProtocolGenerator.kt:1229 */
         296  +
            );
         297  +
            /* ServerHttpBoundProtocolGenerator.kt:1228 */
  172    298   
        }
         299  +
        /* ServerHttpBoundProtocolGenerator.kt:1228 */
  173    300   
        if !query_integer_list.is_empty() {
  174         -
            input = input.set_query_integer_list(Some(query_integer_list));
         301  +
            /* ServerHttpBoundProtocolGenerator.kt:1229 */
         302  +
            input = input.set_query_integer_list(
         303  +
                /* ServerHttpBoundProtocolGenerator.kt:1235 */
         304  +
                Some(
         305  +
                    /* ServerHttpBoundProtocolGenerator.kt:1244 */
         306  +
                    query_integer_list, /* ServerHttpBoundProtocolGenerator.kt:1235 */
         307  +
                ), /* ServerHttpBoundProtocolGenerator.kt:1229 */
         308  +
            );
         309  +
            /* ServerHttpBoundProtocolGenerator.kt:1228 */
  175    310   
        }
         311  +
        /* ServerHttpBoundProtocolGenerator.kt:1228 */
  176    312   
        if !query_integer_set.is_empty() {
  177         -
            input = input.set_query_integer_set(Some(
         313  +
            /* ServerHttpBoundProtocolGenerator.kt:1229 */
         314  +
            input = input.set_query_integer_set(
         315  +
                /* ServerHttpBoundProtocolGenerator.kt:1235 */
         316  +
                Some(
         317  +
                    /* ServerHttpBoundProtocolGenerator.kt:1236 */
  178    318   
                    crate::unconstrained::integer_set_unconstrained::IntegerSetUnconstrained(
  179         -
                    query_integer_set,
  180         -
                ),
  181         -
            ));
         319  +
                        /* ServerHttpBoundProtocolGenerator.kt:1244 */
         320  +
                        query_integer_set, /* ServerHttpBoundProtocolGenerator.kt:1236 */
         321  +
                    ), /* ServerHttpBoundProtocolGenerator.kt:1235 */
         322  +
                ), /* ServerHttpBoundProtocolGenerator.kt:1229 */
         323  +
            );
         324  +
            /* ServerHttpBoundProtocolGenerator.kt:1228 */
  182    325   
        }
         326  +
        /* ServerHttpBoundProtocolGenerator.kt:1228 */
  183    327   
        if !query_string_list.is_empty() {
  184         -
            input = input.set_query_string_list(Some(query_string_list));
         328  +
            /* ServerHttpBoundProtocolGenerator.kt:1229 */
         329  +
            input = input.set_query_string_list(
         330  +
                /* ServerHttpBoundProtocolGenerator.kt:1235 */
         331  +
                Some(
         332  +
                    /* ServerHttpBoundProtocolGenerator.kt:1244 */
         333  +
                    query_string_list, /* ServerHttpBoundProtocolGenerator.kt:1235 */
         334  +
                ), /* ServerHttpBoundProtocolGenerator.kt:1229 */
         335  +
            );
         336  +
            /* ServerHttpBoundProtocolGenerator.kt:1228 */
  185    337   
        }
         338  +
        /* ServerHttpBoundProtocolGenerator.kt:1228 */
  186    339   
        if !query_string_set.is_empty() {
  187         -
            input = input.set_query_string_set(Some(
         340  +
            /* ServerHttpBoundProtocolGenerator.kt:1229 */
         341  +
            input = input.set_query_string_set(
         342  +
                /* ServerHttpBoundProtocolGenerator.kt:1235 */
         343  +
                Some(
         344  +
                    /* ServerHttpBoundProtocolGenerator.kt:1236 */
  188    345   
                    crate::unconstrained::string_set_unconstrained::StringSetUnconstrained(
  189         -
                    query_string_set,
  190         -
                ),
  191         -
            ));
         346  +
                        /* ServerHttpBoundProtocolGenerator.kt:1244 */
         347  +
                        query_string_set, /* ServerHttpBoundProtocolGenerator.kt:1236 */
         348  +
                    ), /* ServerHttpBoundProtocolGenerator.kt:1235 */
         349  +
                ), /* ServerHttpBoundProtocolGenerator.kt:1229 */
         350  +
            );
         351  +
            /* ServerHttpBoundProtocolGenerator.kt:1228 */
  192    352   
        }
         353  +
        /* ServerHttpBoundProtocolGenerator.kt:1228 */
  193    354   
        if !query_timestamp_list.is_empty() {
  194         -
            input = input.set_query_timestamp_list(Some(query_timestamp_list));
         355  +
            /* ServerHttpBoundProtocolGenerator.kt:1229 */
         356  +
            input = input.set_query_timestamp_list(
         357  +
                /* ServerHttpBoundProtocolGenerator.kt:1235 */
         358  +
                Some(
         359  +
                    /* ServerHttpBoundProtocolGenerator.kt:1244 */
         360  +
                    query_timestamp_list, /* ServerHttpBoundProtocolGenerator.kt:1235 */
         361  +
                ), /* ServerHttpBoundProtocolGenerator.kt:1229 */
         362  +
            );
         363  +
            /* ServerHttpBoundProtocolGenerator.kt:1228 */
  195    364   
        }
         365  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
  196    366   
        input.build()?
         367  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
  197    368   
    })
         369  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
  198    370   
}
  199    371   
         372  +
/* RustType.kt:516 */
  200    373   
#[allow(clippy::unnecessary_wraps)]
         374  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
  201    375   
pub fn ser_all_query_string_types_http_response(
  202    376   
    #[allow(unused_variables)] output: crate::output::AllQueryStringTypesOutput,
  203    377   
) -> std::result::Result<
  204    378   
    ::aws_smithy_http_server::response::Response,
  205    379   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
  206    380   
> {
         381  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
  207    382   
    Ok({
         383  +
        /* RustType.kt:516 */
  208    384   
        #[allow(unused_mut)]
         385  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
  209    386   
        let mut builder = ::http::Response::builder();
         387  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
  210    388   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
  211    389   
            builder,
  212    390   
            ::http::header::CONTENT_TYPE,
  213    391   
            "application/json",
  214    392   
        );
         393  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
  215    394   
        let http_status: u16 = 200;
  216    395   
        builder = builder.status(http_status);
  217         -
        let payload = "";
         396  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
         397  +
        let payload =
         398  +
            /* HttpBoundProtocolPayloadGenerator.kt:235 */""
         399  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
         400  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
  218    401   
        let content_length = payload.len();
  219    402   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
  220    403   
            builder,
  221    404   
            ::http::header::CONTENT_LENGTH,
  222    405   
            content_length,
  223    406   
        );
         407  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
  224    408   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
         409  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
  225    410   
        builder.body(body)?
         411  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
  226    412   
    })
         413  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
  227    414   
}
  228    415   
         416  +
/* RustType.kt:516 */
  229    417   
#[allow(clippy::unnecessary_wraps)]
         418  +
/* ServerHttpBoundProtocolGenerator.kt:447 */
  230    419   
pub fn ser_all_query_string_types_http_error(
  231    420   
    error: &crate::error::AllQueryStringTypesError,
  232    421   
) -> std::result::Result<
  233    422   
    ::aws_smithy_http_server::response::Response,
  234    423   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
  235    424   
> {
         425  +
    /* ServerHttpBoundProtocolGenerator.kt:452 */
  236    426   
    Ok({
         427  +
        /* ServerHttpBoundProtocolGenerator.kt:468 */
  237    428   
        match error {
         429  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
  238    430   
            crate::error::AllQueryStringTypesError::ValidationException(output) => {
         431  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
  239    432   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
         433  +
                /* RustType.kt:516 */
  240    434   
                #[allow(unused_mut)]
         435  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
  241    436   
                let mut builder = ::http::Response::builder();
         437  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  242    438   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  243    439   
                    builder,
  244    440   
                    ::http::header::CONTENT_TYPE,
  245    441   
                    "application/json",
  246    442   
                );
         443  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  247    444   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  248    445   
                    builder,
  249    446   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  250    447   
                    "ValidationException",
  251    448   
                );
         449  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  252    450   
                let content_length = payload.len();
  253    451   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  254    452   
                    builder,
  255    453   
                    ::http::header::CONTENT_LENGTH,
  256    454   
                    content_length,
  257    455   
                );
         456  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  258    457   
                builder
  259    458   
                    .status(400)
  260    459   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         460  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
  261    461   
            }
         462  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
  262    463   
            crate::error::AllQueryStringTypesError::InternalServerError(output) => {
         464  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
  263    465   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
         466  +
                /* RustType.kt:516 */
  264    467   
                #[allow(unused_mut)]
         468  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
  265    469   
                let mut builder = ::http::Response::builder();
         470  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  266    471   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  267    472   
                    builder,
  268    473   
                    ::http::header::CONTENT_TYPE,
  269    474   
                    "application/json",
  270    475   
                );
         476  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  271    477   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  272    478   
                    builder,
  273    479   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  274    480   
                    "InternalServerError",
  275    481   
                );
         482  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  276    483   
                let content_length = payload.len();
  277    484   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  278    485   
                    builder,
  279    486   
                    ::http::header::CONTENT_LENGTH,
  280    487   
                    content_length,
  281    488   
                );
         489  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  282    490   
                builder
  283    491   
                    .status(500)
  284    492   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         493  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
         494  +
            } /* ServerHttpBoundProtocolGenerator.kt:468 */
  285    495   
        }
  286         -
        }
         496  +
        /* ServerHttpBoundProtocolGenerator.kt:452 */
  287    497   
    })
         498  +
    /* ServerHttpBoundProtocolGenerator.kt:447 */
  288    499   
}

tmp-codegen-diff/codegen-server-test-python/rest_json/rust-server-codegen-python/src/protocol_serde/shape_all_query_string_types_input.rs

@@ -1,1 +114,156 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* ServerHttpBoundProtocolGenerator.kt:1292 */
    2      3   
pub fn de_query_boolean(
    3      4   
    value: &str,
    4      5   
) -> std::result::Result<
    5      6   
    ::std::option::Option<bool>,
    6      7   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
    7      8   
> {
           9  +
    /* ServerHttpBoundProtocolGenerator.kt:1347 */
    8     10   
    let value = <_ as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(value)?;
          11  +
    /* ServerHttpBoundProtocolGenerator.kt:1357 */
    9     12   
    Ok(Some(value))
          13  +
    /* ServerHttpBoundProtocolGenerator.kt:1292 */
   10     14   
}
   11     15   
          16  +
/* ServerHttpBoundProtocolGenerator.kt:1292 */
   12     17   
pub fn de_query_byte(
   13     18   
    value: &str,
   14     19   
) -> std::result::Result<
   15     20   
    ::std::option::Option<i8>,
   16     21   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
   17     22   
> {
          23  +
    /* ServerHttpBoundProtocolGenerator.kt:1347 */
   18     24   
    let value = <_ as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(value)?;
          25  +
    /* ServerHttpBoundProtocolGenerator.kt:1357 */
   19     26   
    Ok(Some(value))
          27  +
    /* ServerHttpBoundProtocolGenerator.kt:1292 */
   20     28   
}
   21     29   
          30  +
/* ServerHttpBoundProtocolGenerator.kt:1292 */
   22     31   
pub fn de_query_double(
   23     32   
    value: &str,
   24     33   
) -> std::result::Result<
   25     34   
    ::std::option::Option<f64>,
   26     35   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
   27     36   
> {
          37  +
    /* ServerHttpBoundProtocolGenerator.kt:1347 */
   28     38   
    let value = <_ as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(value)?;
          39  +
    /* ServerHttpBoundProtocolGenerator.kt:1357 */
   29     40   
    Ok(Some(value))
          41  +
    /* ServerHttpBoundProtocolGenerator.kt:1292 */
   30     42   
}
   31     43   
          44  +
/* ServerHttpBoundProtocolGenerator.kt:1292 */
   32     45   
pub fn de_query_enum(
   33     46   
    value: &str,
   34     47   
) -> std::result::Result<
   35     48   
    ::std::option::Option<::std::string::String>,
   36     49   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
   37     50   
> {
          51  +
    /* ServerHttpBoundProtocolGenerator.kt:1309 */
   38     52   
    let value = value.to_owned();
          53  +
    /* ServerHttpBoundProtocolGenerator.kt:1357 */
   39     54   
    Ok(Some(value))
          55  +
    /* ServerHttpBoundProtocolGenerator.kt:1292 */
   40     56   
}
   41     57   
          58  +
/* ServerHttpBoundProtocolGenerator.kt:1292 */
   42     59   
pub fn de_query_float(
   43     60   
    value: &str,
   44     61   
) -> std::result::Result<
   45     62   
    ::std::option::Option<f32>,
   46     63   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
   47     64   
> {
          65  +
    /* ServerHttpBoundProtocolGenerator.kt:1347 */
   48     66   
    let value = <_ as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(value)?;
          67  +
    /* ServerHttpBoundProtocolGenerator.kt:1357 */
   49     68   
    Ok(Some(value))
          69  +
    /* ServerHttpBoundProtocolGenerator.kt:1292 */
   50     70   
}
   51     71   
          72  +
/* ServerHttpBoundProtocolGenerator.kt:1292 */
   52     73   
pub fn de_query_integer(
   53     74   
    value: &str,
   54     75   
) -> std::result::Result<
   55     76   
    ::std::option::Option<i32>,
   56     77   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
   57     78   
> {
          79  +
    /* ServerHttpBoundProtocolGenerator.kt:1347 */
   58     80   
    let value = <_ as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(value)?;
          81  +
    /* ServerHttpBoundProtocolGenerator.kt:1357 */
   59     82   
    Ok(Some(value))
          83  +
    /* ServerHttpBoundProtocolGenerator.kt:1292 */
   60     84   
}
   61     85   
          86  +
/* ServerHttpBoundProtocolGenerator.kt:1292 */
   62     87   
pub fn de_query_integer_enum(
   63     88   
    value: &str,
   64     89   
) -> std::result::Result<
   65     90   
    ::std::option::Option<i32>,
   66     91   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
   67     92   
> {
          93  +
    /* ServerHttpBoundProtocolGenerator.kt:1347 */
   68     94   
    let value = <_ as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(value)?;
          95  +
    /* ServerHttpBoundProtocolGenerator.kt:1357 */
   69     96   
    Ok(Some(value))
          97  +
    /* ServerHttpBoundProtocolGenerator.kt:1292 */
   70     98   
}
   71     99   
         100  +
/* ServerHttpBoundProtocolGenerator.kt:1292 */
   72    101   
pub fn de_query_long(
   73    102   
    value: &str,
   74    103   
) -> std::result::Result<
   75    104   
    ::std::option::Option<i64>,
   76    105   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
   77    106   
> {
         107  +
    /* ServerHttpBoundProtocolGenerator.kt:1347 */
   78    108   
    let value = <_ as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(value)?;
         109  +
    /* ServerHttpBoundProtocolGenerator.kt:1357 */
   79    110   
    Ok(Some(value))
         111  +
    /* ServerHttpBoundProtocolGenerator.kt:1292 */
   80    112   
}
   81    113   
         114  +
/* ServerHttpBoundProtocolGenerator.kt:1292 */
   82    115   
pub fn de_query_short(
   83    116   
    value: &str,
   84    117   
) -> std::result::Result<
   85    118   
    ::std::option::Option<i16>,
   86    119   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
   87    120   
> {
         121  +
    /* ServerHttpBoundProtocolGenerator.kt:1347 */
   88    122   
    let value = <_ as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(value)?;
         123  +
    /* ServerHttpBoundProtocolGenerator.kt:1357 */
   89    124   
    Ok(Some(value))
         125  +
    /* ServerHttpBoundProtocolGenerator.kt:1292 */
   90    126   
}
   91    127   
         128  +
/* ServerHttpBoundProtocolGenerator.kt:1292 */
   92    129   
pub fn de_query_string(
   93    130   
    value: &str,
   94    131   
) -> std::result::Result<
   95    132   
    ::std::option::Option<::std::string::String>,
   96    133   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
   97    134   
> {
         135  +
    /* ServerHttpBoundProtocolGenerator.kt:1309 */
   98    136   
    let value = value.to_owned();
         137  +
    /* ServerHttpBoundProtocolGenerator.kt:1357 */
   99    138   
    Ok(Some(value))
         139  +
    /* ServerHttpBoundProtocolGenerator.kt:1292 */
  100    140   
}
  101    141   
         142  +
/* ServerHttpBoundProtocolGenerator.kt:1292 */
  102    143   
pub fn de_query_timestamp(
  103    144   
    value: &str,
  104    145   
) -> std::result::Result<
  105    146   
    ::std::option::Option<::aws_smithy_http_server_python::types::DateTime>,
  106    147   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
  107    148   
> {
  108         -
    let value = ::aws_smithy_types::DateTime::from_str(
  109         -
        value,
  110         -
        ::aws_smithy_types::date_time::Format::DateTime,
  111         -
    )?
  112         -
    .into();
         149  +
    /* ServerHttpBoundProtocolGenerator.kt:1332 */
         150  +
    let value = ::aws_smithy_types::DateTime::from_str(value, ::aws_smithy_types::date_time::Format::DateTime)?
         151  +
    /* PythonServerProtocolLoader.kt:68 */.into()
         152  +
    /* ServerHttpBoundProtocolGenerator.kt:1343 */;
         153  +
    /* ServerHttpBoundProtocolGenerator.kt:1357 */
  113    154   
    Ok(Some(value))
         155  +
    /* ServerHttpBoundProtocolGenerator.kt:1292 */
  114    156   
}

tmp-codegen-diff/codegen-server-test-python/rest_json/rust-server-codegen-python/src/protocol_serde/shape_boolean_list.rs

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

tmp-codegen-diff/codegen-server-test-python/rest_json/rust-server-codegen-python/src/protocol_serde/shape_client_optional_defaults.rs

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

tmp-codegen-diff/codegen-server-test-python/rest_json/rust-server-codegen-python/src/protocol_serde/shape_complex_error.rs

@@ -1,1 +53,79 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
    2      3   
pub fn ser_complex_error_error(
    3      4   
    value: &crate::error::ComplexError,
    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_complex_error::ser_complex_error(&mut object, value)?;
          11  +
    /* JsonSerializerGenerator.kt:227 */
    8     12   
    object.finish();
    9     13   
    Ok(out)
          14  +
    /* JsonSerializerGenerator.kt:213 */
   10     15   
}
   11     16   
          17  +
/* HttpBindingGenerator.kt:542 */
   12     18   
pub fn ser_complex_error_headers(
   13     19   
    input: &crate::error::ComplexError,
   14     20   
    mut builder: ::http::response::Builder,
   15     21   
) -> std::result::Result<::http::response::Builder, ::aws_smithy_types::error::operation::BuildError>
   16     22   
{
          23  +
    /* HttpBindingGenerator.kt:592 */
   17     24   
    if let ::std::option::Option::Some(inner_1) = &input.header {
          25  +
        /* HttpBindingGenerator.kt:704 */
   18     26   
        let formatted_2 = inner_1.as_str();
          27  +
        /* HttpBindingGenerator.kt:705 */
   19     28   
        if !formatted_2.is_empty() {
          29  +
            /* HttpBindingGenerator.kt:706 */
   20     30   
            let header_value = formatted_2;
   21     31   
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
   22     32   
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
   23     33   
                    "header",
   24     34   
                    format!(
   25     35   
                        "`{}` cannot be used as a header value: {}",
   26     36   
                        &header_value, err
   27     37   
                    ),
   28     38   
                )
   29     39   
            })?;
   30     40   
            builder = builder.header("X-Header", header_value);
          41  +
            /* HttpBindingGenerator.kt:705 */
   31     42   
        }
          43  +
        /* HttpBindingGenerator.kt:592 */
   32     44   
    }
          45  +
    /* HttpBindingGenerator.kt:555 */
   33     46   
    Ok(builder)
          47  +
    /* HttpBindingGenerator.kt:542 */
   34     48   
}
   35     49   
          50  +
/* JsonSerializerGenerator.kt:358 */
   36     51   
pub fn ser_complex_error(
   37     52   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   38     53   
    input: &crate::error::ComplexError,
   39     54   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          55  +
    /* JsonSerializerGenerator.kt:382 */
   40     56   
    if let Some(var_3) = &input.nested {
          57  +
        /* JsonSerializerGenerator.kt:495 */
   41     58   
        #[allow(unused_mut)]
          59  +
        /* JsonSerializerGenerator.kt:496 */
   42     60   
        let mut object_4 = object.key("Nested").start_object();
          61  +
        /* JsonSerializerGenerator.kt:375 */
   43     62   
        crate::protocol_serde::shape_complex_nested_error_data::ser_complex_nested_error_data(
   44     63   
            &mut object_4,
   45     64   
            var_3,
   46     65   
        )?;
          66  +
        /* JsonSerializerGenerator.kt:515 */
   47     67   
        object_4.finish();
          68  +
        /* JsonSerializerGenerator.kt:382 */
   48     69   
    }
          70  +
    /* JsonSerializerGenerator.kt:382 */
   49     71   
    if let Some(var_5) = &input.top_level {
          72  +
        /* JsonSerializerGenerator.kt:423 */
   50     73   
        object.key("TopLevel").string(var_5.as_str());
          74  +
        /* JsonSerializerGenerator.kt:382 */
   51     75   
    }
          76  +
    /* JsonSerializerGenerator.kt:372 */
   52     77   
    Ok(())
          78  +
    /* JsonSerializerGenerator.kt:358 */
   53     79   
}

tmp-codegen-diff/codegen-server-test-python/rest_json/rust-server-codegen-python/src/protocol_serde/shape_complex_nested_error_data.rs

@@ -1,1 +10,16 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:358 */
    2      3   
pub fn ser_complex_nested_error_data(
    3      4   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4      5   
    input: &crate::model::ComplexNestedErrorData,
    5      6   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
           7  +
    /* JsonSerializerGenerator.kt:382 */
    6      8   
    if let Some(var_1) = &input.foo {
           9  +
        /* JsonSerializerGenerator.kt:423 */
    7     10   
        object.key("Fooooo").string(var_1.as_str());
          11  +
        /* JsonSerializerGenerator.kt:382 */
    8     12   
    }
          13  +
    /* JsonSerializerGenerator.kt:372 */
    9     14   
    Ok(())
          15  +
    /* JsonSerializerGenerator.kt:358 */
   10     16   
}

tmp-codegen-diff/codegen-server-test-python/rest_json/rust-server-codegen-python/src/protocol_serde/shape_constant_and_variable_query_string.rs

@@ -1,1 +111,158 @@
    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_constant_and_variable_query_string_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::ConstantAndVariableQueryStringInput,
    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::constant_and_variable_query_string_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:1073 */
   23     31   
        let query_string = uri.query().unwrap_or("");
   24     32   
        let pairs = ::form_urlencoded::parse(query_string.as_bytes());
          33  +
        /* ServerHttpBoundProtocolGenerator.kt:1099 */
   25     34   
        let mut baz_seen = false;
          35  +
        /* ServerHttpBoundProtocolGenerator.kt:1099 */
   26     36   
        let mut maybe_set_seen = false;
          37  +
        /* ServerHttpBoundProtocolGenerator.kt:1105 */
   27     38   
        for (k, v) in pairs {
          39  +
            /* ServerHttpBoundProtocolGenerator.kt:1109 */
   28     40   
            if !baz_seen && k == "baz" {
   29     41   
                input = input.set_baz(
   30     42   
                    crate::protocol_serde::shape_constant_and_variable_query_string_input::de_baz(
   31     43   
                        &v,
   32     44   
                    )?,
   33     45   
                );
   34     46   
                baz_seen = true;
   35     47   
            }
          48  +
            /* ServerHttpBoundProtocolGenerator.kt:1109 */
   36     49   
            if !maybe_set_seen && k == "maybeSet" {
   37     50   
                input = input.set_maybe_set(
   38     51   
                    crate::protocol_serde::shape_constant_and_variable_query_string_input::de_maybe_set(&v)?
   39     52   
                );
   40     53   
                maybe_set_seen = true;
   41     54   
            }
          55  +
            /* ServerHttpBoundProtocolGenerator.kt:1105 */
   42     56   
        }
          57  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   43     58   
        input.build()
          59  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   44     60   
    })
          61  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   45     62   
}
   46     63   
          64  +
/* RustType.kt:516 */
   47     65   
#[allow(clippy::unnecessary_wraps)]
          66  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   48     67   
pub fn ser_constant_and_variable_query_string_http_response(
   49     68   
    #[allow(unused_variables)] output: crate::output::ConstantAndVariableQueryStringOutput,
   50     69   
) -> std::result::Result<
   51     70   
    ::aws_smithy_http_server::response::Response,
   52     71   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   53     72   
> {
          73  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   54     74   
    Ok({
          75  +
        /* RustType.kt:516 */
   55     76   
        #[allow(unused_mut)]
          77  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   56     78   
        let mut builder = ::http::Response::builder();
          79  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   57     80   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   58     81   
            builder,
   59     82   
            ::http::header::CONTENT_TYPE,
   60     83   
            "application/json",
   61     84   
        );
          85  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   62     86   
        let http_status: u16 = 200;
   63     87   
        builder = builder.status(http_status);
   64         -
        let payload = "";
          88  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
          89  +
        let payload =
          90  +
            /* HttpBoundProtocolPayloadGenerator.kt:235 */""
          91  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
          92  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   65     93   
        let content_length = payload.len();
   66     94   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   67     95   
            builder,
   68     96   
            ::http::header::CONTENT_LENGTH,
   69     97   
            content_length,
   70     98   
        );
          99  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   71    100   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
         101  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   72    102   
        builder.body(body)?
         103  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   73    104   
    })
         105  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   74    106   
}
   75    107   
         108  +
/* RustType.kt:516 */
   76    109   
#[allow(clippy::unnecessary_wraps)]
         110  +
/* ServerHttpBoundProtocolGenerator.kt:447 */
   77    111   
pub fn ser_constant_and_variable_query_string_http_error(
   78    112   
    error: &crate::error::ConstantAndVariableQueryStringError,
   79    113   
) -> std::result::Result<
   80    114   
    ::aws_smithy_http_server::response::Response,
   81    115   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   82    116   
> {
         117  +
    /* ServerHttpBoundProtocolGenerator.kt:452 */
   83    118   
    Ok({
         119  +
        /* ServerHttpBoundProtocolGenerator.kt:468 */
   84    120   
        match error {
         121  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
   85    122   
            crate::error::ConstantAndVariableQueryStringError::InternalServerError(output) => {
         123  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
   86    124   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
         125  +
                /* RustType.kt:516 */
   87    126   
                #[allow(unused_mut)]
         127  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
   88    128   
                let mut builder = ::http::Response::builder();
         129  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   89    130   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   90    131   
                    builder,
   91    132   
                    ::http::header::CONTENT_TYPE,
   92    133   
                    "application/json",
   93    134   
                );
         135  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   94    136   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   95    137   
                    builder,
   96    138   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
   97    139   
                    "InternalServerError",
   98    140   
                );
         141  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
   99    142   
                let content_length = payload.len();
  100    143   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  101    144   
                    builder,
  102    145   
                    ::http::header::CONTENT_LENGTH,
  103    146   
                    content_length,
  104    147   
                );
         148  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  105    149   
                builder
  106    150   
                    .status(500)
  107    151   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         152  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
         153  +
            } /* ServerHttpBoundProtocolGenerator.kt:468 */
  108    154   
        }
  109         -
        }
         155  +
        /* ServerHttpBoundProtocolGenerator.kt:452 */
  110    156   
    })
         157  +
    /* ServerHttpBoundProtocolGenerator.kt:447 */
  111    158   
}

tmp-codegen-diff/codegen-server-test-python/rest_json/rust-server-codegen-python/src/protocol_serde/shape_constant_and_variable_query_string_input.rs

@@ -1,1 +20,28 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* ServerHttpBoundProtocolGenerator.kt:1292 */
    2      3   
pub fn de_baz(
    3      4   
    value: &str,
    4      5   
) -> std::result::Result<
    5      6   
    ::std::option::Option<::std::string::String>,
    6      7   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
    7      8   
> {
           9  +
    /* ServerHttpBoundProtocolGenerator.kt:1309 */
    8     10   
    let value = value.to_owned();
          11  +
    /* ServerHttpBoundProtocolGenerator.kt:1357 */
    9     12   
    Ok(Some(value))
          13  +
    /* ServerHttpBoundProtocolGenerator.kt:1292 */
   10     14   
}
   11     15   
          16  +
/* ServerHttpBoundProtocolGenerator.kt:1292 */
   12     17   
pub fn de_maybe_set(
   13     18   
    value: &str,
   14     19   
) -> std::result::Result<
   15     20   
    ::std::option::Option<::std::string::String>,
   16     21   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
   17     22   
> {
          23  +
    /* ServerHttpBoundProtocolGenerator.kt:1309 */
   18     24   
    let value = value.to_owned();
          25  +
    /* ServerHttpBoundProtocolGenerator.kt:1357 */
   19     26   
    Ok(Some(value))
          27  +
    /* ServerHttpBoundProtocolGenerator.kt:1292 */
   20     28   
}

tmp-codegen-diff/codegen-server-test-python/rest_json/rust-server-codegen-python/src/protocol_serde/shape_constant_query_string.rs

@@ -1,1 +134,186 @@
    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_constant_query_string_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::ConstantQueryStringInput,
    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 = crate::input::constant_query_string_input_internal::Builder::default();
          23  +
        /* RustType.kt:516 */
   18     24   
        #[allow(unused_variables)]
          25  +
        /* ServerHttpBoundProtocolGenerator.kt:728 */
   19     26   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     27   
            uri, headers, body, ..
   21     28   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          29  +
        /* ServerHttpBoundProtocolGenerator.kt:986 */
   22     30   
        let input_string = uri.path();
          31  +
        /* ServerHttpBoundProtocolGenerator.kt:998 */
   23     32   
        let (input_string, (_, m1)) =
   24     33   
            ::nom::sequence::tuple::<_, _, ::nom::error::Error<&str>, _>((
   25     34   
                ::nom::sequence::preceded(
   26     35   
                    ::nom::bytes::complete::tag("/"),
   27     36   
                    ::nom::bytes::complete::tag::<_, _, ::nom::error::Error<&str>>(
   28     37   
                        "ConstantQueryString",
   29     38   
                    ),
   30     39   
                ),
   31     40   
                ::nom::sequence::preceded(
   32     41   
                    ::nom::bytes::complete::tag("/"),
   33     42   
                    ::nom::branch::alt::<_, _, ::nom::error::Error<&str>, _>((
   34     43   
                        ::nom::bytes::complete::take_until("/"),
   35     44   
                        ::nom::combinator::rest,
   36     45   
                    )),
   37     46   
                ),
   38     47   
            ))(input_string)?;
   39     48   
        debug_assert_eq!("", input_string);
          49  +
        /* ServerHttpBoundProtocolGenerator.kt:1009 */
   40     50   
        input = input
   41     51   
            .set_hello(crate::protocol_serde::shape_constant_query_string_input::de_hello(m1)?);
          52  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   42     53   
        input.build()?
          54  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   43     55   
    })
          56  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   44     57   
}
   45     58   
          59  +
/* RustType.kt:516 */
   46     60   
#[allow(clippy::unnecessary_wraps)]
          61  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   47     62   
pub fn ser_constant_query_string_http_response(
   48     63   
    #[allow(unused_variables)] output: crate::output::ConstantQueryStringOutput,
   49     64   
) -> std::result::Result<
   50     65   
    ::aws_smithy_http_server::response::Response,
   51     66   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   52     67   
> {
          68  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   53     69   
    Ok({
          70  +
        /* RustType.kt:516 */
   54     71   
        #[allow(unused_mut)]
          72  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   55     73   
        let mut builder = ::http::Response::builder();
          74  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   56     75   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   57     76   
            builder,
   58     77   
            ::http::header::CONTENT_TYPE,
   59     78   
            "application/json",
   60     79   
        );
          80  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   61     81   
        let http_status: u16 = 200;
   62     82   
        builder = builder.status(http_status);
   63         -
        let payload = "";
          83  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
          84  +
        let payload =
          85  +
            /* HttpBoundProtocolPayloadGenerator.kt:235 */""
          86  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
          87  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   64     88   
        let content_length = payload.len();
   65     89   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   66     90   
            builder,
   67     91   
            ::http::header::CONTENT_LENGTH,
   68     92   
            content_length,
   69     93   
        );
          94  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   70     95   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          96  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   71     97   
        builder.body(body)?
          98  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   72     99   
    })
         100  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   73    101   
}
   74    102   
         103  +
/* RustType.kt:516 */
   75    104   
#[allow(clippy::unnecessary_wraps)]
         105  +
/* ServerHttpBoundProtocolGenerator.kt:447 */
   76    106   
pub fn ser_constant_query_string_http_error(
   77    107   
    error: &crate::error::ConstantQueryStringError,
   78    108   
) -> std::result::Result<
   79    109   
    ::aws_smithy_http_server::response::Response,
   80    110   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   81    111   
> {
         112  +
    /* ServerHttpBoundProtocolGenerator.kt:452 */
   82    113   
    Ok({
         114  +
        /* ServerHttpBoundProtocolGenerator.kt:468 */
   83    115   
        match error {
         116  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
   84    117   
            crate::error::ConstantQueryStringError::ValidationException(output) => {
         118  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
   85    119   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
         120  +
                /* RustType.kt:516 */
   86    121   
                #[allow(unused_mut)]
         122  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
   87    123   
                let mut builder = ::http::Response::builder();
         124  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   88    125   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   89    126   
                    builder,
   90    127   
                    ::http::header::CONTENT_TYPE,
   91    128   
                    "application/json",
   92    129   
                );
         130  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   93    131   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   94    132   
                    builder,
   95    133   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
   96    134   
                    "ValidationException",
   97    135   
                );
         136  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
   98    137   
                let content_length = payload.len();
   99    138   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  100    139   
                    builder,
  101    140   
                    ::http::header::CONTENT_LENGTH,
  102    141   
                    content_length,
  103    142   
                );
         143  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  104    144   
                builder
  105    145   
                    .status(400)
  106    146   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         147  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
  107    148   
            }
         149  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
  108    150   
            crate::error::ConstantQueryStringError::InternalServerError(output) => {
         151  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
  109    152   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
         153  +
                /* RustType.kt:516 */
  110    154   
                #[allow(unused_mut)]
         155  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
  111    156   
                let mut builder = ::http::Response::builder();
         157  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  112    158   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  113    159   
                    builder,
  114    160   
                    ::http::header::CONTENT_TYPE,
  115    161   
                    "application/json",
  116    162   
                );
         163  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  117    164   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  118    165   
                    builder,
  119    166   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  120    167   
                    "InternalServerError",
  121    168   
                );
         169  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  122    170   
                let content_length = payload.len();
  123    171   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  124    172   
                    builder,
  125    173   
                    ::http::header::CONTENT_LENGTH,
  126    174   
                    content_length,
  127    175   
                );
         176  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  128    177   
                builder
  129    178   
                    .status(500)
  130    179   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         180  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
         181  +
            } /* ServerHttpBoundProtocolGenerator.kt:468 */
  131    182   
        }
  132         -
        }
         183  +
        /* ServerHttpBoundProtocolGenerator.kt:452 */
  133    184   
    })
         185  +
    /* ServerHttpBoundProtocolGenerator.kt:447 */
  134    186   
}

tmp-codegen-diff/codegen-server-test-python/rest_json/rust-server-codegen-python/src/protocol_serde/shape_constant_query_string_input.rs

@@ -1,1 +12,16 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* ServerHttpBoundProtocolGenerator.kt:1292 */
    2      3   
pub fn de_hello(
    3      4   
    value: &str,
    4      5   
) -> std::result::Result<
    5      6   
    ::std::string::String,
    6      7   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
    7      8   
> {
           9  +
    /* ServerHttpBoundProtocolGenerator.kt:1302 */
    8     10   
    let value = ::percent_encoding::percent_decode_str(value)
    9     11   
        .decode_utf8()?
   10     12   
        .into_owned();
          13  +
    /* ServerHttpBoundProtocolGenerator.kt:1357 */
   11     14   
    Ok(value)
          15  +
    /* ServerHttpBoundProtocolGenerator.kt:1292 */
   12     16   
}

tmp-codegen-diff/codegen-server-test-python/rest_json/rust-server-codegen-python/src/protocol_serde/shape_content_type_parameters.rs

@@ -1,1 +153,214 @@
    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_content_type_parameters_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::ContentTypeParametersInput,
    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 = crate::input::content_type_parameters_input_internal::Builder::default();
          23  +
        /* RustType.kt:516 */
   18     24   
        #[allow(unused_variables)]
          25  +
        /* ServerHttpBoundProtocolGenerator.kt:728 */
   19     26   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     27   
            uri, headers, body, ..
   21     28   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          29  +
        /* ServerHttpBoundProtocolGenerator.kt:745 */
   22     30   
        let bytes = ::hyper::body::to_bytes(body).await?;
          31  +
        /* ServerHttpBoundProtocolGenerator.kt:768 */
   23     32   
        if !bytes.is_empty() {
          33  +
            /* ServerHttpBoundProtocolGenerator.kt:769 */
   24     34   
            ::aws_smithy_http_server::protocol::content_type_header_classifier_smithy(
   25     35   
                &headers,
   26     36   
                Some("application/json"),
   27     37   
            )?;
   28     38   
            input =
   29     39   
                crate::protocol_serde::shape_content_type_parameters::de_content_type_parameters(
   30     40   
                    bytes.as_ref(),
   31     41   
                    input,
   32     42   
                )?;
          43  +
            /* ServerHttpBoundProtocolGenerator.kt:768 */
   33     44   
        }
          45  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   34     46   
        input.build()
          47  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   35     48   
    })
          49  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   36     50   
}
   37     51   
          52  +
/* RustType.kt:516 */
   38     53   
#[allow(clippy::unnecessary_wraps)]
          54  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   39     55   
pub fn ser_content_type_parameters_http_response(
   40     56   
    #[allow(unused_variables)] output: crate::output::ContentTypeParametersOutput,
   41     57   
) -> std::result::Result<
   42     58   
    ::aws_smithy_http_server::response::Response,
   43     59   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   44     60   
> {
          61  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   45     62   
    Ok({
          63  +
        /* RustType.kt:516 */
   46     64   
        #[allow(unused_mut)]
          65  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   47     66   
        let mut builder = ::http::Response::builder();
          67  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   48     68   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   49     69   
            builder,
   50     70   
            ::http::header::CONTENT_TYPE,
   51     71   
            "application/json",
   52     72   
        );
          73  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   53     74   
        let http_status: u16 = 200;
   54     75   
        builder = builder.status(http_status);
          76  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
   55     77   
        let payload =
   56         -
            crate::protocol_serde::shape_content_type_parameters_output::ser_content_type_parameters_output_output_output(&output)?
   57         -
        ;
          78  +
            /* HttpBoundProtocolPayloadGenerator.kt:237 */crate::protocol_serde::shape_content_type_parameters_output::ser_content_type_parameters_output_output_output(&output)?
          79  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
          80  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   58     81   
        let content_length = payload.len();
   59     82   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   60     83   
            builder,
   61     84   
            ::http::header::CONTENT_LENGTH,
   62     85   
            content_length,
   63     86   
        );
          87  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   64     88   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          89  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   65     90   
        builder.body(body)?
          91  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   66     92   
    })
          93  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   67     94   
}
   68     95   
          96  +
/* RustType.kt:516 */
   69     97   
#[allow(clippy::unnecessary_wraps)]
          98  +
/* ServerHttpBoundProtocolGenerator.kt:447 */
   70     99   
pub fn ser_content_type_parameters_http_error(
   71    100   
    error: &crate::error::ContentTypeParametersError,
   72    101   
) -> std::result::Result<
   73    102   
    ::aws_smithy_http_server::response::Response,
   74    103   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   75    104   
> {
         105  +
    /* ServerHttpBoundProtocolGenerator.kt:452 */
   76    106   
    Ok({
         107  +
        /* ServerHttpBoundProtocolGenerator.kt:468 */
   77    108   
        match error {
         109  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
   78    110   
            crate::error::ContentTypeParametersError::InternalServerError(output) => {
         111  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
   79    112   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
         113  +
                /* RustType.kt:516 */
   80    114   
                #[allow(unused_mut)]
         115  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
   81    116   
                let mut builder = ::http::Response::builder();
         117  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   82    118   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   83    119   
                    builder,
   84    120   
                    ::http::header::CONTENT_TYPE,
   85    121   
                    "application/json",
   86    122   
                );
         123  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   87    124   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   88    125   
                    builder,
   89    126   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
   90    127   
                    "InternalServerError",
   91    128   
                );
         129  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
   92    130   
                let content_length = payload.len();
   93    131   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   94    132   
                    builder,
   95    133   
                    ::http::header::CONTENT_LENGTH,
   96    134   
                    content_length,
   97    135   
                );
         136  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
   98    137   
                builder
   99    138   
                    .status(500)
  100    139   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         140  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
         141  +
            } /* ServerHttpBoundProtocolGenerator.kt:468 */
  101    142   
        }
  102         -
        }
         143  +
        /* ServerHttpBoundProtocolGenerator.kt:452 */
  103    144   
    })
         145  +
    /* ServerHttpBoundProtocolGenerator.kt:447 */
  104    146   
}
  105    147   
         148  +
/* JsonParserGenerator.kt:148 */
  106    149   
pub(crate) fn de_content_type_parameters(
  107    150   
    value: &[u8],
  108    151   
    mut builder: crate::input::content_type_parameters_input_internal::Builder,
  109    152   
) -> ::std::result::Result<
  110    153   
    crate::input::content_type_parameters_input_internal::Builder,
  111    154   
    ::aws_smithy_json::deserialize::error::DeserializeError,
  112    155   
> {
         156  +
    /* JsonParserGenerator.kt:153 */
  113    157   
    let mut tokens_owned =
  114    158   
        ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value))
  115    159   
            .peekable();
  116    160   
    let tokens = &mut tokens_owned;
  117    161   
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
         162  +
    /* JsonParserGenerator.kt:684 */
  118    163   
    loop {
         164  +
        /* JsonParserGenerator.kt:685 */
  119    165   
        match tokens.next().transpose()? {
         166  +
            /* JsonParserGenerator.kt:686 */
  120    167   
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
  121    168   
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
         169  +
                /* JsonParserGenerator.kt:260 */
  122    170   
                match key.to_unescaped()?.as_ref() {
         171  +
                    /* JsonParserGenerator.kt:262 */
  123    172   
                    "value" => {
         173  +
                        /* JsonParserGenerator.kt:272 */
  124    174   
                        builder = builder.set_value(
         175  +
                            /* JsonParserGenerator.kt:365 */
  125    176   
                            ::aws_smithy_json::deserialize::token::expect_number_or_null(
  126    177   
                                tokens.next(),
  127    178   
                            )?
  128    179   
                            .map(i32::try_from)
  129         -
                            .transpose()?,
         180  +
                            .transpose()?, /* JsonParserGenerator.kt:272 */
  130    181   
                        );
         182  +
                        /* JsonParserGenerator.kt:262 */
  131    183   
                    }
  132         -
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
         184  +
                    /* JsonParserGenerator.kt:290 */
         185  +
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
  133    186   
                }
         187  +
                /* JsonParserGenerator.kt:686 */
  134    188   
            }
         189  +
            /* JsonParserGenerator.kt:695 */
  135    190   
            other => {
  136    191   
                return Err(
  137    192   
                    ::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  138    193   
                        "expected object key or end object, found: {:?}",
  139    194   
                        other
  140    195   
                    )),
  141    196   
                )
         197  +
            } /* JsonParserGenerator.kt:685 */
  142    198   
        }
         199  +
        /* JsonParserGenerator.kt:684 */
  143    200   
    }
  144         -
    }
         201  +
    /* JsonParserGenerator.kt:250 */
  145    202   
    if tokens.next().is_some() {
         203  +
        /* JsonParserGenerator.kt:251 */
  146    204   
        return Err(
  147    205   
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
  148    206   
                "found more JSON tokens after completing parsing",
  149    207   
            ),
  150    208   
        );
         209  +
        /* JsonParserGenerator.kt:250 */
  151    210   
    }
         211  +
    /* JsonParserGenerator.kt:163 */
  152    212   
    Ok(builder)
         213  +
    /* JsonParserGenerator.kt:148 */
  153    214   
}

tmp-codegen-diff/codegen-server-test-python/rest_json/rust-server-codegen-python/src/protocol_serde/shape_content_type_parameters_output.rs

@@ -1,1 +17,25 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
    2      3   
pub fn ser_content_type_parameters_output_output_output(
    3      4   
    value: &crate::output::ContentTypeParametersOutput,
    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_content_type_parameters_output::ser_content_type_parameters_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_content_type_parameters_output_output(
   13     19   
    #[allow(unused_variables)] object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   14     20   
    #[allow(unused_variables)] input: &crate::output::ContentTypeParametersOutput,
   15     21   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          22  +
    /* JsonSerializerGenerator.kt:372 */
   16     23   
    Ok(())
          24  +
    /* JsonSerializerGenerator.kt:358 */
   17     25   
}

tmp-codegen-diff/codegen-server-test-python/rest_json/rust-server-codegen-python/src/protocol_serde/shape_datetime_offsets.rs

@@ -1,1 +93,132 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:516 */
    2      3   
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ServerHttpBoundProtocolGenerator.kt:383 */
    3      5   
pub async fn de_datetime_offsets_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::DatetimeOffsetsInput,
    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 = crate::input::datetime_offsets_input_internal::Builder::default();
          23  +
        /* RustType.kt:516 */
   18     24   
        #[allow(unused_variables)]
          25  +
        /* ServerHttpBoundProtocolGenerator.kt:728 */
   19     26   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     27   
            uri, headers, body, ..
   21     28   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          29  +
        /* ServerHttpBoundProtocolGenerator.kt:811 */
   22     30   
        ::aws_smithy_http_server::protocol::content_type_header_classifier_smithy(&headers, None)?;
          31  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   23     32   
        input.build()
          33  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   24     34   
    })
          35  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   25     36   
}
   26     37   
          38  +
/* RustType.kt:516 */
   27     39   
#[allow(clippy::unnecessary_wraps)]
          40  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   28     41   
pub fn ser_datetime_offsets_http_response(
   29     42   
    #[allow(unused_variables)] output: crate::output::DatetimeOffsetsOutput,
   30     43   
) -> std::result::Result<
   31     44   
    ::aws_smithy_http_server::response::Response,
   32     45   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   33     46   
> {
          47  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   34     48   
    Ok({
          49  +
        /* RustType.kt:516 */
   35     50   
        #[allow(unused_mut)]
          51  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   36     52   
        let mut builder = ::http::Response::builder();
          53  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   37     54   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   38     55   
            builder,
   39     56   
            ::http::header::CONTENT_TYPE,
   40     57   
            "application/json",
   41     58   
        );
          59  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   42     60   
        let http_status: u16 = 200;
   43     61   
        builder = builder.status(http_status);
          62  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
   44     63   
        let payload =
   45         -
            crate::protocol_serde::shape_datetime_offsets_output::ser_datetime_offsets_output_output_output(&output)?
   46         -
        ;
          64  +
            /* HttpBoundProtocolPayloadGenerator.kt:237 */crate::protocol_serde::shape_datetime_offsets_output::ser_datetime_offsets_output_output_output(&output)?
          65  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
          66  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   47     67   
        let content_length = payload.len();
   48     68   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   49     69   
            builder,
   50     70   
            ::http::header::CONTENT_LENGTH,
   51     71   
            content_length,
   52     72   
        );
          73  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   53     74   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          75  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   54     76   
        builder.body(body)?
          77  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   55     78   
    })
          79  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   56     80   
}
   57     81   
          82  +
/* RustType.kt:516 */
   58     83   
#[allow(clippy::unnecessary_wraps)]
          84  +
/* ServerHttpBoundProtocolGenerator.kt:447 */
   59     85   
pub fn ser_datetime_offsets_http_error(
   60     86   
    error: &crate::error::DatetimeOffsetsError,
   61     87   
) -> std::result::Result<
   62     88   
    ::aws_smithy_http_server::response::Response,
   63     89   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   64     90   
> {
          91  +
    /* ServerHttpBoundProtocolGenerator.kt:452 */
   65     92   
    Ok({
          93  +
        /* ServerHttpBoundProtocolGenerator.kt:468 */
   66     94   
        match error {
          95  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
   67     96   
            crate::error::DatetimeOffsetsError::InternalServerError(output) => {
          97  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
   68     98   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
          99  +
                /* RustType.kt:516 */
   69    100   
                #[allow(unused_mut)]
         101  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
   70    102   
                let mut builder = ::http::Response::builder();
         103  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   71    104   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   72    105   
                    builder,
   73    106   
                    ::http::header::CONTENT_TYPE,
   74    107   
                    "application/json",
   75    108   
                );
         109  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   76    110   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   77    111   
                    builder,
   78    112   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
   79    113   
                    "InternalServerError",
   80    114   
                );
         115  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
   81    116   
                let content_length = payload.len();
   82    117   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   83    118   
                    builder,
   84    119   
                    ::http::header::CONTENT_LENGTH,
   85    120   
                    content_length,
   86    121   
                );
         122  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
   87    123   
                builder
   88    124   
                    .status(500)
   89    125   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         126  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
         127  +
            } /* ServerHttpBoundProtocolGenerator.kt:468 */
   90    128   
        }
   91         -
        }
         129  +
        /* ServerHttpBoundProtocolGenerator.kt:452 */
   92    130   
    })
         131  +
    /* ServerHttpBoundProtocolGenerator.kt:447 */
   93    132   
}

tmp-codegen-diff/codegen-server-test-python/rest_json/rust-server-codegen-python/src/protocol_serde/shape_datetime_offsets_output.rs

@@ -1,1 +25,36 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
    2      3   
pub fn ser_datetime_offsets_output_output_output(
    3      4   
    value: &crate::output::DatetimeOffsetsOutput,
    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_datetime_offsets_output::ser_datetime_offsets_output_output(
    8     11   
        &mut object,
    9     12   
        value,
   10     13   
    )?;
          14  +
    /* JsonSerializerGenerator.kt:227 */
   11     15   
    object.finish();
   12     16   
    Ok(out)
          17  +
    /* JsonSerializerGenerator.kt:213 */
   13     18   
}
   14     19   
          20  +
/* JsonSerializerGenerator.kt:358 */
   15     21   
pub fn ser_datetime_offsets_output_output(
   16     22   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   17     23   
    input: &crate::output::DatetimeOffsetsOutput,
   18     24   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          25  +
    /* JsonSerializerGenerator.kt:382 */
   19     26   
    if let Some(var_1) = &input.datetime {
          27  +
        /* JsonSerializerGenerator.kt:448 */
   20     28   
        object
   21     29   
            .key("datetime")
   22     30   
            .date_time(var_1, ::aws_smithy_types::date_time::Format::DateTime)?;
          31  +
        /* JsonSerializerGenerator.kt:382 */
   23     32   
    }
          33  +
    /* JsonSerializerGenerator.kt:372 */
   24     34   
    Ok(())
          35  +
    /* JsonSerializerGenerator.kt:358 */
   25     36   
}

tmp-codegen-diff/codegen-server-test-python/rest_json/rust-server-codegen-python/src/protocol_serde/shape_defaults.rs

@@ -1,1 +325,420 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:516 */
    2      3   
pub(crate) fn de_defaults<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<crate::model::defaults_internal::Builder>,
    6      7   
    ::aws_smithy_json::deserialize::error::DeserializeError,
    7      8   
>
    8      9   
where
    9     10   
    I: Iterator<
   10     11   
        Item = Result<
   11     12   
            ::aws_smithy_json::deserialize::Token<'a>,
   12     13   
            ::aws_smithy_json::deserialize::error::DeserializeError,
   13     14   
        >,
   14     15   
    >,
   15     16   
{
          17  +
    /* JsonParserGenerator.kt:712 */
   16     18   
    match tokens.next().transpose()? {
          19  +
        /* JsonParserGenerator.kt:713 */
   17     20   
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   18     21   
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
          22  +
            /* RustType.kt:516 */
   19     23   
            #[allow(unused_mut)]
          24  +
            /* JsonParserGenerator.kt:526 */
   20     25   
            let mut builder = crate::model::defaults_internal::Builder::default();
          26  +
            /* JsonParserGenerator.kt:684 */
   21     27   
            loop {
          28  +
                /* JsonParserGenerator.kt:685 */
   22     29   
                match tokens.next().transpose()? {
          30  +
                    /* JsonParserGenerator.kt:686 */
   23     31   
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   24     32   
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
          33  +
                        /* JsonParserGenerator.kt:260 */
   25     34   
                        match key.to_unescaped()?.as_ref() {
          35  +
                            /* JsonParserGenerator.kt:262 */
   26     36   
                            "defaultString" => {
          37  +
                                /* JsonParserGenerator.kt:276 */
   27     38   
                                if let Some(v) =
   28         -
                                    ::aws_smithy_json::deserialize::token::expect_string_or_null(
   29         -
                                        tokens.next(),
   30         -
                                    )?
   31         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   32         -
                                    .transpose()?
   33         -
                                {
          39  +
                                /* JsonParserGenerator.kt:354 */::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?.map(|s|
          40  +
                                    /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          41  +
                                        /* JsonParserGenerator.kt:348 */u.into_owned()
          42  +
                                    /* JsonParserGenerator.kt:339 */)
          43  +
                                /* JsonParserGenerator.kt:354 */).transpose()?
          44  +
                                /* JsonParserGenerator.kt:278 */{
   34     45   
                                                                            builder = builder.set_default_string(v);
   35     46   
                                                                        }
          47  +
                                /* JsonParserGenerator.kt:262 */
   36     48   
                            }
          49  +
                            /* JsonParserGenerator.kt:262 */
   37     50   
                            "defaultBoolean" => {
          51  +
                                /* JsonParserGenerator.kt:276 */
   38     52   
                                if let Some(v) =
   39         -
                                    ::aws_smithy_json::deserialize::token::expect_bool_or_null(
   40         -
                                        tokens.next(),
   41         -
                                    )?
   42         -
                                {
          53  +
                                /* JsonParserGenerator.kt:298 */::aws_smithy_json::deserialize::token::expect_bool_or_null(tokens.next())?
          54  +
                                /* JsonParserGenerator.kt:278 */{
   43     55   
                                                                            builder = builder.set_default_boolean(v);
   44     56   
                                                                        }
          57  +
                                /* JsonParserGenerator.kt:262 */
   45     58   
                            }
          59  +
                            /* JsonParserGenerator.kt:262 */
   46     60   
                            "defaultList" => {
          61  +
                                /* JsonParserGenerator.kt:276 */
   47     62   
                                if let Some(v) =
   48         -
                                crate::protocol_serde::shape_test_string_list::de_test_string_list(tokens)?
   49         -
                                {
          63  +
                                /* JsonParserGenerator.kt:451 */crate::protocol_serde::shape_test_string_list::de_test_string_list(tokens)?
          64  +
                                /* JsonParserGenerator.kt:278 */{
   50     65   
                                                                            builder = builder.set_default_list(v);
   51     66   
                                                                        }
          67  +
                                /* JsonParserGenerator.kt:262 */
   52     68   
                            }
          69  +
                            /* JsonParserGenerator.kt:262 */
   53     70   
                            "defaultDocumentMap" => {
   54         -
                                if let Some(v) = Some(
   55         -
                                    ::aws_smithy_json::deserialize::token::expect_document(tokens)?,
          71  +
                                /* JsonParserGenerator.kt:276 */
          72  +
                                if let Some(v) =
          73  +
                                    /* JsonParserGenerator.kt:319 */
          74  +
                                    Some(
          75  +
                                        ::aws_smithy_json::deserialize::token::expect_document(
          76  +
                                            tokens,
          77  +
                                        )?,
   56     78   
                                    )
          79  +
                                    /* PythonServerProtocolLoader.kt:52 */
   57     80   
                                    .map(::aws_smithy_http_server_python::types::Document::from)
          81  +
                                /* JsonParserGenerator.kt:278 */
   58     82   
                                {
   59     83   
                                    builder = builder.set_default_document_map(v);
   60     84   
                                }
          85  +
                                /* JsonParserGenerator.kt:262 */
   61     86   
                            }
          87  +
                            /* JsonParserGenerator.kt:262 */
   62     88   
                            "defaultDocumentString" => {
   63         -
                                if let Some(v) = Some(
   64         -
                                    ::aws_smithy_json::deserialize::token::expect_document(tokens)?,
          89  +
                                /* JsonParserGenerator.kt:276 */
          90  +
                                if let Some(v) =
          91  +
                                    /* JsonParserGenerator.kt:319 */
          92  +
                                    Some(
          93  +
                                        ::aws_smithy_json::deserialize::token::expect_document(
          94  +
                                            tokens,
          95  +
                                        )?,
   65     96   
                                    )
          97  +
                                    /* PythonServerProtocolLoader.kt:52 */
   66     98   
                                    .map(::aws_smithy_http_server_python::types::Document::from)
          99  +
                                /* JsonParserGenerator.kt:278 */
   67    100   
                                {
   68    101   
                                    builder = builder.set_default_document_string(v);
   69    102   
                                }
         103  +
                                /* JsonParserGenerator.kt:262 */
   70    104   
                            }
         105  +
                            /* JsonParserGenerator.kt:262 */
   71    106   
                            "defaultDocumentBoolean" => {
   72         -
                                if let Some(v) = Some(
   73         -
                                    ::aws_smithy_json::deserialize::token::expect_document(tokens)?,
         107  +
                                /* JsonParserGenerator.kt:276 */
         108  +
                                if let Some(v) =
         109  +
                                    /* JsonParserGenerator.kt:319 */
         110  +
                                    Some(
         111  +
                                        ::aws_smithy_json::deserialize::token::expect_document(
         112  +
                                            tokens,
         113  +
                                        )?,
   74    114   
                                    )
         115  +
                                    /* PythonServerProtocolLoader.kt:52 */
   75    116   
                                    .map(::aws_smithy_http_server_python::types::Document::from)
         117  +
                                /* JsonParserGenerator.kt:278 */
   76    118   
                                {
   77    119   
                                    builder = builder.set_default_document_boolean(v);
   78    120   
                                }
         121  +
                                /* JsonParserGenerator.kt:262 */
   79    122   
                            }
         123  +
                            /* JsonParserGenerator.kt:262 */
   80    124   
                            "defaultDocumentList" => {
   81         -
                                if let Some(v) = Some(
   82         -
                                    ::aws_smithy_json::deserialize::token::expect_document(tokens)?,
         125  +
                                /* JsonParserGenerator.kt:276 */
         126  +
                                if let Some(v) =
         127  +
                                    /* JsonParserGenerator.kt:319 */
         128  +
                                    Some(
         129  +
                                        ::aws_smithy_json::deserialize::token::expect_document(
         130  +
                                            tokens,
         131  +
                                        )?,
   83    132   
                                    )
         133  +
                                    /* PythonServerProtocolLoader.kt:52 */
   84    134   
                                    .map(::aws_smithy_http_server_python::types::Document::from)
         135  +
                                /* JsonParserGenerator.kt:278 */
   85    136   
                                {
   86    137   
                                    builder = builder.set_default_document_list(v);
   87    138   
                                }
         139  +
                                /* JsonParserGenerator.kt:262 */
   88    140   
                            }
         141  +
                            /* JsonParserGenerator.kt:262 */
   89    142   
                            "defaultNullDocument" => {
   90         -
                                builder = builder.set_default_null_document(
   91         -
                                    Some(::aws_smithy_json::deserialize::token::expect_document(
         143  +
                                /* JsonParserGenerator.kt:272 */
         144  +
                                builder =
         145  +
                                    builder.set_default_null_document(
         146  +
                                        /* JsonParserGenerator.kt:319 */
         147  +
                                        Some(
         148  +
                                            ::aws_smithy_json::deserialize::token::expect_document(
   92    149   
                                                tokens,
   93         -
                                    )?)
   94         -
                                    .map(::aws_smithy_http_server_python::types::Document::from),
         150  +
                                            )?,
         151  +
                                        )
         152  +
                                        /* PythonServerProtocolLoader.kt:52 */
         153  +
                                        .map(
         154  +
                                            ::aws_smithy_http_server_python::types::Document::from,
         155  +
                                        ), /* JsonParserGenerator.kt:272 */
   95    156   
                                    );
         157  +
                                /* JsonParserGenerator.kt:262 */
   96    158   
                            }
         159  +
                            /* JsonParserGenerator.kt:262 */
   97    160   
                            "defaultTimestamp" => {
         161  +
                                /* JsonParserGenerator.kt:276 */
   98    162   
                                if let Some(v) =
   99         -
                                    ::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
  100         -
                                        tokens.next(),
  101         -
                                        ::aws_smithy_types::date_time::Format::EpochSeconds,
  102         -
                                    )?
  103         -
                                    .map(::aws_smithy_http_server_python::types::DateTime::from)
  104         -
                                {
         163  +
                                /* JsonParserGenerator.kt:384 */::aws_smithy_json::deserialize::token::expect_timestamp_or_null(tokens.next(), ::aws_smithy_types::date_time::Format::EpochSeconds)?
         164  +
                                /* PythonServerProtocolLoader.kt:44 */.map(::aws_smithy_http_server_python::types::DateTime::from)
         165  +
                                /* JsonParserGenerator.kt:278 */{
  105    166   
                                                                            builder = builder.set_default_timestamp(v);
  106    167   
                                                                        }
         168  +
                                /* JsonParserGenerator.kt:262 */
  107    169   
                            }
         170  +
                            /* JsonParserGenerator.kt:262 */
  108    171   
                            "defaultBlob" => {
         172  +
                                /* JsonParserGenerator.kt:276 */
  109    173   
                                if let Some(v) =
  110         -
                                    ::aws_smithy_json::deserialize::token::expect_blob_or_null(
  111         -
                                        tokens.next(),
  112         -
                                    )?
  113         -
                                    .map(::aws_smithy_http_server_python::types::Blob::from)
  114         -
                                {
         174  +
                                /* JsonParserGenerator.kt:326 */::aws_smithy_json::deserialize::token::expect_blob_or_null(tokens.next())?
         175  +
                                /* PythonServerProtocolLoader.kt:48 */.map(::aws_smithy_http_server_python::types::Blob::from)
         176  +
                                /* JsonParserGenerator.kt:278 */{
  115    177   
                                                                            builder = builder.set_default_blob(v);
  116    178   
                                                                        }
         179  +
                                /* JsonParserGenerator.kt:262 */
  117    180   
                            }
         181  +
                            /* JsonParserGenerator.kt:262 */
  118    182   
                            "defaultByte" => {
         183  +
                                /* JsonParserGenerator.kt:276 */
  119    184   
                                if let Some(v) =
  120         -
                                    ::aws_smithy_json::deserialize::token::expect_number_or_null(
  121         -
                                        tokens.next(),
  122         -
                                    )?
         185  +
                                /* JsonParserGenerator.kt:365 */::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
  123    186   
                                                    .map(i8::try_from)
  124    187   
                                                    .transpose()?
  125         -
                                {
         188  +
                                /* JsonParserGenerator.kt:278 */{
  126    189   
                                                                            builder = builder.set_default_byte(v);
  127    190   
                                                                        }
         191  +
                                /* JsonParserGenerator.kt:262 */
  128    192   
                            }
         193  +
                            /* JsonParserGenerator.kt:262 */
  129    194   
                            "defaultShort" => {
         195  +
                                /* JsonParserGenerator.kt:276 */
  130    196   
                                if let Some(v) =
  131         -
                                    ::aws_smithy_json::deserialize::token::expect_number_or_null(
  132         -
                                        tokens.next(),
  133         -
                                    )?
         197  +
                                /* JsonParserGenerator.kt:365 */::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
  134    198   
                                                    .map(i16::try_from)
  135    199   
                                                    .transpose()?
  136         -
                                {
         200  +
                                /* JsonParserGenerator.kt:278 */{
  137    201   
                                                                            builder = builder.set_default_short(v);
  138    202   
                                                                        }
         203  +
                                /* JsonParserGenerator.kt:262 */
  139    204   
                            }
         205  +
                            /* JsonParserGenerator.kt:262 */
  140    206   
                            "defaultInteger" => {
         207  +
                                /* JsonParserGenerator.kt:276 */
  141    208   
                                if let Some(v) =
  142         -
                                    ::aws_smithy_json::deserialize::token::expect_number_or_null(
  143         -
                                        tokens.next(),
  144         -
                                    )?
         209  +
                                /* JsonParserGenerator.kt:365 */::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
  145    210   
                                                    .map(i32::try_from)
  146    211   
                                                    .transpose()?
  147         -
                                {
         212  +
                                /* JsonParserGenerator.kt:278 */{
  148    213   
                                                                            builder = builder.set_default_integer(v);
  149    214   
                                                                        }
         215  +
                                /* JsonParserGenerator.kt:262 */
  150    216   
                            }
         217  +
                            /* JsonParserGenerator.kt:262 */
  151    218   
                            "defaultLong" => {
         219  +
                                /* JsonParserGenerator.kt:276 */
  152    220   
                                if let Some(v) =
  153         -
                                    ::aws_smithy_json::deserialize::token::expect_number_or_null(
  154         -
                                        tokens.next(),
  155         -
                                    )?
         221  +
                                /* JsonParserGenerator.kt:365 */::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
  156    222   
                                                    .map(i64::try_from)
  157    223   
                                                    .transpose()?
  158         -
                                {
         224  +
                                /* JsonParserGenerator.kt:278 */{
  159    225   
                                                                            builder = builder.set_default_long(v);
  160    226   
                                                                        }
         227  +
                                /* JsonParserGenerator.kt:262 */
  161    228   
                            }
         229  +
                            /* JsonParserGenerator.kt:262 */
  162    230   
                            "defaultFloat" => {
         231  +
                                /* JsonParserGenerator.kt:276 */
  163    232   
                                if let Some(v) =
  164         -
                                    ::aws_smithy_json::deserialize::token::expect_number_or_null(
  165         -
                                        tokens.next(),
  166         -
                                    )?
  167         -
                                    .map(|v| v.to_f32_lossy())
  168         -
                                {
         233  +
                                /* JsonParserGenerator.kt:361 */::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?.map(|v| v.to_f32_lossy())
         234  +
                                /* JsonParserGenerator.kt:278 */{
  169    235   
                                                                            builder = builder.set_default_float(v);
  170    236   
                                                                        }
         237  +
                                /* JsonParserGenerator.kt:262 */
  171    238   
                            }
         239  +
                            /* JsonParserGenerator.kt:262 */
  172    240   
                            "defaultDouble" => {
         241  +
                                /* JsonParserGenerator.kt:276 */
  173    242   
                                if let Some(v) =
  174         -
                                    ::aws_smithy_json::deserialize::token::expect_number_or_null(
  175         -
                                        tokens.next(),
  176         -
                                    )?
  177         -
                                    .map(|v| v.to_f64_lossy())
  178         -
                                {
         243  +
                                /* JsonParserGenerator.kt:363 */::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?.map(|v| v.to_f64_lossy())
         244  +
                                /* JsonParserGenerator.kt:278 */{
  179    245   
                                                                            builder = builder.set_default_double(v);
  180    246   
                                                                        }
         247  +
                                /* JsonParserGenerator.kt:262 */
  181    248   
                            }
         249  +
                            /* JsonParserGenerator.kt:262 */
  182    250   
                            "defaultMap" => {
         251  +
                                /* JsonParserGenerator.kt:276 */
  183    252   
                                if let Some(v) =
  184         -
                                crate::protocol_serde::shape_test_string_map::de_test_string_map(tokens)?
  185         -
                                {
         253  +
                                /* JsonParserGenerator.kt:509 */crate::protocol_serde::shape_test_string_map::de_test_string_map(tokens)?
         254  +
                                /* JsonParserGenerator.kt:278 */{
  186    255   
                                                                            builder = builder.set_default_map(v);
  187    256   
                                                                        }
         257  +
                                /* JsonParserGenerator.kt:262 */
  188    258   
                            }
         259  +
                            /* JsonParserGenerator.kt:262 */
  189    260   
                            "defaultEnum" => {
         261  +
                                /* JsonParserGenerator.kt:276 */
  190    262   
                                if let Some(v) =
  191         -
                                    ::aws_smithy_json::deserialize::token::expect_string_or_null(
  192         -
                                        tokens.next(),
  193         -
                                    )?
  194         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  195         -
                                    .transpose()?
  196         -
                                {
         263  +
                                /* JsonParserGenerator.kt:354 */::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?.map(|s|
         264  +
                                    /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
         265  +
                                        /* JsonParserGenerator.kt:343 */u.into_owned()
         266  +
                                    /* JsonParserGenerator.kt:339 */)
         267  +
                                /* JsonParserGenerator.kt:354 */).transpose()?
         268  +
                                /* JsonParserGenerator.kt:278 */{
  197    269   
                                                                            builder = builder.set_default_enum(v);
  198    270   
                                                                        }
         271  +
                                /* JsonParserGenerator.kt:262 */
  199    272   
                            }
         273  +
                            /* JsonParserGenerator.kt:262 */
  200    274   
                            "defaultIntEnum" => {
         275  +
                                /* JsonParserGenerator.kt:276 */
  201    276   
                                if let Some(v) =
  202         -
                                    ::aws_smithy_json::deserialize::token::expect_number_or_null(
  203         -
                                        tokens.next(),
  204         -
                                    )?
         277  +
                                /* JsonParserGenerator.kt:365 */::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
  205    278   
                                                    .map(i32::try_from)
  206    279   
                                                    .transpose()?
  207         -
                                {
         280  +
                                /* JsonParserGenerator.kt:278 */{
  208    281   
                                                                            builder = builder.set_default_int_enum(v);
  209    282   
                                                                        }
         283  +
                                /* JsonParserGenerator.kt:262 */
  210    284   
                            }
         285  +
                            /* JsonParserGenerator.kt:262 */
  211    286   
                            "emptyString" => {
         287  +
                                /* JsonParserGenerator.kt:276 */
  212    288   
                                if let Some(v) =
  213         -
                                    ::aws_smithy_json::deserialize::token::expect_string_or_null(
  214         -
                                        tokens.next(),
  215         -
                                    )?
  216         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  217         -
                                    .transpose()?
  218         -
                                {
         289  +
                                /* JsonParserGenerator.kt:354 */::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?.map(|s|
         290  +
                                    /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
         291  +
                                        /* JsonParserGenerator.kt:348 */u.into_owned()
         292  +
                                    /* JsonParserGenerator.kt:339 */)
         293  +
                                /* JsonParserGenerator.kt:354 */).transpose()?
         294  +
                                /* JsonParserGenerator.kt:278 */{
  219    295   
                                                                            builder = builder.set_empty_string(v);
  220    296   
                                                                        }
         297  +
                                /* JsonParserGenerator.kt:262 */
  221    298   
                            }
         299  +
                            /* JsonParserGenerator.kt:262 */
  222    300   
                            "falseBoolean" => {
         301  +
                                /* JsonParserGenerator.kt:276 */
  223    302   
                                if let Some(v) =
  224         -
                                    ::aws_smithy_json::deserialize::token::expect_bool_or_null(
  225         -
                                        tokens.next(),
  226         -
                                    )?
  227         -
                                {
         303  +
                                /* JsonParserGenerator.kt:298 */::aws_smithy_json::deserialize::token::expect_bool_or_null(tokens.next())?
         304  +
                                /* JsonParserGenerator.kt:278 */{
  228    305   
                                                                            builder = builder.set_false_boolean(v);
  229    306   
                                                                        }
         307  +
                                /* JsonParserGenerator.kt:262 */
  230    308   
                            }
         309  +
                            /* JsonParserGenerator.kt:262 */
  231    310   
                            "emptyBlob" => {
         311  +
                                /* JsonParserGenerator.kt:276 */
  232    312   
                                if let Some(v) =
  233         -
                                    ::aws_smithy_json::deserialize::token::expect_blob_or_null(
  234         -
                                        tokens.next(),
  235         -
                                    )?
  236         -
                                    .map(::aws_smithy_http_server_python::types::Blob::from)
  237         -
                                {
         313  +
                                /* JsonParserGenerator.kt:326 */::aws_smithy_json::deserialize::token::expect_blob_or_null(tokens.next())?
         314  +
                                /* PythonServerProtocolLoader.kt:48 */.map(::aws_smithy_http_server_python::types::Blob::from)
         315  +
                                /* JsonParserGenerator.kt:278 */{
  238    316   
                                                                            builder = builder.set_empty_blob(v);
  239    317   
                                                                        }
         318  +
                                /* JsonParserGenerator.kt:262 */
  240    319   
                            }
         320  +
                            /* JsonParserGenerator.kt:262 */
  241    321   
                            "zeroByte" => {
         322  +
                                /* JsonParserGenerator.kt:276 */
  242    323   
                                if let Some(v) =
  243         -
                                    ::aws_smithy_json::deserialize::token::expect_number_or_null(
  244         -
                                        tokens.next(),
  245         -
                                    )?
         324  +
                                /* JsonParserGenerator.kt:365 */::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
  246    325   
                                                    .map(i8::try_from)
  247    326   
                                                    .transpose()?
  248         -
                                {
         327  +
                                /* JsonParserGenerator.kt:278 */{
  249    328   
                                                                            builder = builder.set_zero_byte(v);
  250    329   
                                                                        }
         330  +
                                /* JsonParserGenerator.kt:262 */
  251    331   
                            }
         332  +
                            /* JsonParserGenerator.kt:262 */
  252    333   
                            "zeroShort" => {
         334  +
                                /* JsonParserGenerator.kt:276 */
  253    335   
                                if let Some(v) =
  254         -
                                    ::aws_smithy_json::deserialize::token::expect_number_or_null(
  255         -
                                        tokens.next(),
  256         -
                                    )?
         336  +
                                /* JsonParserGenerator.kt:365 */::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
  257    337   
                                                    .map(i16::try_from)
  258    338   
                                                    .transpose()?
  259         -
                                {
         339  +
                                /* JsonParserGenerator.kt:278 */{
  260    340   
                                                                            builder = builder.set_zero_short(v);
  261    341   
                                                                        }
         342  +
                                /* JsonParserGenerator.kt:262 */
  262    343   
                            }
         344  +
                            /* JsonParserGenerator.kt:262 */
  263    345   
                            "zeroInteger" => {
         346  +
                                /* JsonParserGenerator.kt:276 */
  264    347   
                                if let Some(v) =
  265         -
                                    ::aws_smithy_json::deserialize::token::expect_number_or_null(
  266         -
                                        tokens.next(),
  267         -
                                    )?
         348  +
                                /* JsonParserGenerator.kt:365 */::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
  268    349   
                                                    .map(i32::try_from)
  269    350   
                                                    .transpose()?
  270         -
                                {
         351  +
                                /* JsonParserGenerator.kt:278 */{
  271    352   
                                                                            builder = builder.set_zero_integer(v);
  272    353   
                                                                        }
         354  +
                                /* JsonParserGenerator.kt:262 */
  273    355   
                            }
         356  +
                            /* JsonParserGenerator.kt:262 */
  274    357   
                            "zeroLong" => {
         358  +
                                /* JsonParserGenerator.kt:276 */
  275    359   
                                if let Some(v) =
  276         -
                                    ::aws_smithy_json::deserialize::token::expect_number_or_null(
  277         -
                                        tokens.next(),
  278         -
                                    )?
         360  +
                                /* JsonParserGenerator.kt:365 */::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
  279    361   
                                                    .map(i64::try_from)
  280    362   
                                                    .transpose()?
  281         -
                                {
         363  +
                                /* JsonParserGenerator.kt:278 */{
  282    364   
                                                                            builder = builder.set_zero_long(v);
  283    365   
                                                                        }
         366  +
                                /* JsonParserGenerator.kt:262 */
  284    367   
                            }
         368  +
                            /* JsonParserGenerator.kt:262 */
  285    369   
                            "zeroFloat" => {
         370  +
                                /* JsonParserGenerator.kt:276 */
  286    371   
                                if let Some(v) =
  287         -
                                    ::aws_smithy_json::deserialize::token::expect_number_or_null(
  288         -
                                        tokens.next(),
  289         -
                                    )?
  290         -
                                    .map(|v| v.to_f32_lossy())
  291         -
                                {
         372  +
                                /* JsonParserGenerator.kt:361 */::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?.map(|v| v.to_f32_lossy())
         373  +
                                /* JsonParserGenerator.kt:278 */{
  292    374   
                                                                            builder = builder.set_zero_float(v);
  293    375   
                                                                        }
         376  +
                                /* JsonParserGenerator.kt:262 */
  294    377   
                            }
         378  +
                            /* JsonParserGenerator.kt:262 */
  295    379   
                            "zeroDouble" => {
         380  +
                                /* JsonParserGenerator.kt:276 */
  296    381   
                                if let Some(v) =
  297         -
                                    ::aws_smithy_json::deserialize::token::expect_number_or_null(
  298         -
                                        tokens.next(),
  299         -
                                    )?
  300         -
                                    .map(|v| v.to_f64_lossy())
  301         -
                                {
         382  +
                                /* JsonParserGenerator.kt:363 */::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?.map(|v| v.to_f64_lossy())
         383  +
                                /* JsonParserGenerator.kt:278 */{
  302    384   
                                                                            builder = builder.set_zero_double(v);
  303    385   
                                                                        }
         386  +
                                /* JsonParserGenerator.kt:262 */
  304    387   
                            }
  305         -
                            _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
         388  +
                            /* JsonParserGenerator.kt:290 */
         389  +
                            _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
  306    390   
                        }
         391  +
                        /* JsonParserGenerator.kt:686 */
  307    392   
                    }
         393  +
                    /* JsonParserGenerator.kt:695 */
  308    394   
                    other => {
  309    395   
                        return Err(
  310    396   
                            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
  311    397   
                                format!("expected object key or end object, found: {:?}", other),
  312    398   
                            ),
  313    399   
                        )
         400  +
                    } /* JsonParserGenerator.kt:685 */
  314    401   
                }
         402  +
                /* JsonParserGenerator.kt:684 */
  315    403   
            }
  316         -
            }
         404  +
            /* JsonParserGenerator.kt:540 */
  317    405   
            Ok(Some(builder))
         406  +
            /* JsonParserGenerator.kt:713 */
  318    407   
        }
  319         -
        _ => Err(
         408  +
        /* JsonParserGenerator.kt:722 */
         409  +
        _ => {
         410  +
            /* JsonParserGenerator.kt:723 */
         411  +
            Err(
  320    412   
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
  321    413   
                    "expected start object or null",
  322    414   
                ),
  323         -
        ),
         415  +
            )
         416  +
            /* JsonParserGenerator.kt:722 */
         417  +
        } /* JsonParserGenerator.kt:712 */
  324    418   
    }
         419  +
    /* JsonParserGenerator.kt:516 */
  325    420   
}