Skip to content

Commit

Permalink
Code changes to remove ContentSerializationFormat. Addressing minor r…
Browse files Browse the repository at this point in the history
…eview comments.
  • Loading branch information
kundadebdatta committed Oct 23, 2024
1 parent aea8a3a commit 3245664
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 deletions.
4 changes: 0 additions & 4 deletions Microsoft.Azure.Cosmos/src/Handler/RequestInvokerHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,6 @@ public override async Task<ResponseMessage> SendAsync(
&& RequestInvokerHandler.IsPointOperationSupportedForBinaryEncoding(request))
{
request.Headers.Add(HttpConstants.HttpHeaders.SupportedSerializationFormats, RequestInvokerHandler.BinarySerializationFormat);
if (request.Content != null)
{
request.Headers.Add(HttpConstants.HttpHeaders.ContentSerializationFormat, RequestInvokerHandler.BinarySerializationFormat);
}
}

await this.ValidateAndSetConsistencyLevelAsync(request);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,16 +145,13 @@ public byte[] ReadAll()
public JsonSerializationFormat GetJsonSerializationFormat()
{
this.ReadFirstByteAndResetStream();
if (this.firstByteBuffer[0] == (byte)JsonSerializationFormat.Binary)
{
return JsonSerializationFormat.Binary;
}
else

return this.firstByteBuffer[0] switch
{
return this.firstByteBuffer[0] == (byte)JsonSerializationFormat.HybridRow
? JsonSerializationFormat.HybridRow
: JsonSerializationFormat.Text;
}
(byte)JsonSerializationFormat.Binary => JsonSerializationFormat.Binary,
(byte)JsonSerializationFormat.HybridRow => JsonSerializationFormat.HybridRow,
_ => JsonSerializationFormat.Text,
};
}

/// <summary>
Expand Down

0 comments on commit 3245664

Please sign in to comment.