Skip to content

Commit

Permalink
RUST-1743 Fix gridfs numeric type serialization (#941)
Browse files Browse the repository at this point in the history
  • Loading branch information
abr-egn authored Aug 29, 2023
1 parent d1c12e1 commit 044401b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/gridfs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ pub(crate) struct Chunk<'a> {
#[serde(rename = "_id")]
id: ObjectId,
files_id: Bson,
#[serde(serialize_with = "bson::serde_helpers::serialize_u32_as_i32")]
n: u32,
#[serde(borrow)]
data: RawBinaryRef<'a>,
Expand All @@ -51,7 +52,10 @@ pub struct FilesCollectionDocument {
pub length: u64,

/// The size of the file's chunks in bytes.
#[serde(rename = "chunkSize")]
#[serde(
rename = "chunkSize",
serialize_with = "bson::serde_helpers::serialize_u32_as_i32"
)]
pub chunk_size_bytes: u32,

/// The time at which the file was uploaded.
Expand Down

0 comments on commit 044401b

Please sign in to comment.