Client Test

Client Test

rev. 70b05a5296f85c2653fee05487976373e11ea4dc (ignoring whitespace)

Files changed:

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

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

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 {
          24  +
                        match value {
          25  +
                            Some(value) => {
   25     26   
                                map.insert(key, value);
   26     27   
                            }
          28  +
                            None => {
          29  +
                                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          30  +
                                    "dense map cannot contain null values",
          31  +
                                ))
          32  +
                            }
          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))
   36     43   
        }

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 {
          24  +
                        match value {
          25  +
                            Some(value) => {
   25     26   
                                map.insert(key, value);
   26     27   
                            }
          28  +
                            None => {
          29  +
                                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          30  +
                                    "dense map cannot contain null values",
          31  +
                                ))
          32  +
                            }
          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))
   36     43   
        }

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/operation/null_in_non_sparse.rs

@@ -213,213 +272,273 @@
  233    233   
// The get_* functions below are generated from JMESPath expressions in the
  234    234   
// operationContextParams trait. They target the operation's input shape.
  235    235   
  236    236   
#[allow(unreachable_code, unused_variables)]
  237    237   
#[cfg(test)]
  238    238   
mod null_in_non_sparse_test {
  239    239   
  240    240   
    /// Test ID: NullInNonSparse
  241    241   
    #[::tokio::test]
  242    242   
    #[::tracing_test::traced_test]
         243  +
    #[should_panic]
  243    244   
    async fn null_in_non_sparse_response() {
  244    245   
        let expected_output = crate::operation::null_in_non_sparse::NullInNonSparseOutput::builder()
  245    246   
            .set_list(::std::option::Option::Some(vec!["one".to_owned(), "two".to_owned()]))
  246    247   
            .set_map(::std::option::Option::Some({
  247    248   
                let mut ret = ::std::collections::HashMap::new();
  248    249   
                ret.insert("one".to_owned(), "1".to_owned());
  249    250   
                ret
  250    251   
            }))
  251    252   
            .build();
  252    253   
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(

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 {
          24  +
                        match value {
          25  +
                            Some(value) => {
   25     26   
                                map.insert(key, value);
   26     27   
                            }
          28  +
                            None => {
          29  +
                                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          30  +
                                    "dense map cannot contain null values",
          31  +
                                ))
          32  +
                            }
          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))
   36     43   
        }

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 {
          24  +
                        match value {
          25  +
                            Some(value) => {
   25     26   
                                map.insert(key, value);
   26     27   
                            }
          28  +
                            None => {
          29  +
                                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          30  +
                                    "dense map cannot contain null values",
          31  +
                                ))
          32  +
                            }
          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))
   36     43   
        }

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   
    }