Client Test

Client Test

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943

Files changed:

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/protocol_serde/shape_kitchen_sink_operation_input.rs

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

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

@@ -1,1 +32,55 @@
    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<Option<::std::vec::Vec<crate::types::KitchenSink>>, ::aws_smithy_json::deserialize::error::DeserializeError>
    5      6   
where
    6      7   
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
    7      8   
{
           9  +
    /* JsonParserGenerator.kt:712 */
    8     10   
    match tokens.next().transpose()? {
    9         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
          11  +
        /* JsonParserGenerator.kt:713 */ Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   10     12   
        Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => {
          13  +
            /* JsonParserGenerator.kt:407 */
   11     14   
            let mut items = Vec::new();
          15  +
            /* JsonParserGenerator.kt:408 */
   12     16   
            loop {
          17  +
                /* JsonParserGenerator.kt:409 */
   13     18   
                match tokens.peek() {
          19  +
                    /* JsonParserGenerator.kt:410 */
   14     20   
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
          21  +
                        /* JsonParserGenerator.kt:411 */
   15     22   
                        tokens.next().transpose().unwrap();
   16     23   
                        break;
          24  +
                        /* JsonParserGenerator.kt:410 */
   17     25   
                    }
          26  +
                    /* JsonParserGenerator.kt:413 */
   18     27   
                    _ => {
   19         -
                        let value = crate::protocol_serde::shape_kitchen_sink::de_kitchen_sink(tokens)?;
          28  +
                        /* JsonParserGenerator.kt:419 */
          29  +
                        let value =
          30  +
                            /* JsonParserGenerator.kt:544 */crate::protocol_serde::shape_kitchen_sink::de_kitchen_sink(tokens)?
          31  +
                        /* JsonParserGenerator.kt:419 */;
          32  +
                        /* JsonParserGenerator.kt:422 */
   20     33   
                        if let Some(value) = value {
   21     34   
                            items.push(value);
   22     35   
                        }
   23         -
                    }
          36  +
                        /* JsonParserGenerator.kt:413 */
          37  +
                    } /* JsonParserGenerator.kt:409 */
   24     38   
                }
          39  +
                /* JsonParserGenerator.kt:408 */
   25     40   
            }
          41  +
            /* JsonParserGenerator.kt:446 */
   26     42   
            Ok(Some(items))
          43  +
            /* JsonParserGenerator.kt:713 */
   27     44   
        }
   28         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   29         -
            "expected start array or null",
   30         -
        )),
          45  +
        /* JsonParserGenerator.kt:722 */
          46  +
        _ => {
          47  +
            /* JsonParserGenerator.kt:723 */
          48  +
            Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          49  +
                "expected start array or null",
          50  +
            ))
          51  +
            /* JsonParserGenerator.kt:722 */
          52  +
        } /* JsonParserGenerator.kt:712 */
   31     53   
    }
          54  +
    /* JsonParserGenerator.kt:398 */
   32     55   
}

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

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

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

