From 4af30b686ccc2db58a9b32e1d73c4b0980dc7366 Mon Sep 17 00:00:00 2001 From: Thomas Cameron <68596478+thomas-k-cameron@users.noreply.github.com> Date: Tue, 10 Jan 2023 00:59:36 +0900 Subject: [PATCH] UPDATE for RFC30: Serialization and deserialization (#2186) * commit RFC * commit * Delete rfc0023_serialization_and_deserialization.md * fix formatting * https://github.com/awslabs/smithy-rs/pull/1944#discussion_r1054637168 * https://github.com/awslabs/smithy-rs/pull/1944#discussion_r1054632202 * applied grammarly pre-commit * better example wip * FIX * https://github.com/awslabs/smithy-rs/pull/1944#discussion_r1054632468 https://github.com/awslabs/smithy-rs/pull/1944#discussion_r1054818444 https://github.com/awslabs/smithy-rs/pull/1944#discussion_r1054820192 * add examples for output's builer * fixes * fixing unstable feature gate snippet * Update rfc0028_serialization_and_deserialization.md Section is deleted in response to the discussion https://github.com/awslabs/smithy-rs/pull/1944#discussion_r1061577656 * file name fix * Update rfc0030_serialization_and_deserialization.md https://github.com/awslabs/smithy-rs/pull/2183#discussion_r1064573442 * Update rfc0030_serialization_and_deserialization.md --- .../src/rfcs/rfc0030_serialization_and_deserialization.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/design/src/rfcs/rfc0030_serialization_and_deserialization.md b/design/src/rfcs/rfc0030_serialization_and_deserialization.md index 023ca4cb58..a8dac62693 100644 --- a/design/src/rfcs/rfc0030_serialization_and_deserialization.md +++ b/design/src/rfcs/rfc0030_serialization_and_deserialization.md @@ -75,13 +75,17 @@ However, we believe that cfg approach ensure users won't enable this feature by ## Feature Gate for Serialization and De-serialization `Serde` traits are implemented behind feature gates. -`Serialize` is implemented behind `serialize`, while `Deserialize` is implemented behind `deserialize`. +`Serialize` is implemented behind `serde-serialize`, while `Deserialize` is implemented behind `serde-deserialize`. Users must enable the `unstable` feature to expose those features. We considered giving each feature a dedicated feature gate such as `unstable-serde-serialize`. In this case, we will need to change the name of feature gates entirely once it leaves the unstable status which will cause users to make changes to their code base. We conclude that this brings no benefit to the users. +Furthermore, we considered naming the fature-gate `serialize`/`deserialize`. +However, this way it would be confusing for the users when we add support for different serialization/deserialization framework such as `deser`. +Thus, to emphasize that the traits is from `serde` crate, we decided to name it `serde-serialize`/`serde-deserialize` + ## Keeping both features behind the same feature gate We considered keeping both features behind the same feature gate. There is no significant difference in the complexity of implementation.