Handle blobs and optional members separately
@@ -449,10 +449,12 @@ fn generate_struct_fields<P: GenerateProtocol>(service: &Service,
default,
)]".to_owned()
);
- } else if !shape.required(member_name) {
- lines.push("#[serde(skip_serializing_if=\"Option::is_none\")]".to_owned());
}
}
+
+ if !shape.required(member_name) {
+ lines.push("#[serde(skip_serializing_if=\"Option::is_none\")]".to_owned());
+ }
}
let member_shape = service.shape_for_member(member).unwrap();
