Skip to content

Commit 7995b06

Browse files
committed
fix
1 parent 056fa7d commit 7995b06

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/pinecone/data.rs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::pinecone::{PineconeClient, PINECONE_API_VERSION_KEY};
1+
use crate::pinecone::PineconeClient;
22
use crate::protos::vector_service_client::VectorServiceClient;
33
use crate::utils::errors::{handle_response_error, PineconeError};
44
use once_cell::sync::Lazy;
@@ -133,7 +133,7 @@ impl Index {
133133
.collect::<Vec<String>>()
134134
.join("\n");
135135

136-
req_builder = req_builder.json(&ndjson);
136+
req_builder = req_builder.body(ndjson);
137137

138138
let req = req_builder
139139
.build()
@@ -808,4 +808,14 @@ mod tests {
808808
.await
809809
.expect_err("Expected connection error");
810810
}
811+
812+
#[tokio::test]
813+
async fn test_serialize_json() {
814+
let json_val = serde_json::json!({
815+
"_id": "123",
816+
"hello": "world"}
817+
);
818+
let json = r#"{"_id":"123","hello":"world"}"#;
819+
assert_eq!(json_val.to_string(), json);
820+
}
811821
}

0 commit comments

Comments
 (0)