@@ -1,1 +35,58 @@
    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<::std::vec::Vec<::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<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
   10     11   
{
          12  +
    /* JsonParserGenerator.kt:712 */
   11     13   
    match tokens.next().transpose()? {
   12         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
          14  +
        /* JsonParserGenerator.kt:713 */ Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   13     15   
        Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => {
          16  +
            /* JsonParserGenerator.kt:407 */
   14     17   
            let mut items = Vec::new();
          18  +
            /* JsonParserGenerator.kt:408 */
   15     19   
            loop {
          20  +
                /* JsonParserGenerator.kt:409 */
   16     21   
                match tokens.peek() {
          22  +
                    /* JsonParserGenerator.kt:410 */
   17     23   
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
          24  +
                        /* JsonParserGenerator.kt:411 */
   18     25   
                        tokens.next().transpose().unwrap();
   19     26   
                        break;
          27  +
                        /* JsonParserGenerator.kt:410 */
   20     28   
                    }
          29  +
                    /* JsonParserGenerator.kt:413 */
   21     30   
                    _ => {
   22         -
                        let value = crate::protocol_serde::shape_map_of_strings::de_map_of_strings(tokens)?;
          31  +
                        /* JsonParserGenerator.kt:419 */
          32  +
                        let value =
          33  +
                            /* JsonParserGenerator.kt:509 */crate::protocol_serde::shape_map_of_strings::de_map_of_strings(tokens)?
          34  +
                        /* JsonParserGenerator.kt:419 */;
          35  +
                        /* JsonParserGenerator.kt:422 */
   23     36   
                        if let Some(value) = value {
   24     37   
                            items.push(value);
   25     38   
                        }
   26         -
                    }
          39  +
                        /* JsonParserGenerator.kt:413 */
          40  +
                    } /* JsonParserGenerator.kt:409 */
   27     41   
                }
          42  +
                /* JsonParserGenerator.kt:408 */
   28     43   
            }
          44  +
            /* JsonParserGenerator.kt:446 */
   29     45   
            Ok(Some(items))
          46  +
            /* JsonParserGenerator.kt:713 */
   30     47   
        }
   31         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   32         -
            "expected start array or null",
   33         -
        )),
          48  +
        /* JsonParserGenerator.kt:722 */
          49  +
        _ => {
          50  +
            /* JsonParserGenerator.kt:723 */
          51  +
            Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          52  +
                "expected start array or null",
          53  +
            ))
          54  +
            /* JsonParserGenerator.kt:722 */
          55  +
        } /* JsonParserGenerator.kt:712 */
   34     56   
    }
          57  +
    /* JsonParserGenerator.kt:398 */
   35     58   
}

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

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

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

@@ -1,1 +32,55 @@
    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<Option<::std::vec::Vec<crate::types::SimpleStruct>>, ::aws_smithy_json::deserialize::error::DeserializeError>
    5      6   
where
    6      7   
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
    7      8   
{
           9  +
    /* JsonParserGenerator.kt:712 */
    8     10   
    match tokens.next().transpose()? {
    9         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
          11  +
        /* JsonParserGenerator.kt:713 */ Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   10     12   
        Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => {
          13  +
            /* JsonParserGenerator.kt:407 */
   11     14   
            let mut items = Vec::new();
          15  +
            /* JsonParserGenerator.kt:408 */
   12     16   
            loop {
          17  +
                /* JsonParserGenerator.kt:409 */
   13     18   
                match tokens.peek() {
          19  +
                    /* JsonParserGenerator.kt:410 */
   14     20   
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
          21  +
                        /* JsonParserGenerator.kt:411 */
   15     22   
                        tokens.next().transpose().unwrap();
   16     23   
                        break;
          24  +
                        /* JsonParserGenerator.kt:410 */
   17     25   
                    }
          26  +
                    /* JsonParserGenerator.kt:413 */
   18     27   
                    _ => {
   19         -
                        let value = crate::protocol_serde::shape_simple_struct::de_simple_struct(tokens)?;
          28  +
                        /* JsonParserGenerator.kt:419 */
          29  +
                        let value =
          30  +
                            /* JsonParserGenerator.kt:544 */crate::protocol_serde::shape_simple_struct::de_simple_struct(tokens)?
          31  +
                        /* JsonParserGenerator.kt:419 */;
          32  +
                        /* JsonParserGenerator.kt:422 */
   20     33   
                        if let Some(value) = value {
   21     34   
                            items.push(value);
   22     35   
                        }
   23         -
                    }
          36  +
                        /* JsonParserGenerator.kt:413 */
          37  +
                    } /* JsonParserGenerator.kt:409 */
   24     38   
                }
          39  +
                /* JsonParserGenerator.kt:408 */
   25     40   
            }
          41  +
            /* JsonParserGenerator.kt:446 */
   26     42   
            Ok(Some(items))
          43  +
            /* JsonParserGenerator.kt:713 */
   27     44   
        }
   28         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   29         -
            "expected start array or null",
   30         -
        )),
          45  +
        /* JsonParserGenerator.kt:722 */
          46  +
        _ => {
          47  +
            /* JsonParserGenerator.kt:723 */
          48  +
            Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          49  +
                "expected start array or null",
          50  +
            ))
          51  +
            /* JsonParserGenerator.kt:722 */
          52  +
        } /* JsonParserGenerator.kt:712 */
   31     53   
    }
          54  +
    /* JsonParserGenerator.kt:398 */
   32     55   
}

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

