Server Test Python

Server Test Python

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943

Files changed:

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

@@ -1,1 +247,448 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
    2      3   
pub fn ser_kitchen_sink_operation_output_output_output(
    3      4   
    value: &crate::output::KitchenSinkOperationOutput,
    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_kitchen_sink_operation_output::ser_kitchen_sink_operation_output_output(&mut object, value)?;
          11  +
    /* JsonSerializerGenerator.kt:227 */
    8     12   
    object.finish();
    9     13   
    Ok(out)
          14  +
    /* JsonSerializerGenerator.kt:213 */
   10     15   
}
   11     16   
          17  +
/* JsonSerializerGenerator.kt:358 */
   12     18   
pub fn ser_kitchen_sink_operation_output_output(
   13     19   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   14     20   
    input: &crate::output::KitchenSinkOperationOutput,
   15     21   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          22  +
    /* JsonSerializerGenerator.kt:382 */
   16     23   
    if let Some(var_1) = &input.blob {
          24  +
        /* JsonSerializerGenerator.kt:439 */
   17     25   
        object
   18     26   
            .key("Blob")
   19     27   
            .string_unchecked(&::aws_smithy_types::base64::encode(var_1));
          28  +
        /* JsonSerializerGenerator.kt:382 */
   20     29   
    }
          30  +
    /* JsonSerializerGenerator.kt:382 */
   21     31   
    if let Some(var_2) = &input.boolean {
          32  +
        /* JsonSerializerGenerator.kt:424 */
   22     33   
        object.key("Boolean").boolean(*var_2);
          34  +
        /* JsonSerializerGenerator.kt:382 */
   23     35   
    }
          36  +
    /* JsonSerializerGenerator.kt:382 */
   24     37   
    if let Some(var_3) = &input.double {
          38  +
        /* JsonSerializerGenerator.kt:432 */
   25     39   
        object.key("Double").number(
   26     40   
            #[allow(clippy::useless_conversion)]
   27     41   
            ::aws_smithy_types::Number::Float((*var_3).into()),
   28     42   
        );
          43  +
        /* JsonSerializerGenerator.kt:382 */
   29     44   
    }
          45  +
    /* JsonSerializerGenerator.kt:382 */
   30     46   
    if let Some(var_4) = &input.empty_struct {
          47  +
        /* JsonSerializerGenerator.kt:495 */
   31     48   
        #[allow(unused_mut)]
          49  +
        /* JsonSerializerGenerator.kt:496 */
   32     50   
        let mut object_5 = object.key("EmptyStruct").start_object();
          51  +
        /* JsonSerializerGenerator.kt:375 */
   33     52   
        crate::protocol_serde::shape_empty_struct::ser_empty_struct(&mut object_5, var_4)?;
          53  +
        /* JsonSerializerGenerator.kt:515 */
   34     54   
        object_5.finish();
          55  +
        /* JsonSerializerGenerator.kt:382 */
   35     56   
    }
          57  +
    /* JsonSerializerGenerator.kt:382 */
   36     58   
    if let Some(var_6) = &input.float {
          59  +
        /* JsonSerializerGenerator.kt:432 */
   37     60   
        object.key("Float").number(
   38     61   
            #[allow(clippy::useless_conversion)]
   39     62   
            ::aws_smithy_types::Number::Float((*var_6).into()),
   40     63   
        );
          64  +
        /* JsonSerializerGenerator.kt:382 */
   41     65   
    }
          66  +
    /* JsonSerializerGenerator.kt:382 */
   42     67   
    if let Some(var_7) = &input.httpdate_timestamp {
          68  +
        /* JsonSerializerGenerator.kt:448 */
   43     69   
        object
   44     70   
            .key("HttpdateTimestamp")
   45     71   
            .date_time(var_7, ::aws_smithy_types::date_time::Format::HttpDate)?;
          72  +
        /* JsonSerializerGenerator.kt:382 */
   46     73   
    }
          74  +
    /* JsonSerializerGenerator.kt:382 */
   47     75   
    if let Some(var_8) = &input.integer {
          76  +
        /* JsonSerializerGenerator.kt:432 */
   48     77   
        object.key("Integer").number(
   49     78   
            #[allow(clippy::useless_conversion)]
   50     79   
            ::aws_smithy_types::Number::NegInt((*var_8).into()),
   51     80   
        );
          81  +
        /* JsonSerializerGenerator.kt:382 */
   52     82   
    }
          83  +
    /* JsonSerializerGenerator.kt:382 */
   53     84   
    if let Some(var_9) = &input.iso8601_timestamp {
          85  +
        /* JsonSerializerGenerator.kt:448 */
   54     86   
        object
   55     87   
            .key("Iso8601Timestamp")
   56     88   
            .date_time(var_9, ::aws_smithy_types::date_time::Format::DateTime)?;
          89  +
        /* JsonSerializerGenerator.kt:382 */
   57     90   
    }
          91  +
    /* JsonSerializerGenerator.kt:382 */
   58     92   
    if let Some(var_10) = &input.json_value {
          93  +
        /* JsonSerializerGenerator.kt:423 */
   59     94   
        object.key("JsonValue").string(var_10.as_str());
          95  +
        /* JsonSerializerGenerator.kt:382 */
   60     96   
    }
          97  +
    /* JsonSerializerGenerator.kt:382 */
   61     98   
    if let Some(var_11) = &input.list_of_lists {
          99  +
        /* JsonSerializerGenerator.kt:484 */
   62    100   
        let mut array_12 = object.key("ListOfLists").start_array();
         101  +
        /* JsonSerializerGenerator.kt:524 */
   63    102   
        for item_13 in var_11 {
         103  +
            /* SerializerUtil.kt:42 */
   64    104   
            {
         105  +
                /* JsonSerializerGenerator.kt:484 */
   65    106   
                let mut array_14 = array_12.value().start_array();
         107  +
                /* JsonSerializerGenerator.kt:524 */
   66    108   
                for item_15 in item_13 {
         109  +
                    /* SerializerUtil.kt:42 */
   67    110   
                    {
         111  +
                        /* JsonSerializerGenerator.kt:423 */
   68    112   
                        array_14.value().string(item_15.as_str());
         113  +
                        /* SerializerUtil.kt:42 */
   69    114   
                    }
         115  +
                    /* JsonSerializerGenerator.kt:524 */
   70    116   
                }
         117  +
                /* JsonSerializerGenerator.kt:486 */
   71    118   
                array_14.finish();
         119  +
                /* SerializerUtil.kt:42 */
   72    120   
            }
         121  +
            /* JsonSerializerGenerator.kt:524 */
   73    122   
        }
         123  +
        /* JsonSerializerGenerator.kt:486 */
   74    124   
        array_12.finish();
         125  +
        /* JsonSerializerGenerator.kt:382 */
   75    126   
    }
         127  +
    /* JsonSerializerGenerator.kt:382 */
   76    128   
    if let Some(var_16) = &input.list_of_maps_of_strings {
         129  +
        /* JsonSerializerGenerator.kt:484 */
   77    130   
        let mut array_17 = object.key("ListOfMapsOfStrings").start_array();
         131  +
        /* JsonSerializerGenerator.kt:524 */
   78    132   
        for item_18 in var_16 {
         133  +
            /* SerializerUtil.kt:42 */
   79    134   
            {
         135  +
                /* JsonSerializerGenerator.kt:495 */
   80    136   
                #[allow(unused_mut)]
         137  +
                /* JsonSerializerGenerator.kt:496 */
   81    138   
                let mut object_19 = array_17.value().start_object();
         139  +
                /* JsonSerializerGenerator.kt:537 */
   82    140   
                for (key_20, value_21) in item_18 {
         141  +
                    /* SerializerUtil.kt:42 */
   83    142   
                    {
         143  +
                        /* JsonSerializerGenerator.kt:423 */
   84    144   
                        object_19.key(key_20.as_str()).string(value_21.as_str());
         145  +
                        /* SerializerUtil.kt:42 */
   85    146   
                    }
         147  +
                    /* JsonSerializerGenerator.kt:537 */
   86    148   
                }
         149  +
                /* JsonSerializerGenerator.kt:515 */
   87    150   
                object_19.finish();
         151  +
                /* SerializerUtil.kt:42 */
   88    152   
            }
         153  +
            /* JsonSerializerGenerator.kt:524 */
   89    154   
        }
         155  +
        /* JsonSerializerGenerator.kt:486 */
   90    156   
        array_17.finish();
         157  +
        /* JsonSerializerGenerator.kt:382 */
   91    158   
    }
         159  +
    /* JsonSerializerGenerator.kt:382 */
   92    160   
    if let Some(var_22) = &input.list_of_strings {
         161  +
        /* JsonSerializerGenerator.kt:484 */
   93    162   
        let mut array_23 = object.key("ListOfStrings").start_array();
         163  +
        /* JsonSerializerGenerator.kt:524 */
   94    164   
        for item_24 in var_22 {
         165  +
            /* SerializerUtil.kt:42 */
   95    166   
            {
         167  +
                /* JsonSerializerGenerator.kt:423 */
   96    168   
                array_23.value().string(item_24.as_str());
         169  +
                /* SerializerUtil.kt:42 */
   97    170   
            }
         171  +
            /* JsonSerializerGenerator.kt:524 */
   98    172   
        }
         173  +
        /* JsonSerializerGenerator.kt:486 */
   99    174   
        array_23.finish();
         175  +
        /* JsonSerializerGenerator.kt:382 */
  100    176   
    }
         177  +
    /* JsonSerializerGenerator.kt:382 */
  101    178   
    if let Some(var_25) = &input.list_of_structs {
         179  +
        /* JsonSerializerGenerator.kt:484 */
  102    180   
        let mut array_26 = object.key("ListOfStructs").start_array();
         181  +
        /* JsonSerializerGenerator.kt:524 */
  103    182   
        for item_27 in var_25 {
         183  +
            /* SerializerUtil.kt:42 */
  104    184   
            {
         185  +
                /* JsonSerializerGenerator.kt:495 */
  105    186   
                #[allow(unused_mut)]
         187  +
                /* JsonSerializerGenerator.kt:496 */
  106    188   
                let mut object_28 = array_26.value().start_object();
         189  +
                /* JsonSerializerGenerator.kt:375 */
  107    190   
                crate::protocol_serde::shape_simple_struct::ser_simple_struct(
  108    191   
                    &mut object_28,
  109    192   
                    item_27,
  110    193   
                )?;
         194  +
                /* JsonSerializerGenerator.kt:515 */
  111    195   
                object_28.finish();
         196  +
                /* SerializerUtil.kt:42 */
  112    197   
            }
         198  +
            /* JsonSerializerGenerator.kt:524 */
  113    199   
        }
         200  +
        /* JsonSerializerGenerator.kt:486 */
  114    201   
        array_26.finish();
         202  +
        /* JsonSerializerGenerator.kt:382 */
  115    203   
    }
         204  +
    /* JsonSerializerGenerator.kt:382 */
  116    205   
    if let Some(var_29) = &input.long {
         206  +
        /* JsonSerializerGenerator.kt:432 */
  117    207   
        object.key("Long").number(
  118    208   
            #[allow(clippy::useless_conversion)]
  119    209   
            ::aws_smithy_types::Number::NegInt((*var_29).into()),
  120    210   
        );
         211  +
        /* JsonSerializerGenerator.kt:382 */
  121    212   
    }
         213  +
    /* JsonSerializerGenerator.kt:382 */
  122    214   
    if let Some(var_30) = &input.map_of_lists_of_strings {
         215  +
        /* JsonSerializerGenerator.kt:495 */
  123    216   
        #[allow(unused_mut)]
         217  +
        /* JsonSerializerGenerator.kt:496 */
  124    218   
        let mut object_31 = object.key("MapOfListsOfStrings").start_object();
         219  +
        /* JsonSerializerGenerator.kt:537 */
  125    220   
        for (key_32, value_33) in var_30 {
         221  +
            /* SerializerUtil.kt:42 */
  126    222   
            {
         223  +
                /* JsonSerializerGenerator.kt:484 */
  127    224   
                let mut array_34 = object_31.key(key_32.as_str()).start_array();
         225  +
                /* JsonSerializerGenerator.kt:524 */
  128    226   
                for item_35 in value_33 {
         227  +
                    /* SerializerUtil.kt:42 */
  129    228   
                    {
         229  +
                        /* JsonSerializerGenerator.kt:423 */
  130    230   
                        array_34.value().string(item_35.as_str());
         231  +
                        /* SerializerUtil.kt:42 */
  131    232   
                    }
         233  +
                    /* JsonSerializerGenerator.kt:524 */
  132    234   
                }
         235  +
                /* JsonSerializerGenerator.kt:486 */
  133    236   
                array_34.finish();
         237  +
                /* SerializerUtil.kt:42 */
  134    238   
            }
         239  +
            /* JsonSerializerGenerator.kt:537 */
  135    240   
        }
         241  +
        /* JsonSerializerGenerator.kt:515 */
  136    242   
        object_31.finish();
         243  +
        /* JsonSerializerGenerator.kt:382 */
  137    244   
    }
         245  +
    /* JsonSerializerGenerator.kt:382 */
  138    246   
    if let Some(var_36) = &input.map_of_maps {
         247  +
        /* JsonSerializerGenerator.kt:495 */
  139    248   
        #[allow(unused_mut)]
         249  +
        /* JsonSerializerGenerator.kt:496 */
  140    250   
        let mut object_37 = object.key("MapOfMaps").start_object();
         251  +
        /* JsonSerializerGenerator.kt:537 */
  141    252   
        for (key_38, value_39) in var_36 {
         253  +
            /* SerializerUtil.kt:42 */
  142    254   
            {
         255  +
                /* JsonSerializerGenerator.kt:495 */
  143    256   
                #[allow(unused_mut)]
         257  +
                /* JsonSerializerGenerator.kt:496 */
  144    258   
                let mut object_40 = object_37.key(key_38.as_str()).start_object();
         259  +
                /* JsonSerializerGenerator.kt:537 */
  145    260   
                for (key_41, value_42) in value_39 {
         261  +
                    /* SerializerUtil.kt:42 */
  146    262   
                    {
         263  +
                        /* JsonSerializerGenerator.kt:423 */
  147    264   
                        object_40.key(key_41.as_str()).string(value_42.as_str());
         265  +
                        /* SerializerUtil.kt:42 */
  148    266   
                    }
         267  +
                    /* JsonSerializerGenerator.kt:537 */
  149    268   
                }
         269  +
                /* JsonSerializerGenerator.kt:515 */
  150    270   
                object_40.finish();
         271  +
                /* SerializerUtil.kt:42 */
  151    272   
            }
         273  +
            /* JsonSerializerGenerator.kt:537 */
  152    274   
        }
         275  +
        /* JsonSerializerGenerator.kt:515 */
  153    276   
        object_37.finish();
         277  +
        /* JsonSerializerGenerator.kt:382 */
  154    278   
    }
         279  +
    /* JsonSerializerGenerator.kt:382 */
  155    280   
    if let Some(var_43) = &input.map_of_strings {
         281  +
        /* JsonSerializerGenerator.kt:495 */
  156    282   
        #[allow(unused_mut)]
         283  +
        /* JsonSerializerGenerator.kt:496 */
  157    284   
        let mut object_44 = object.key("MapOfStrings").start_object();
         285  +
        /* JsonSerializerGenerator.kt:537 */
  158    286   
        for (key_45, value_46) in var_43 {
         287  +
            /* SerializerUtil.kt:42 */
  159    288   
            {
         289  +
                /* JsonSerializerGenerator.kt:423 */
  160    290   
                object_44.key(key_45.as_str()).string(value_46.as_str());
         291  +
                /* SerializerUtil.kt:42 */
  161    292   
            }
         293  +
            /* JsonSerializerGenerator.kt:537 */
  162    294   
        }
         295  +
        /* JsonSerializerGenerator.kt:515 */
  163    296   
        object_44.finish();
         297  +
        /* JsonSerializerGenerator.kt:382 */
  164    298   
    }
         299  +
    /* JsonSerializerGenerator.kt:382 */
  165    300   
    if let Some(var_47) = &input.map_of_structs {
         301  +
        /* JsonSerializerGenerator.kt:495 */
  166    302   
        #[allow(unused_mut)]
         303  +
        /* JsonSerializerGenerator.kt:496 */
  167    304   
        let mut object_48 = object.key("MapOfStructs").start_object();
         305  +
        /* JsonSerializerGenerator.kt:537 */
  168    306   
        for (key_49, value_50) in var_47 {
         307  +
            /* SerializerUtil.kt:42 */
  169    308   
            {
         309  +
                /* JsonSerializerGenerator.kt:495 */
  170    310   
                #[allow(unused_mut)]
         311  +
                /* JsonSerializerGenerator.kt:496 */
  171    312   
                let mut object_51 = object_48.key(key_49.as_str()).start_object();
         313  +
                /* JsonSerializerGenerator.kt:375 */
  172    314   
                crate::protocol_serde::shape_simple_struct::ser_simple_struct(
  173    315   
                    &mut object_51,
  174    316   
                    value_50,
  175    317   
                )?;
         318  +
                /* JsonSerializerGenerator.kt:515 */
  176    319   
                object_51.finish();
         320  +
                /* SerializerUtil.kt:42 */
  177    321   
            }
         322  +
            /* JsonSerializerGenerator.kt:537 */
  178    323   
        }
         324  +
        /* JsonSerializerGenerator.kt:515 */
  179    325   
        object_48.finish();
         326  +
        /* JsonSerializerGenerator.kt:382 */
  180    327   
    }
         328  +
    /* JsonSerializerGenerator.kt:382 */
  181    329   
    if let Some(var_52) = &input.recursive_list {
         330  +
        /* JsonSerializerGenerator.kt:484 */
  182    331   
        let mut array_53 = object.key("RecursiveList").start_array();
         332  +
        /* JsonSerializerGenerator.kt:524 */
  183    333   
        for item_54 in var_52 {
         334  +
            /* SerializerUtil.kt:42 */
  184    335   
            {
         336  +
                /* JsonSerializerGenerator.kt:495 */
  185    337   
                #[allow(unused_mut)]
         338  +
                /* JsonSerializerGenerator.kt:496 */
  186    339   
                let mut object_55 = array_53.value().start_object();
         340  +
                /* JsonSerializerGenerator.kt:375 */
  187    341   
                crate::protocol_serde::shape_kitchen_sink::ser_kitchen_sink(
  188    342   
                    &mut object_55,
  189    343   
                    item_54,
  190    344   
                )?;
         345  +
                /* JsonSerializerGenerator.kt:515 */
  191    346   
                object_55.finish();
         347  +
                /* SerializerUtil.kt:42 */
  192    348   
            }
         349  +
            /* JsonSerializerGenerator.kt:524 */
  193    350   
        }
         351  +
        /* JsonSerializerGenerator.kt:486 */
  194    352   
        array_53.finish();
         353  +
        /* JsonSerializerGenerator.kt:382 */
  195    354   
    }
         355  +
    /* JsonSerializerGenerator.kt:382 */
  196    356   
    if let Some(var_56) = &input.recursive_map {
         357  +
        /* JsonSerializerGenerator.kt:495 */
  197    358   
        #[allow(unused_mut)]
         359  +
        /* JsonSerializerGenerator.kt:496 */
  198    360   
        let mut object_57 = object.key("RecursiveMap").start_object();
         361  +
        /* JsonSerializerGenerator.kt:537 */
  199    362   
        for (key_58, value_59) in var_56 {
         363  +
            /* SerializerUtil.kt:42 */
  200    364   
            {
         365  +
                /* JsonSerializerGenerator.kt:495 */
  201    366   
                #[allow(unused_mut)]
         367  +
                /* JsonSerializerGenerator.kt:496 */
  202    368   
                let mut object_60 = object_57.key(key_58.as_str()).start_object();
         369  +
                /* JsonSerializerGenerator.kt:375 */
  203    370   
                crate::protocol_serde::shape_kitchen_sink::ser_kitchen_sink(
  204    371   
                    &mut object_60,
  205    372   
                    value_59,
  206    373   
                )?;
         374  +
                /* JsonSerializerGenerator.kt:515 */
  207    375   
                object_60.finish();
         376  +
                /* SerializerUtil.kt:42 */
  208    377   
            }
         378  +
            /* JsonSerializerGenerator.kt:537 */
  209    379   
        }
         380  +
        /* JsonSerializerGenerator.kt:515 */
  210    381   
        object_57.finish();
         382  +
        /* JsonSerializerGenerator.kt:382 */
  211    383   
    }
         384  +
    /* JsonSerializerGenerator.kt:382 */
  212    385   
    if let Some(var_61) = &input.recursive_struct {
         386  +
        /* JsonSerializerGenerator.kt:495 */
  213    387   
        #[allow(unused_mut)]
         388  +
        /* JsonSerializerGenerator.kt:496 */
  214    389   
        let mut object_62 = object.key("RecursiveStruct").start_object();
         390  +
        /* JsonSerializerGenerator.kt:375 */
  215    391   
        crate::protocol_serde::shape_kitchen_sink::ser_kitchen_sink(&mut object_62, var_61)?;
         392  +
        /* JsonSerializerGenerator.kt:515 */
  216    393   
        object_62.finish();
         394  +
        /* JsonSerializerGenerator.kt:382 */
  217    395   
    }
         396  +
    /* JsonSerializerGenerator.kt:382 */
  218    397   
    if let Some(var_63) = &input.simple_struct {
         398  +
        /* JsonSerializerGenerator.kt:495 */
  219    399   
        #[allow(unused_mut)]
         400  +
        /* JsonSerializerGenerator.kt:496 */
  220    401   
        let mut object_64 = object.key("SimpleStruct").start_object();
         402  +
        /* JsonSerializerGenerator.kt:375 */
  221    403   
        crate::protocol_serde::shape_simple_struct::ser_simple_struct(&mut object_64, var_63)?;
         404  +
        /* JsonSerializerGenerator.kt:515 */
  222    405   
        object_64.finish();
         406  +
        /* JsonSerializerGenerator.kt:382 */
  223    407   
    }
         408  +
    /* JsonSerializerGenerator.kt:382 */
  224    409   
    if let Some(var_65) = &input.string {
         410  +
        /* JsonSerializerGenerator.kt:423 */
  225    411   
        object.key("String").string(var_65.as_str());
         412  +
        /* JsonSerializerGenerator.kt:382 */
  226    413   
    }
         414  +
    /* JsonSerializerGenerator.kt:382 */
  227    415   
    if let Some(var_66) = &input.struct_with_json_name {
         416  +
        /* JsonSerializerGenerator.kt:495 */
  228    417   
        #[allow(unused_mut)]
         418  +
        /* JsonSerializerGenerator.kt:496 */
  229    419   
        let mut object_67 = object.key("StructWithJsonName").start_object();
         420  +
        /* JsonSerializerGenerator.kt:375 */
  230    421   
        crate::protocol_serde::shape_struct_with_json_name::ser_struct_with_json_name(
  231    422   
            &mut object_67,
  232    423   
            var_66,
  233    424   
        )?;
         425  +
        /* JsonSerializerGenerator.kt:515 */
  234    426   
        object_67.finish();
         427  +
        /* JsonSerializerGenerator.kt:382 */
  235    428   
    }
         429  +
    /* JsonSerializerGenerator.kt:382 */
  236    430   
    if let Some(var_68) = &input.timestamp {
         431  +
        /* JsonSerializerGenerator.kt:448 */
  237    432   
        object
  238    433   
            .key("Timestamp")
  239    434   
            .date_time(var_68, ::aws_smithy_types::date_time::Format::EpochSeconds)?;
         435  +
        /* JsonSerializerGenerator.kt:382 */
  240    436   
    }
         437  +
    /* JsonSerializerGenerator.kt:382 */
  241    438   
    if let Some(var_69) = &input.unix_timestamp {
         439  +
        /* JsonSerializerGenerator.kt:448 */
  242    440   
        object
  243    441   
            .key("UnixTimestamp")
  244    442   
            .date_time(var_69, ::aws_smithy_types::date_time::Format::EpochSeconds)?;
         443  +
        /* JsonSerializerGenerator.kt:382 */
  245    444   
    }
         445  +
    /* JsonSerializerGenerator.kt:372 */
  246    446   
    Ok(())
         447  +
    /* JsonSerializerGenerator.kt:358 */
  247    448   
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@@ -1,1 +200,337 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:551 */
    2      3   
pub(crate) fn de_my_union<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<crate::unconstrained::my_union_unconstrained::MyUnionUnconstrained>,
    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:565 */
   16     18   
    let mut variant = None;
          19  +
    /* JsonParserGenerator.kt:567 */
   17     20   
    match tokens.next().transpose()? {
          21  +
        /* JsonParserGenerator.kt:568 */
   18     22   
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => return Ok(None),
   19         -
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => loop {
   20         -
            match tokens.next().transpose()? {
   21         -
                Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   22         -
                Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
   23         -
                    if let ::std::option::Option::Some(::std::result::Result::Ok(
   24         -
                        ::aws_smithy_json::deserialize::Token::ValueNull { .. },
   25         -
                    )) = tokens.peek()
   26         -
                    {
   27         -
                        let _ = tokens.next().expect("peek returned a token")?;
   28         -
                        continue;
   29         -
                    }
   30         -
                    let key = key.to_unescaped()?;
   31         -
                    if key == "__type" {
   32         -
                        ::aws_smithy_json::deserialize::token::skip_value(tokens)?;
   33         -
                        continue;
   34         -
                    }
   35         -
                    if variant.is_some() {
   36         -
                        return Err(
   37         -
                            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   38         -
                                "encountered mixed variants in union",
   39         -
                            ),
   40         -
                        );
   41         -
                    }
   42         -
                    variant = match key.as_ref() {
          23  +
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
          24  +
            /* JsonParserGenerator.kt:684 */
          25  +
            loop {
          26  +
                /* JsonParserGenerator.kt:685 */
          27  +
                match tokens.next().transpose()? {
          28  +
                    /* JsonParserGenerator.kt:686 */
          29  +
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
          30  +
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
          31  +
                        /* JsonParserGenerator.kt:576 */
          32  +
                        if let ::std::option::Option::Some(::std::result::Result::Ok(
          33  +
                            ::aws_smithy_json::deserialize::Token::ValueNull { .. },
          34  +
                        )) = tokens.peek()
          35  +
                        {
          36  +
                            let _ = tokens.next().expect("peek returned a token")?;
          37  +
                            continue;
          38  +
                        }
          39  +
                        /* JsonParserGenerator.kt:585 */
          40  +
                        let key = key.to_unescaped()?;
          41  +
                        if key == "__type" {
          42  +
                            ::aws_smithy_json::deserialize::token::skip_value(tokens)?;
          43  +
                            continue;
          44  +
                        }
          45  +
                        if variant.is_some() {
          46  +
                            return Err(
          47  +
                                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
          48  +
                                    "encountered mixed variants in union",
          49  +
                                ),
          50  +
                            );
          51  +
                        }
          52  +
                        /* JsonParserGenerator.kt:598 */
          53  +
                        variant = match key.as_ref() {
          54  +
                            /* JsonParserGenerator.kt:601 */
   43     55   
                            "stringValue" => {
          56  +
                                /* JsonParserGenerator.kt:611 */
   44     57   
                                Some(crate::unconstrained::my_union_unconstrained::MyUnionUnconstrained::StringValue(
   45         -
                                    ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?.map(|s|
   46         -
                                        s.to_unescaped().map(|u|
   47         -
                                            u.into_owned()
   48         -
                                        )
   49         -
                                    ).transpose()?
   50         -
                                    .ok_or_else(|| ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'stringValue' cannot be null"))?
   51         -
                                ))
          58  +
                                    /* JsonParserGenerator.kt:354 */::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?.map(|s|
          59  +
                                        /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          60  +
                                            /* JsonParserGenerator.kt:348 */u.into_owned()
          61  +
                                        /* JsonParserGenerator.kt:339 */)
          62  +
                                    /* JsonParserGenerator.kt:354 */).transpose()?
          63  +
                                    /* JsonParserGenerator.kt:670 */.ok_or_else(|| ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'stringValue' cannot be null"))?
          64  +
                                /* JsonParserGenerator.kt:611 */))
          65  +
                                /* JsonParserGenerator.kt:601 */
   52     66   
                            }
          67  +
                            /* JsonParserGenerator.kt:601 */
   53     68   
                            "booleanValue" => {
          69  +
                                /* JsonParserGenerator.kt:611 */
   54     70   
                                Some(crate::unconstrained::my_union_unconstrained::MyUnionUnconstrained::BooleanValue(
   55         -
                                    ::aws_smithy_json::deserialize::token::expect_bool_or_null(tokens.next())?
   56         -
                                    .ok_or_else(|| ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'booleanValue' cannot be null"))?
   57         -
                                ))
          71  +
                                    /* JsonParserGenerator.kt:298 */::aws_smithy_json::deserialize::token::expect_bool_or_null(tokens.next())?
          72  +
                                    /* JsonParserGenerator.kt:670 */.ok_or_else(|| ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'booleanValue' cannot be null"))?
          73  +
                                /* JsonParserGenerator.kt:611 */))
          74  +
                                /* JsonParserGenerator.kt:601 */
   58     75   
                            }
          76  +
                            /* JsonParserGenerator.kt:601 */
   59     77   
                            "numberValue" => {
          78  +
                                /* JsonParserGenerator.kt:611 */
   60     79   
                                Some(crate::unconstrained::my_union_unconstrained::MyUnionUnconstrained::NumberValue(
   61         -
                                    ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
          80  +
                                    /* JsonParserGenerator.kt:365 */::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
   62     81   
                                                        .map(i32::try_from)
   63     82   
                                                        .transpose()?
   64         -
                                    .ok_or_else(|| ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'numberValue' cannot be null"))?
   65         -
                                ))
          83  +
                                    /* JsonParserGenerator.kt:670 */.ok_or_else(|| ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'numberValue' cannot be null"))?
          84  +
                                /* JsonParserGenerator.kt:611 */))
          85  +
                                /* JsonParserGenerator.kt:601 */
   66     86   
                            }
          87  +
                            /* JsonParserGenerator.kt:601 */
   67     88   
                            "blobValue" => {
          89  +
                                /* JsonParserGenerator.kt:611 */
   68     90   
                                Some(crate::unconstrained::my_union_unconstrained::MyUnionUnconstrained::BlobValue(
   69         -
                                    ::aws_smithy_json::deserialize::token::expect_blob_or_null(tokens.next())?
   70         -
                                    .map(::aws_smithy_http_server_python::types::Blob::from)
   71         -
                                    .ok_or_else(|| ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'blobValue' cannot be null"))?
   72         -
                                ))
          91  +
                                    /* JsonParserGenerator.kt:326 */::aws_smithy_json::deserialize::token::expect_blob_or_null(tokens.next())?
          92  +
                                    /* PythonServerProtocolLoader.kt:48 */.map(::aws_smithy_http_server_python::types::Blob::from)
          93  +
                                    /* JsonParserGenerator.kt:670 */.ok_or_else(|| ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'blobValue' cannot be null"))?
          94  +
                                /* JsonParserGenerator.kt:611 */))
          95  +
                                /* JsonParserGenerator.kt:601 */
   73     96   
                            }
          97  +
                            /* JsonParserGenerator.kt:601 */
   74     98   
                            "timestampValue" => {
          99  +
                                /* JsonParserGenerator.kt:611 */
   75    100   
                                Some(crate::unconstrained::my_union_unconstrained::MyUnionUnconstrained::TimestampValue(
   76         -
                                    ::aws_smithy_json::deserialize::token::expect_timestamp_or_null(tokens.next(), ::aws_smithy_types::date_time::Format::EpochSeconds)?
   77         -
                                    .map(::aws_smithy_http_server_python::types::DateTime::from)
   78         -
                                    .ok_or_else(|| ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'timestampValue' cannot be null"))?
   79         -
                                ))
         101  +
                                    /* JsonParserGenerator.kt:384 */::aws_smithy_json::deserialize::token::expect_timestamp_or_null(tokens.next(), ::aws_smithy_types::date_time::Format::EpochSeconds)?
         102  +
                                    /* PythonServerProtocolLoader.kt:44 */.map(::aws_smithy_http_server_python::types::DateTime::from)
         103  +
                                    /* JsonParserGenerator.kt:670 */.ok_or_else(|| ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'timestampValue' cannot be null"))?
         104  +
                                /* JsonParserGenerator.kt:611 */))
         105  +
                                /* JsonParserGenerator.kt:601 */
   80    106   
                            }
         107  +
                            /* JsonParserGenerator.kt:601 */
   81    108   
                            "enumValue" => {
         109  +
                                /* JsonParserGenerator.kt:611 */
   82    110   
                                Some(crate::unconstrained::my_union_unconstrained::MyUnionUnconstrained::EnumValue(
   83         -
                                    ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?.map(|s|
   84         -
                                        s.to_unescaped().map(|u|
   85         -
                                            u.into_owned()
   86         -
                                        )
   87         -
                                    ).transpose()?
   88         -
                                    .ok_or_else(|| ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'enumValue' cannot be null"))?
   89         -
                                ))
         111  +
                                    /* JsonParserGenerator.kt:354 */::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?.map(|s|
         112  +
                                        /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
         113  +
                                            /* JsonParserGenerator.kt:343 */u.into_owned()
         114  +
                                        /* JsonParserGenerator.kt:339 */)
         115  +
                                    /* JsonParserGenerator.kt:354 */).transpose()?
         116  +
                                    /* JsonParserGenerator.kt:670 */.ok_or_else(|| ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'enumValue' cannot be null"))?
         117  +
                                /* JsonParserGenerator.kt:611 */))
         118  +
                                /* JsonParserGenerator.kt:601 */
   90    119   
                            }
         120  +
                            /* JsonParserGenerator.kt:601 */
   91    121   
                            "listValue" => {
         122  +
                                /* JsonParserGenerator.kt:611 */
   92    123   
                                Some(crate::unconstrained::my_union_unconstrained::MyUnionUnconstrained::ListValue(
   93         -
                                    crate::protocol_serde::shape_string_list::de_string_list(tokens)?
   94         -
                                    .ok_or_else(|| ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'listValue' cannot be null"))?
   95         -
                                ))
         124  +
                                    /* JsonParserGenerator.kt:451 */crate::protocol_serde::shape_string_list::de_string_list(tokens)?
         125  +
                                    /* JsonParserGenerator.kt:670 */.ok_or_else(|| ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'listValue' cannot be null"))?
         126  +
                                /* JsonParserGenerator.kt:611 */))
         127  +
                                /* JsonParserGenerator.kt:601 */
   96    128   
                            }
         129  +
                            /* JsonParserGenerator.kt:601 */
   97    130   
                            "mapValue" => {
         131  +
                                /* JsonParserGenerator.kt:611 */
   98    132   
                                Some(crate::unconstrained::my_union_unconstrained::MyUnionUnconstrained::MapValue(
   99         -
                                    crate::protocol_serde::shape_string_map::de_string_map(tokens)?
  100         -
                                    .ok_or_else(|| ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'mapValue' cannot be null"))?
  101         -
                                ))
         133  +
                                    /* JsonParserGenerator.kt:509 */crate::protocol_serde::shape_string_map::de_string_map(tokens)?
         134  +
                                    /* JsonParserGenerator.kt:670 */.ok_or_else(|| ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'mapValue' cannot be null"))?
         135  +
                                /* JsonParserGenerator.kt:611 */))
         136  +
                                /* JsonParserGenerator.kt:601 */
  102    137   
                            }
         138  +
                            /* JsonParserGenerator.kt:601 */
  103    139   
                            "structureValue" => {
         140  +
                                /* JsonParserGenerator.kt:611 */
  104    141   
                                Some(crate::unconstrained::my_union_unconstrained::MyUnionUnconstrained::StructureValue(
  105         -
                                    crate::protocol_serde::shape_greeting_struct::de_greeting_struct(tokens)?
  106         -
                                    .ok_or_else(|| ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'structureValue' cannot be null"))?
  107         -
                                ))
         142  +
                                    /* JsonParserGenerator.kt:544 */crate::protocol_serde::shape_greeting_struct::de_greeting_struct(tokens)?
         143  +
                                    /* JsonParserGenerator.kt:670 */.ok_or_else(|| ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'structureValue' cannot be null"))?
         144  +
                                /* JsonParserGenerator.kt:611 */))
         145  +
                                /* JsonParserGenerator.kt:601 */
  108    146   
                            }
  109         -
                            variant => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("unexpected union variant: {}", variant)))
         147  +
                            /* JsonParserGenerator.kt:634 */
         148  +
                            variant => {
         149  +
                                return Err(
         150  +
                                    ::aws_smithy_json::deserialize::error::DeserializeError::custom(
         151  +
                                        format!("unexpected union variant: {}", variant),
         152  +
                                    ),
         153  +
                                )
         154  +
                            } /* JsonParserGenerator.kt:598 */
  110    155   
                        };
         156  +
                        /* JsonParserGenerator.kt:686 */
         157  +
                    }
         158  +
                    /* JsonParserGenerator.kt:695 */
         159  +
                    other => {
         160  +
                        return Err(
         161  +
                            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
         162  +
                                format!("expected object key or end object, found: {:?}", other),
         163  +
                            ),
         164  +
                        )
         165  +
                    } /* JsonParserGenerator.kt:685 */
  111    166   
                }
  112         -
                other => {
  113         -
                    return Err(
  114         -
                        ::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  115         -
                            "expected object key or end object, found: {:?}",
  116         -
                            other
  117         -
                        )),
  118         -
                    )
  119         -
                }
         167  +
                /* JsonParserGenerator.kt:684 */
  120    168   
            }
  121         -
        },
         169  +
            /* JsonParserGenerator.kt:568 */
         170  +
        }
         171  +
        /* JsonParserGenerator.kt:642 */
  122    172   
        _ => {
  123    173   
            return Err(
  124    174   
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
  125    175   
                    "expected start object or null",
  126    176   
                ),
  127    177   
            )
  128         -
        }
         178  +
        } /* JsonParserGenerator.kt:567 */
  129    179   
    }
         180  +
    /* JsonParserGenerator.kt:649 */
  130    181   
    if variant.is_none() {
  131    182   
        return Err(
  132    183   
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
  133    184   
                "Union did not contain a valid variant.",
  134    185   
            ),
  135    186   
        );
  136    187   
    }
         188  +
    /* JsonParserGenerator.kt:657 */
  137    189   
    Ok(variant)
         190  +
    /* JsonParserGenerator.kt:551 */
  138    191   
}
  139    192   
         193  +
