hubcio commented on code in PR #3051:
URL: https://github.com/apache/iggy/pull/3051#discussion_r3010935905


##########
core/common/src/types/snapshot/mod.rs:
##########
@@ -35,36 +35,49 @@ impl Snapshot {
 #[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
 pub enum SystemSnapshotType {
     /// Overview of the filesystem.
+    #[serde(alias = "filesystem_overview")]

Review Comment:
   the `serde(alias)` approach creates a serialize/deserialize asymmetry - the 
server outputs PascalCase but accepts snake_case on input. a round-trip through 
`deserialize("filesystem_overview") -> serialize` produces 
`"FilesystemOverview"` - a different string. the wire format has no single 
source of truth.
   
   the codebase standard is `#[serde(rename_all = "snake_case")]`, used by 
`UserStatus`, `ConsumerKind`, `IdKind`, `PartitioningKind`, `PollingKind`, 
`DiagnosticEvent`, `HeaderKind` - 7 enums total. these snapshot enums should 
use the same approach so serialize and deserialize are symmetric.
   
   this doesn't fix #2699 which asks for a consistent serialization strategy - 
it introduces a new inconsistency instead.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to