@@ -1,1 +39,64 @@
    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::types::KitchenSink>>,
    6      7   
    ::aws_smithy_json::deserialize::error::DeserializeError,
    7      8   
>
    8      9   
where
    9     10   
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
   10     11   
{
          12  +
    /* JsonParserGenerator.kt:712 */
   11     13   
    match tokens.next().transpose()? {
   12         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
          14  +
        /* JsonParserGenerator.kt:713 */ Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   13     15   
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
          16  +
            /* JsonParserGenerator.kt:469 */
   14     17   
            let mut map = ::std::collections::HashMap::new();
          18  +
            /* JsonParserGenerator.kt:684 */
   15     19   
            loop {
          20  +
                /* JsonParserGenerator.kt:685 */
   16     21   
                match tokens.next().transpose()? {
   17         -
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
          22  +
                    /* JsonParserGenerator.kt:686 */ Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   18     23   
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
   19         -
                        let key = key.to_unescaped().map(|u| u.into_owned())?;
   20         -
                        let value = crate::protocol_serde::shape_kitchen_sink::de_kitchen_sink(tokens)?;
          24  +
                        /* JsonParserGenerator.kt:471 */
          25  +
                        let key =
          26  +
                            /* JsonParserGenerator.kt:339 */key.to_unescaped().map(|u|
          27  +
                                /* JsonParserGenerator.kt:348 */u.into_owned()
          28  +
                            /* JsonParserGenerator.kt:339 */)
          29  +
                        /* JsonParserGenerator.kt:471 */?;
          30  +
                        /* JsonParserGenerator.kt:474 */
          31  +
                        let value =
          32  +
                            /* JsonParserGenerator.kt:544 */crate::protocol_serde::shape_kitchen_sink::de_kitchen_sink(tokens)?
          33  +
                        /* JsonParserGenerator.kt:474 */;
          34  +
                        /* JsonParserGenerator.kt:491 */
   21     35   
                        if let Some(value) = value {
   22     36   
                            map.insert(key, value);
   23     37   
                        }
          38  +
                        /* JsonParserGenerator.kt:686 */
   24     39   
                    }
          40  +
                    /* JsonParserGenerator.kt:695 */
   25     41   
                    other => {
   26     42   
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   27     43   
                            "expected object key or end object, found: {:?}",
   28     44   
                            other
   29     45   
                        )))
   30         -
                    }
          46  +
                    } /* JsonParserGenerator.kt:685 */
   31     47   
                }
          48  +
                /* JsonParserGenerator.kt:684 */
   32     49   
            }
          50  +
            /* JsonParserGenerator.kt:504 */
   33     51   
            Ok(Some(map))
          52  +
            /* JsonParserGenerator.kt:713 */
   34     53   
        }
   35         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   36         -
            "expected start object or null",
   37         -
        )),
          54  +
        /* JsonParserGenerator.kt:722 */
          55  +
        _ => {
          56  +
            /* JsonParserGenerator.kt:723 */
          57  +
            Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          58  +
                "expected start object or null",
          59  +
            ))
          60  +
            /* JsonParserGenerator.kt:722 */
          61  +
        } /* JsonParserGenerator.kt:712 */
   38     62   
    }
          63  +
    /* JsonParserGenerator.kt:460 */
   39     64   
}

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

@@ -1,1 +39,64 @@
    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<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>>,
    6      7   
    ::aws_smithy_json::deserialize::error::DeserializeError,
    7      8   
>
    8      9   
