Skip to content

Commit 924cec2

Browse files
FIX: import serde
1 parent 2546bf5 commit 924cec2

File tree

5 files changed

+12
-4
lines changed

5 files changed

+12
-4
lines changed

codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/generators/RenderSerdeAttribute.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import software.amazon.smithy.rust.codegen.core.util.isStreaming
1818
public object RenderSerdeAttribute {
1919
public fun forStructureShape(writer: RustWriter, shape: StructureShape, model: Model) {
2020
if (shape.members().none { it.isEventStream(model) }) {
21+
importSerde(writer)
2122
writeAttributes(writer)
2223
}
2324
}

rust-runtime/aws-smithy-types/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ base64-simd = "0.8"
1818
[target."cfg(aws_sdk_unstable)".dependencies.serde]
1919
version = "1"
2020
features = ["derive"]
21-
optional = true
2221

2322
[dev-dependencies]
2423
base64 = "0.13.0"
@@ -28,6 +27,7 @@ serde = { version = "1", features = ["derive"] }
2827
serde_json = "1"
2928
criterion = "0.4"
3029
rand = "0.8.4"
30+
ciborium = "0.2.0"
3131

3232
[package.metadata.docs.rs]
3333
all-features = true

rust-runtime/aws-smithy-types/src/blob.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ impl<'de> Visitor<'de> for HumanReadableBlobVisitor {
7070
{
7171
match base64::decode(v) {
7272
Ok(inner) => Ok(Blob { inner }),
73-
Err(e) => Err(serde::de::Error::custom(e)),
73+
Err(e) => Err(E::custom(e)),
7474
}
7575
}
7676
}

rust-runtime/aws-smithy-types/src/date_time/ser.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@ impl serde::Serialize for DateTime {
1111
where
1212
S: serde::Serializer,
1313
{
14+
use serde::ser::Error;
1415
if serializer.is_human_readable() {
1516
match self.fmt(Format::DateTime) {
1617
Ok(val) => serializer.serialize_str(&val),
17-
Err(e) => Err(serde::ser::Error::custom(e)),
18+
Err(e) => Err(Error::custom(e)),
1819
}
1920
} else {
2021
let mut tup_ser = serializer.serialize_tuple(2)?;

rust-runtime/aws-smithy-types/src/document.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,13 @@
55

66
use crate::Number;
77
use std::collections::HashMap;
8-
8+
#[cfg(
9+
any(
10+
all(aws_sdk_unstable, feature = "serde-deserialize"),
11+
all(aws_sdk_unstable, feature = "serde-serialize")
12+
)
13+
)]
14+
use serde;
915
/* ANCHOR: document */
1016

1117
/// Document Type

0 commit comments

Comments
 (0)