Skip to content

HybridCache handling Newtonsoft types #6527

Open
@mlankamp

Description

@mlankamp

Description

Items retrieved from Cosmos can contain JArray/Jobject, when the items are put into Hybrid cache the (de)serialization goes wrong

Reproduction Steps

  1. Create a class:
public class Demo
{
   public string Id { get; set; }
   public Dictionary<string, object> Settings { get; set; } = new();
}
  1. Store a json object in Cosmos:
{
  "id": "abc",
  "settings": {
    "abc": [ {"id": 1 }, {"id": 1 }] 
  }
}
  1. Retrieve the item from Cosmos and store in hybrid cache

  2. Retrieve item from hybrid cache

Expected behavior

Unsure

Actual behavior

The JArray/JObject objects are incorrectly (de)serialized.

Regression?

no

Known Workarounds

No response

Configuration

No response

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-caching-hybridbugThis issue describes a behavior which is not expected - a bug.untriaged

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions