Client Test

Client Test

rev. a1890211e68661be8832f65fb372ed8e4c61947d

Files changed:

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/protocol_serde/shape_integer_enum_set.rs

@@ -1,1 +35,39 @@
   15     15   
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
   16     16   
                        tokens.next().transpose().unwrap();
   17     17   
                        break;
   18     18   
                    }
   19     19   
                    _ => {
   20     20   
                        let value = ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
   21     21   
                            .map(i32::try_from)
   22     22   
                            .transpose()?;
   23     23   
                        if let Some(value) = value {
   24     24   
                            items.push(value);
          25  +
                        } else {
          26  +
                            return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          27  +
                                "dense list cannot contain null values",
          28  +
                            ));
   25     29   
                        }
   26     30   
                    }
   27     31   
                }
   28     32   
            }
   29     33   
            Ok(Some(items))
   30     34   
        }
   31     35   
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   32     36   
            "expected start array or null",
   33     37   
        )),
   34     38   
    }

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/protocol_serde/shape_integer_list.rs

@@ -1,1 +35,39 @@
   15     15   
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
   16     16   
                        tokens.next().transpose().unwrap();
   17     17   
                        break;
   18     18   
                    }
   19     19   
                    _ => {
   20     20   
                        let value = ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
   21     21   
                            .map(i32::try_from)
   22     22   
                            .transpose()?;
   23     23   
                        if let Some(value) = value {
   24     24   
                            items.push(value);
          25  +
                        } else {
          26  +
                            return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          27  +
                                "dense list cannot contain null values",
          28  +
                            ));
   25     29   
                        }
   26     30   
                    }
   27     31   
                }
   28     32   
            }
   29     33   
            Ok(Some(items))
   30     34   
        }
   31     35   
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   32     36   
            "expected start array or null",
   33     37   
        )),
   34     38   
    }

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/protocol_serde/shape_nested_string_list.rs

@@ -1,1 +33,37 @@
   13     13   
            loop {
   14     14   
                match tokens.peek() {
   15     15   
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
   16     16   
                        tokens.next().transpose().unwrap();
   17     17   
                        break;
   18     18   
                    }
   19     19   
                    _ => {
   20     20   
                        let value = crate::protocol_serde::shape_string_list::de_string_list(tokens, _value)?;
   21     21   
                        if let Some(value) = value {
   22     22   
                            items.push(value);
          23  +
                        } else {
          24  +
                            return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          25  +
                                "dense list cannot contain null values",
          26  +
                            ));
   23     27   
                        }
   24     28   
                    }
   25     29   
                }
   26     30   
            }
   27     31   
            Ok(Some(items))
   28     32   
        }
   29     33   
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   30     34   
            "expected start array or null",
   31     35   
        )),
   32     36   
    }

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/protocol_serde/shape_string_list.rs

@@ -1,1 +35,39 @@
   15     15   
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
   16     16   
                        tokens.next().transpose().unwrap();
   17     17   
                        break;
   18     18   
                    }
   19     19   
                    _ => {
   20     20   
                        let value = ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   21     21   
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   22     22   
                            .transpose()?;
   23     23   
                        if let Some(value) = value {
   24     24   
                            items.push(value);
          25  +
                        } else {
          26  +
                            return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          27  +
                                "dense list cannot contain null values",
          28  +
                            ));
   25     29   
                        }
   26     30   
                    }
   27     31   
                }
   28     32   
            }
   29     33   
            Ok(Some(items))
   30     34   
        }
   31     35   
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   32     36   
            "expected start array or null",
   33     37   
        )),
   34     38   
    }

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/protocol_serde/shape_string_map.rs

