Example: I have 3 classes
public class A
{
public int id;
public string data;
}
public class B
{
public int id;
public List<C> data;
}
public class C
{
public int test;
}
Usage:
var a = new A
{
id = 21,
data = "[{\"test\": 123}]"
};
var text = JsonSerializer.Serialize(a);
var c = JsonSerializer.Deserialize<B>(text);
Class A i'm using to store data in DynamoDb, class B and C as a return type;
How to properly map json array inside json to class B I were trying to use default JsonSerializer and NewtonsoftJson, but both of them threw exceptions
>))]` to `Data` where `EmbeddedLiteralConverter` comes from [this answer](https://stackoverflow.com/a/51850391/3744182) to [How to escape embedded JSON after unescape](https://stackoverflow.com/q/51845381/3744182). or [this answer](https://stackoverflow.com/a/39154630/3744182) to [How do I convert an escaped JSON string within a JSON object?](https://stackoverflow.com/q/39154043/3744182) if you only need deserialization. In fact I think this is a duplicate, agree?
– dbc Dec 13 '21 at 17:41