where
    9     10   
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
   10     11   
{
          12  +
    /* JsonParserGenerator.kt:712 */
   11     13   
    match tokens.next().transpose()? {
   12         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
          14  +
        /* JsonParserGenerator.kt:713 */ Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   13     15   
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
          16  +
            /* JsonParserGenerator.kt:469 */
   14     17   
            let mut map = ::std::collections::HashMap::new();
          18  +
            /* JsonParserGenerator.kt:684 */
   15     19   
            loop {
          20  +
                /* JsonParserGenerator.kt:685 */
   16     21   
                match tokens.next().transpose()? {
   17         -
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
          22  +
                    /* JsonParserGenerator.kt:686 */ Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   18     23   
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
   19         -
                        let key = key.to_unescaped().map(|u| u.into_owned())?;
   20         -
                        let value = crate::protocol_serde::shape_list_of_strings::de_list_of_strings(tokens)?;
          24  +
                        /* JsonParserGenerator.kt:471 */
          25  +
                        let key =
          26  +
                            /* JsonParserGenerator.kt:339 */key.to_unescaped().map(|u|
          27  +
                                /* JsonParserGenerator.kt:348 */u.into_owned()
          28  +
                            /* JsonParserGenerator.kt:339 */)
          29  +
                        /* JsonParserGenerator.kt:471 */?;
          30  +
                        /* JsonParserGenerator.kt:474 */
          31  +
                        let value =
          32  +
                            /* JsonParserGenerator.kt:451 */crate::protocol_serde::shape_list_of_strings::de_list_of_strings(tokens)?
          33  +
                        /* JsonParserGenerator.kt:474 */;
          34  +
                        /* JsonParserGenerator.kt:491 */
   21     35   
                        if let Some(value) = value {
   22     36   
                            map.insert(key, value);
   23     37   
                        }
          38  +
                        /* JsonParserGenerator.kt:686 */
   24     39   
                    }
          40  +
                    /* JsonParserGenerator.kt:695 */
   25     41   
                    other => {
   26     42   
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   27     43   
                            "expected object key or end object, found: {:?}",
   28     44   
                            other
   29     45   
                        )))
   30         -
                    }
          46  +
                    } /* JsonParserGenerator.kt:685 */
   31     47   
                }
          48  +
                /* JsonParserGenerator.kt:684 */
   32     49   
            }
          50  +
            /* JsonParserGenerator.kt:504 */
   33     51   
            Ok(Some(map))
          52  +
            /* JsonParserGenerator.kt:713 */
   34     53   
        }
   35         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   36         -
            "expected start object or null",
   37         -
        )),
          54  +
        /* JsonParserGenerator.kt:722 */
          55  +
        _ => {
          56  +
            /* JsonParserGenerator.kt:723 */
          57  +
            Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          58  +
                "expected start object or null",
          59  +
            ))
          60  +
            /* JsonParserGenerator.kt:722 */
          61  +
        } /* JsonParserGenerator.kt:712 */
   38     62   
    }
          63  +
    /* JsonParserGenerator.kt:460 */
   39     64   
}

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