@@ -1,1 +41,48 @@
   14     14   
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
   15     15   
            let mut map = ::std::collections::HashMap::new();
   16     16   
            loop {
   17     17   
                match tokens.next().transpose()? {
   18     18   
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   19     19   
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
   20     20   
                        let key = key.to_unescaped().map(|u| u.into_owned())?;
   21     21   
                        let value = ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   22     22   
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   23     23   
                            .transpose()?;
   24         -
                        if let Some(value) = value {
   25         -
                            map.insert(key, value);
          24  +
                        match value {
          25  +
                            Some(value) => {
          26  +
                                map.insert(key, value);
          27  +
                            }
          28  +
                            None => {
          29  +
                                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          30  +
                                    "dense map cannot contain null values",
          31  +
                                ))
          32  +
                            }
   26     33   
                        }
   27     34   
                    }
   28     35   
                    other => {
   29     36   
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   30     37   
                            "expected object key or end object, found: {other:?}"
   31     38   
                        )))
   32     39   
                    }
   33     40   
                }
   34     41   
            }
   35     42   
            Ok(Some(map))

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/protocol_serde/shape_string_set.rs

@@ -1,1 +35,39 @@
   15     15   
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
   16     16   
                        tokens.next().transpose().unwrap();
   17     17   
                        break;
   18     18   
                    }
   19     19   
                    _ => {
   20     20   
                        let value = ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   21     21   
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   22     22   
                            .transpose()?;
   23     23   
                        if let Some(value) = value {
   24     24   
                            items.push(value);
          25  +
                        } else {
          26  +
                            return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          27  +
                                "dense list cannot contain null values",
          28  +
                            ));
   25     29   
                        }
   26     30   
                    }
   27     31   
                }
   28     32   
            }
   29     33   
            Ok(Some(items))
   30     34   
        }
   31     35   
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   32     36   
            "expected start array or null",
   33     37   
        )),
   34     38   
    }

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/protocol_serde/shape_structure_list.rs

@@ -1,1 +33,37 @@
   13     13   
            loop {
   14     14   
                match tokens.peek() {
   15     15   
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
   16     16   
                        tokens.next().transpose().unwrap();
   17     17   
                        break;
   18     18   
                    }
   19     19   
                    _ => {
   20     20   
                        let value = crate::protocol_serde::shape_structure_list_member::de_structure_list_member(tokens, _value)?;
   21     21   
                        if let Some(value) = value {
   22     22   
                            items.push(value);
          23  +
                        } else {
          24  +
                            return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          25  +
                                "dense list cannot contain null values",
          26  +
                            ));
   23     27   
                        }
   24     28   
                    }
   25     29   
                }
   26     30   
            }
   27     31   
            Ok(Some(items))
   28     32   
        }
   29     33   
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   30     34   
            "expected start array or null",
   31     35   
        )),
   32     36   
    }

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/protocol_serde/shape_test_string_list.rs

@@ -1,1 +35,39 @@
   15     15   
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
   16     16   
                        tokens.next().transpose().unwrap();
   17     17   
                        break;
   18     18   
                    }
   19     19   
                    _ => {
   20     20   
                        let value = ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   21     21   
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   22     22   
                            .transpose()?;
   23     23   
                        if let Some(value) = value {
   24     24   
                            items.push(value);
          25  +
                        } else {
          26  +
                            return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          27  +
                                "dense list cannot contain null values",
          28  +
                            ));
   25     29   
                        }
   26     30   
                    }
   27     31   
                }
   28     32   
            }
   29     33   
            Ok(Some(items))
   30     34   
        }
   31     35   
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   32     36   
            "expected start array or null",
   33     37   
        )),
   34     38   
    }

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/protocol_serde/shape_test_string_map.rs

@@ -1,1 +41,48 @@
   14     14   
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
   15     15   
            let mut map = ::std::collections::HashMap::new();
   16     16   
            loop {
   17     17   
                match tokens.next().transpose()? {
   18     18   
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   19     19   
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
   20     20   
                        let key = key.to_unescaped().map(|u| u.into_owned())?;
   21     21   
                        let value = ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   22     22   
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   23     23   
                            .transpose()?;
   24         -
                        if let Some(value) = value {
   25         -
                            map.insert(key, value);
          24  +
                        match value {
          25  +
                            Some(value) => {
          26  +
                                map.insert(key, value);
          27  +
                            }
          28  +
                            None => {
          29  +
                                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          30  +
                                    "dense map cannot contain null values",
          31  +
                                ))
          32  +
                            }
   26     33   
                        }
   27     34   
                    }
   28     35   
                    other => {
   29     36   
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   30     37   
                            "expected object key or end object, found: {other:?}"
   31     38   
                        )))
   32     39   
                    }
   33     40   
                }
   34     41   
            }
   35     42   
            Ok(Some(map))

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/protocol_serde/shape_timestamp_list.rs

