Skip to content

Commit

Permalink
Fix a test
Browse files Browse the repository at this point in the history
  • Loading branch information
rylev committed Jul 30, 2021
1 parent d8ce878 commit b77b98b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions sdk/cosmos/src/cosmos_entity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ pub trait CosmosEntity<'a> {
fn partition_key(&'a self) -> Self::Entity;
}

impl<'a> CosmosEntity<'a> for serde_json::Value {
type Entity = &'a Self;
fn partition_key(&'a self) -> Self::Entity {
self
}
}

/// Serialize the partition key in the format CosmosDB expects.
pub(crate) fn serialize_partition_key<PK: Serialize>(pk: &PK) -> Result<String, serde_json::Error> {
// this must be serialized as an array even tough CosmosDB supports only a sigle
Expand Down

0 comments on commit b77b98b

Please sign in to comment.