@@ -1,1 +39,64 @@
    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<::std::collections::HashMap<::std::string::String, ::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<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
   10     11   
{
          12  +
    /* JsonParserGenerator.kt:712 */
   11     13   
    match tokens.next().transpose()? {
   12         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
          14  +
        /* JsonParserGenerator.kt:713 */ Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   13     15   
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
          16  +
            /* JsonParserGenerator.kt:469 */
   14     17   
            let mut map = ::std::collections::HashMap::new();
          18  +
            /* JsonParserGenerator.kt:684 */
   15     19   
            loop {
          20  +
                /* JsonParserGenerator.kt:685 */
   16     21   
                match tokens.next().transpose()? {
   17         -
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
          22  +
                    /* JsonParserGenerator.kt:686 */ Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   18     23   
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
   19         -
                        let key = key.to_unescaped().map(|u| u.into_owned())?;
   20         -
                        let value = crate::protocol_serde::shape_map_of_strings::de_map_of_strings(tokens)?;
          24  +
                        /* JsonParserGenerator.kt:471 */
          25  +
                        let key =
          26  +
                            /* JsonParserGenerator.kt:339 */key.to_unescaped().map(|u|
          27  +
                                /* JsonParserGenerator.kt:348 */u.into_owned()
          28  +
                            /* JsonParserGenerator.kt:339 */)
          29  +
                        /* JsonParserGenerator.kt:471 */?;
          30  +
                        /* JsonParserGenerator.kt:474 */
          31  +
                        let value =
          32  +
                            /* JsonParserGenerator.kt:509 */crate::protocol_serde::shape_map_of_strings::de_map_of_strings(tokens)?
          33  +
                        /* JsonParserGenerator.kt:474 */;
          34  +
                        /* JsonParserGenerator.kt:491 */
   21     35   
                        if let Some(value) = value {
   22     36   
                            map.insert(key, value);
   23     37   
                        }
          38  +
                        /* JsonParserGenerator.kt:686 */
   24     39   
                    }
          40  +
                    /* JsonParserGenerator.kt:695 */
   25     41   
                    other => {
   26     42   
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   27     43   
                            "expected object key or end object, found: {:?}",
   28     44   
                            other
   29     45   
                        )))
   30         -
                    }
          46  +
                    } /* JsonParserGenerator.kt:685 */
   31     47   
                }
          48  +
                /* JsonParserGenerator.kt:684 */
   32     49   
            }
          50  +
            /* JsonParserGenerator.kt:504 */
   33     51   
            Ok(Some(map))
          52  +
            /* JsonParserGenerator.kt:713 */
   34     53   
        }
   35         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   36         -
            "expected start object or null",
   37         -
        )),
          54  +
        /* JsonParserGenerator.kt:722 */
          55  +
        _ => {
          56  +
            /* JsonParserGenerator.kt:723 */
          57  +
            Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          58  +
                "expected start object or null",
          59  +
            ))
          60  +
            /* JsonParserGenerator.kt:722 */
          61  +
        } /* JsonParserGenerator.kt:712 */
   38     62   
    }
          63  +
    /* JsonParserGenerator.kt:460 */
   39     64   
}

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

@@ -1,1 +41,68 @@
    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<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
   10     11   
{
          12  +
    /* JsonParserGenerator.kt:712 */
   11     13   
    match tokens.next().transpose()? {
   12         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
          14  +
        /* JsonParserGenerator.kt:713 */ Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   13     15   
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
          16  +
            /* JsonParserGenerator.kt:469 */
   14     17   
            let mut map = ::std::collections::HashMap::new();
          18  +
            /* JsonParserGenerator.kt:684 */
   15     19   
            loop {
          20  +
                /* JsonParserGenerator.kt:685 */
   16     21   
                match tokens.next().transpose()? {
   17         -
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
          22  +
                    /* JsonParserGenerator.kt:686 */ Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   18     23   
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
   19         -
                        let key = key.to_unescaped().map(|u| u.into_owned())?;
   20         -
                        let value = ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   21         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   22         -
                            .transpose()?;
          24  +
                        /* JsonParserGenerator.kt:471 */
          25  +
                        let key =
          26  +
                            /* JsonParserGenerator.kt:339 */key.to_unescaped().map(|u|
          27  +
                                /* JsonParserGenerator.kt:348 */u.into_owned()
          28  +
                            /* JsonParserGenerator.kt:339 */)
          29  +
                        /* JsonParserGenerator.kt:471 */?;
          30  +
                        /* JsonParserGenerator.kt:474 */
          31  +
                        let value =
          32  +
                            /* JsonParserGenerator.kt:354 */::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?.map(|s|
          33  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          34  +
                                    /* JsonParserGenerator.kt:348 */u.into_owned()
          35  +
                                /* JsonParserGenerator.kt:339 */)
          36  +
                            /* JsonParserGenerator.kt:354 */).transpose()?
          37  +
                        /* JsonParserGenerator.kt:474 */;
          38  +
                        /* JsonParserGenerator.kt:491 */
   23     39   
                        if let Some(value) = value {
   24     40   
                            map.insert(key, value);
   25     41   
                        }
          42  +
                        /* JsonParserGenerator.kt:686 */
   26     43   
                    }
          44  +
                    /* JsonParserGenerator.kt:695 */
   27     45   
                    other => {
   28     46   
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   29     47   
                            "expected object key or end object, found: {:?}",
   30     48   
                            other
   31     49   
                        )))
   32         -
                    }
          50  +
                    } /* JsonParserGenerator.kt:685 */
   33     51   
                }
          52  +
                /* JsonParserGenerator.kt:684 */
   34     53   
            }
          54  +
            /* JsonParserGenerator.kt:504 */
   35     55   
            Ok(Some(map))
          56  +
            /* JsonParserGenerator.kt:713 */
   36     57   
        }
   37         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   38         -
            "expected start object or null",
   39         -
        )),
          58  +
        /* JsonParserGenerator.kt:722 */
          59  +
        _ => {
          60  +
            /* JsonParserGenerator.kt:723 */
          61  +
            Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          62  +
                "expected start object or null",
          63  +
            ))
          64  +
            /* JsonParserGenerator.kt:722 */
          65  +
        } /* JsonParserGenerator.kt:712 */
   40     66   
    }
          67  +
    /* JsonParserGenerator.kt:460 */
   41     68   
}

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