@@ -1,1 +36,40 @@
   16     16   
                        tokens.next().transpose().unwrap();
   17     17   
                        break;
   18     18   
                    }
   19     19   
                    _ => {
   20     20   
                        let value = ::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
   21     21   
                            tokens.next(),
   22     22   
                            ::aws_smithy_types::date_time::Format::EpochSeconds,
   23     23   
                        )?;
   24     24   
                        if let Some(value) = value {
   25     25   
                            items.push(value);
          26  +
                        } else {
          27  +
                            return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          28  +
                                "dense list cannot contain null values",
          29  +
                            ));
   26     30   
                        }
   27     31   
                    }
   28     32   
                }
   29     33   
            }
   30     34   
            Ok(Some(items))
   31     35   
        }
   32     36   
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   33     37   
            "expected start array or null",
   34     38   
        )),
   35     39   
    }

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/protocol_serde/shape_map_with_enum_key.rs

@@ -1,1 +41,48 @@
   14     14   
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
   15     15   
            let mut map = ::std::collections::HashMap::new();
   16     16   
            loop {
   17     17   
                match tokens.next().transpose()? {
   18     18   
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   19     19   
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
   20     20   
                        let key = key.to_unescaped().map(|u| crate::types::StringEnum::from(u.as_ref()))?;
   21     21   
                        let value = ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   22     22   
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   23     23   
                            .transpose()?;
   24         -
                        if let Some(value) = value {
   25         -
                            map.insert(key, value);
          24  +
                        match value {
          25  +
                            Some(value) => {
          26  +
                                map.insert(key, value);
          27  +
                            }
          28  +
                            None => {
          29  +
                                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          30  +
                                    "dense map cannot contain null values",
          31  +
                                ))
          32  +
                            }
   26     33   
                        }
   27     34   
                    }
   28     35   
                    other => {
   29     36   
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   30     37   
                            "expected object key or end object, found: {other:?}"
   31     38   
                        )))
   32     39   
                    }
   33     40   
                }
   34     41   
            }
   35     42   
            Ok(Some(map))

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/protocol_serde/shape_non_sparse_list.rs

@@ -1,1 +35,39 @@
   15     15   
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
   16     16   
                        tokens.next().transpose().unwrap();
   17     17   
                        break;
   18     18   
                    }
   19     19   
                    _ => {
   20     20   
                        let value = ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   21     21   
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   22     22   
                            .transpose()?;
   23     23   
                        if let Some(value) = value {
   24     24   
                            items.push(value);
          25  +
                        } else {
          26  +
                            return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          27  +
                                "dense list cannot contain null values",
          28  +
                            ));
   25     29   
                        }
   26     30   
                    }
   27     31   
                }
   28     32   
            }
   29     33   
            Ok(Some(items))
   30     34   
        }
   31     35   
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   32     36   
            "expected start array or null",
   33     37   
        )),
   34     38   
    }

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/protocol_serde/shape_non_sparse_map.rs

@@ -1,1 +41,48 @@
   14     14   
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
   15     15   
            let mut map = ::std::collections::HashMap::new();
   16     16   
            loop {
   17     17   
                match tokens.next().transpose()? {
   18     18   
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   19     19   
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
   20     20   
                        let key = key.to_unescaped().map(|u| u.into_owned())?;
   21     21   
                        let value = ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   22     22   
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   23     23   
                            .transpose()?;
   24         -
                        if let Some(value) = value {
   25         -
                            map.insert(key, value);
          24  +
                        match value {
          25  +
                            Some(value) => {
          26  +
                                map.insert(key, value);
          27  +
                            }
          28  +
                            None => {
          29  +
                                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          30  +
                                    "dense map cannot contain null values",
          31  +
                                ))
          32  +
                            }
   26     33   
                        }
   27     34   
                    }
   28     35   
                    other => {
   29     36   
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   30     37   
                            "expected object key or end object, found: {other:?}"
   31     38   
                        )))
   32     39   
                    }
   33     40   
                }
   34     41   
            }
   35     42   
            Ok(Some(map))

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/protocol_serde/shape_validation_exception_field_list.rs