/* JsonSerializerGenerator.kt:547 */
  140    194   
pub fn ser_my_union(
  141    195   
    object_2: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
  142    196   
    input: &crate::model::MyUnion,
  143    197   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
         198  +
    /* JsonSerializerGenerator.kt:556 */
  144    199   
    match input {
         200  +
        /* JsonSerializerGenerator.kt:564 */
  145    201   
        crate::model::MyUnion::StringValue(inner) => {
  146         -
            object_2.key("stringValue").string(inner.as_str());
         202  +
            /* SerializerUtil.kt:42 */
         203  +
            {
         204  +
                /* JsonSerializerGenerator.kt:423 */
         205  +
                object_2.key("stringValue").string(inner.as_str());
         206  +
                /* SerializerUtil.kt:42 */
         207  +
            }
         208  +
            /* JsonSerializerGenerator.kt:564 */
  147    209   
        }
         210  +
        /* JsonSerializerGenerator.kt:564 */
  148    211   
        crate::model::MyUnion::BooleanValue(inner) => {
  149         -
            object_2.key("booleanValue").boolean(*inner);
         212  +
            /* SerializerUtil.kt:42 */
         213  +
            {
         214  +
                /* JsonSerializerGenerator.kt:424 */
         215  +
                object_2.key("booleanValue").boolean(*inner);
         216  +
                /* SerializerUtil.kt:42 */
         217  +
            }
         218  +
            /* JsonSerializerGenerator.kt:564 */
  150    219   
        }
         220  +
        /* JsonSerializerGenerator.kt:564 */
  151    221   
        crate::model::MyUnion::NumberValue(inner) => {
  152         -
            object_2.key("numberValue").number(
  153         -
                #[allow(clippy::useless_conversion)]
  154         -
                ::aws_smithy_types::Number::NegInt((*inner).into()),
  155         -
            );
         222  +
            /* SerializerUtil.kt:42 */
         223  +
            {
         224  +
                /* JsonSerializerGenerator.kt:432 */
         225  +
                object_2.key("numberValue").number(
         226  +
                    #[allow(clippy::useless_conversion)]
         227  +
                    ::aws_smithy_types::Number::NegInt((*inner).into()),
         228  +
                );
         229  +
                /* SerializerUtil.kt:42 */
         230  +
            }
         231  +
            /* JsonSerializerGenerator.kt:564 */
  156    232   
        }
         233  +
        /* JsonSerializerGenerator.kt:564 */
  157    234   
        crate::model::MyUnion::BlobValue(inner) => {
  158         -
            object_2
  159         -
                .key("blobValue")
  160         -
                .string_unchecked(&::aws_smithy_types::base64::encode(inner));
         235  +
            /* SerializerUtil.kt:42 */
         236  +
            {
         237  +
                /* JsonSerializerGenerator.kt:439 */
         238  +
                object_2
         239  +
                    .key("blobValue")
         240  +
                    .string_unchecked(&::aws_smithy_types::base64::encode(inner));
         241  +
                /* SerializerUtil.kt:42 */
         242  +
            }
         243  +
            /* JsonSerializerGenerator.kt:564 */
  161    244   
        }
         245  +
        /* JsonSerializerGenerator.kt:564 */
  162    246   
        crate::model::MyUnion::TimestampValue(inner) => {
  163         -
            object_2
  164         -
                .key("timestampValue")
  165         -
                .date_time(inner, ::aws_smithy_types::date_time::Format::EpochSeconds)?;
         247  +
            /* SerializerUtil.kt:42 */
         248  +
            {
         249  +
                /* JsonSerializerGenerator.kt:448 */
         250  +
                object_2
         251  +
                    .key("timestampValue")
         252  +
                    .date_time(inner, ::aws_smithy_types::date_time::Format::EpochSeconds)?;
         253  +
                /* SerializerUtil.kt:42 */
         254  +
            }
         255  +
            /* JsonSerializerGenerator.kt:564 */
  166    256   
        }
         257  +
        /* JsonSerializerGenerator.kt:564 */
  167    258   
        crate::model::MyUnion::EnumValue(inner) => {
  168         -
            object_2.key("enumValue").string(inner.as_str());
         259  +
            /* SerializerUtil.kt:42 */
         260  +
            {
         261  +
                /* JsonSerializerGenerator.kt:423 */
         262  +
                object_2.key("enumValue").string(inner.as_str());
         263  +
                /* SerializerUtil.kt:42 */
         264  +
            }
         265  +
            /* JsonSerializerGenerator.kt:564 */
  169    266   
        }
         267  +
        /* JsonSerializerGenerator.kt:564 */
  170    268   
        crate::model::MyUnion::ListValue(inner) => {
  171         -
            let mut array_1 = object_2.key("listValue").start_array();
  172         -
            for item_2 in inner {
  173         -
                {
  174         -
                    array_1.value().string(item_2.as_str());
         269  +
            /* SerializerUtil.kt:42 */
         270  +
            {
         271  +
                /* JsonSerializerGenerator.kt:484 */
         272  +
                let mut array_1 = object_2.key("listValue").start_array();
         273  +
                /* JsonSerializerGenerator.kt:524 */
         274  +
                for item_2 in inner {
         275  +
                    /* SerializerUtil.kt:42 */
         276  +
                    {
         277  +
                        /* JsonSerializerGenerator.kt:423 */
         278  +
                        array_1.value().string(item_2.as_str());
         279  +
                        /* SerializerUtil.kt:42 */
         280  +
                    }
         281  +
                    /* JsonSerializerGenerator.kt:524 */
  175    282   
                }
         283  +
                /* JsonSerializerGenerator.kt:486 */
         284  +
                array_1.finish();
         285  +
                /* SerializerUtil.kt:42 */
  176    286   
            }
  177         -
            array_1.finish();
         287  +
            /* JsonSerializerGenerator.kt:564 */
  178    288   
        }
         289  +
        /* JsonSerializerGenerator.kt:564 */
  179    290   
        crate::model::MyUnion::MapValue(inner) => {
  180         -
            #[allow(unused_mut)]
  181         -
            let mut object_3 = object_2.key("mapValue").start_object();
  182         -
            for (key_4, value_5) in inner {
  183         -
                {
  184         -
                    object_3.key(key_4.as_str()).string(value_5.as_str());
         291  +
            /* SerializerUtil.kt:42 */
         292  +
            {
         293  +
                /* JsonSerializerGenerator.kt:495 */
         294  +
                #[allow(unused_mut)]
         295  +
                /* JsonSerializerGenerator.kt:496 */
         296  +
                let mut object_3 = object_2.key("mapValue").start_object();
         297  +
                /* JsonSerializerGenerator.kt:537 */
         298  +
                for (key_4, value_5) in inner {
         299  +
                    /* SerializerUtil.kt:42 */
         300  +
                    {
         301  +
                        /* JsonSerializerGenerator.kt:423 */
         302  +
                        object_3.key(key_4.as_str()).string(value_5.as_str());
         303  +
                        /* SerializerUtil.kt:42 */
         304  +
                    }
         305  +
                    /* JsonSerializerGenerator.kt:537 */
  185    306   
                }
         307  +
                /* JsonSerializerGenerator.kt:515 */
         308  +
                object_3.finish();
         309  +
                /* SerializerUtil.kt:42 */
  186    310   
            }
  187         -
            object_3.finish();
         311  +
            /* JsonSerializerGenerator.kt:564 */
  188    312   
        }
         313  +
        /* JsonSerializerGenerator.kt:564 */
  189    314   
        crate::model::MyUnion::StructureValue(inner) => {
  190         -
            #[allow(unused_mut)]
  191         -
            let mut object_6 = object_2.key("structureValue").start_object();
  192         -
            crate::protocol_serde::shape_greeting_struct::ser_greeting_struct(
  193         -
                &mut object_6,
  194         -
                inner,
  195         -
            )?;
  196         -
            object_6.finish();
         315  +
            /* SerializerUtil.kt:42 */
         316  +
            {
         317  +
                /* JsonSerializerGenerator.kt:495 */
         318  +
                #[allow(unused_mut)]
         319  +
                /* JsonSerializerGenerator.kt:496 */
         320  +
                let mut object_6 = object_2.key("structureValue").start_object();
         321  +
                /* JsonSerializerGenerator.kt:375 */
         322  +
                crate::protocol_serde::shape_greeting_struct::ser_greeting_struct(
         323  +
                    &mut object_6,
         324  +
                    inner,
         325  +
                )?;
         326  +
                /* JsonSerializerGenerator.kt:515 */
         327  +
                object_6.finish();
         328  +
                /* SerializerUtil.kt:42 */
         329  +
            }
         330  +
            /* JsonSerializerGenerator.kt:564 */
  197    331   
        }
         332  +
        /* JsonSerializerGenerator.kt:556 */
  198    333   
    }
         334  +
    /* JsonSerializerGenerator.kt:576 */
  199    335   
    Ok(())
         336  +
    /* JsonSerializerGenerator.kt:547 */
  200    337   
}

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

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