@@ -1,1 +39,64 @@
    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::types::SimpleStruct>>,
    6      7   
    ::aws_smithy_json::deserialize::error::DeserializeError,
    7      8   
>
    8      9   
where
    9     10   
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
   10     11   
{
          12  +
    /* JsonParserGenerator.kt:712 */
   11     13   
    match tokens.next().transpose()? {
   12         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
          14  +
        /* JsonParserGenerator.kt:713 */ Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   13     15   
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
          16  +
            /* JsonParserGenerator.kt:469 */
   14     17   
            let mut map = ::std::collections::HashMap::new();
          18  +
            /* JsonParserGenerator.kt:684 */
   15     19   
            loop {
          20  +
                /* JsonParserGenerator.kt:685 */
   16     21   
                match tokens.next().transpose()? {
   17         -
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
          22  +
                    /* JsonParserGenerator.kt:686 */ Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   18     23   
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
   19         -
                        let key = key.to_unescaped().map(|u| u.into_owned())?;
   20         -
                        let value = crate::protocol_serde::shape_simple_struct::de_simple_struct(tokens)?;
          24  +
                        /* JsonParserGenerator.kt:471 */
          25  +
                        let key =
          26  +
                            /* JsonParserGenerator.kt:339 */key.to_unescaped().map(|u|
          27  +
                                /* JsonParserGenerator.kt:348 */u.into_owned()
          28  +
                            /* JsonParserGenerator.kt:339 */)
          29  +
                        /* JsonParserGenerator.kt:471 */?;
          30  +
                        /* JsonParserGenerator.kt:474 */
          31  +
                        let value =
          32  +
                            /* JsonParserGenerator.kt:544 */crate::protocol_serde::shape_simple_struct::de_simple_struct(tokens)?
          33  +
                        /* JsonParserGenerator.kt:474 */;
          34  +
                        /* JsonParserGenerator.kt:491 */
   21     35   
                        if let Some(value) = value {
   22     36   
                            map.insert(key, value);
   23     37   
                        }
          38  +
                        /* JsonParserGenerator.kt:686 */
   24     39   
                    }
          40  +
                    /* JsonParserGenerator.kt:695 */
   25     41   
                    other => {
   26     42   
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   27     43   
                            "expected object key or end object, found: {:?}",
   28     44   
                            other
   29     45   
                        )))
   30         -
                    }
          46  +
                    } /* JsonParserGenerator.kt:685 */
   31     47   
                }
          48  +
                /* JsonParserGenerator.kt:684 */
   32     49   
            }
          50  +
            /* JsonParserGenerator.kt:504 */
   33     51   
            Ok(Some(map))
          52  +
            /* JsonParserGenerator.kt:713 */
   34     53   
        }
   35         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   36         -
            "expected start object or null",
   37         -
        )),
          54  +
        /* JsonParserGenerator.kt:722 */
          55  +
        _ => {
          56  +
            /* JsonParserGenerator.kt:723 */
          57  +
            Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          58  +
                "expected start object or null",
          59  +
            ))
          60  +
            /* JsonParserGenerator.kt:722 */
          61  +
        } /* JsonParserGenerator.kt:712 */
   38     62   
    }
          63  +
    /* JsonParserGenerator.kt:460 */
   39     64   
}

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

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