@@ -1,1 +33,37 @@
   13     13   
            loop {
   14     14   
                match tokens.peek() {
   15     15   
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
   16     16   
                        tokens.next().transpose().unwrap();
   17     17   
                        break;
   18     18   
                    }
   19     19   
                    _ => {
   20     20   
                        let value = crate::protocol_serde::shape_validation_exception_field::de_validation_exception_field(tokens, _value)?;
   21     21   
                        if let Some(value) = value {
   22     22   
                            items.push(value);
          23  +
                        } else {
          24  +
                            return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          25  +
                                "dense list cannot contain null values",
          26  +
                            ));
   23     27   
                        }
   24     28   
                    }
   25     29   
                }
   26     30   
            }
   27     31   
            Ok(Some(items))
   28     32   
        }
   29     33   
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   30     34   
            "expected start array or null",
   31     35   
        )),
   32     36   
    }

tmp-codegen-diff/codegen-client-test/rpcv2Cbor/rust-client-codegen/src/protocol_serde/shape_blob_list.rs

@@ -1,1 +42,44 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
pub(crate) fn de_blob_list(
    3      3   
    decoder: &mut ::aws_smithy_cbor::Decoder,
    4      4   
) -> ::std::result::Result<::std::vec::Vec<::aws_smithy_types::Blob>, ::aws_smithy_cbor::decode::DeserializeError> {
    5      5   
    fn member(
    6      6   
        mut list: ::std::vec::Vec<::aws_smithy_types::Blob>,
    7      7   
        decoder: &mut ::aws_smithy_cbor::Decoder,
    8      8   
    ) -> ::std::result::Result<::std::vec::Vec<::aws_smithy_types::Blob>, ::aws_smithy_cbor::decode::DeserializeError> {
    9      9   
        let value = match decoder.datatype()? {
   10     10   
            ::aws_smithy_cbor::data::Type::Null => {
   11         -
                decoder.null()?;
   12         -
                return ::std::result::Result::Ok(list);
          11  +
                return ::std::result::Result::Err(::aws_smithy_cbor::decode::DeserializeError::custom(
          12  +
                    "dense list cannot contain null values",
          13  +
                    decoder.position(),
          14  +
                ))
   13     15   
            }
   14     16   
            _ => decoder.blob()?,
   15     17   
        };
   16     18   
        list.push(value);
   17     19   
        Ok(list)
   18     20   
    }
   19     21   
   20     22   
    let mut list = ::std::vec::Vec::new();
   21     23   
   22     24   
    match decoder.list()? {

tmp-codegen-diff/codegen-client-test/rpcv2Cbor/rust-client-codegen/src/protocol_serde/shape_boolean_list.rs

@@ -1,1 +42,44 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
pub(crate) fn de_boolean_list(
    3      3   
    decoder: &mut ::aws_smithy_cbor::Decoder,
    4      4   
) -> ::std::result::Result<::std::vec::Vec<bool>, ::aws_smithy_cbor::decode::DeserializeError> {
    5      5   
    fn member(
    6      6   
        mut list: ::std::vec::Vec<bool>,
    7      7   
        decoder: &mut ::aws_smithy_cbor::Decoder,
    8      8   
    ) -> ::std::result::Result<::std::vec::Vec<bool>, ::aws_smithy_cbor::decode::DeserializeError> {
    9      9   
        let value = match decoder.datatype()? {
   10     10   
            ::aws_smithy_cbor::data::Type::Null => {
   11         -
                decoder.null()?;
   12         -
                return ::std::result::Result::Ok(list);
          11  +
                return ::std::result::Result::Err(::aws_smithy_cbor::decode::DeserializeError::custom(
          12  +
                    "dense list cannot contain null values",
          13  +
                    decoder.position(),
          14  +
                ))
   13     15   
            }
   14     16   
            _ => decoder.boolean()?,
   15     17   
        };
   16     18   
        list.push(value);
   17     19   
        Ok(list)
   18     20   
    }
   19     21   
   20     22   
    let mut list = ::std::vec::Vec::new();
   21     23   
   22     24   
    match decoder.list()? {