Here is the endpoint I'm trying to deserialize. The issue is within the bids, asks and changes. How do I handle it? The API says it's array of [price, quantity].
Snippet
[JsonNumberHandling(JsonNumberHandling.AllowReadingFromString)]
public record Depth(
    [property: JsonPropertyName("type")] DepthType Type,
    [property: JsonPropertyName("pair")] string Pair,
    [property: JsonPropertyName("sequence")] long Sequence,
    [property: JsonPropertyName("asks")] List<List<string>> Asks,
    //[property: JsonPropertyName("bids")] IEnumerable<Level> Bids,
    [property: JsonPropertyName("prev_sequence")] long PreviousSequence
    //[property: JsonPropertyName("changes")] IEnumerable<Changes> Changes
);
[JsonConverter(typeof(JsonStringEnumMemberConverter))]
public enum DepthType
{
    [EnumMember(Value = "snapshot")]
    Snapshot,
    [EnumMember(Value = "update")]
    Update
}
public record Level(decimal Price, decimal Quantity);
public record Changes(string Side, decimal Price, decimal Quantity);
Response
{
    "channel":"depth",
    "timestamp":1587929552250,
    "module":"spot",
    "data":{
        "type":"snapshot",
        "pair":"BTC-USDT",
        "sequence":9,
        "bids":[
            [
                "0.08000000",
                "0.10000000"
            ]
        ],
        "asks":[
            [
                "0.09000000",
                "0.20000000"
            ]
        ]
    }
}
{
    "channel":"depth",
    "timestamp":1587930311331,
    "module":"spot",
    "data":{
        "type":"update",
        "pair":"BTC-USDT",
        "sequence":10,
        "prev_sequence":9,
        "changes":[
            [
                "sell",
                "0.08500000",
                "0.10000000"
            ]
        ]
    }
}
Attempt
[AttributeUsage(AttributeTargets.Property)]
public sealed class JsonPlainArrayIndexAttribute : Attribute
{
    public JsonPlainArrayIndexAttribute(int index)
    {
        Index = index;
    }
    public int Index { get; }
}
public sealed class JsonPlainArrayConverter<T> : JsonConverter<T> where T : new()
{
    public override T? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
    {
        Debug.Assert(typeof(T) == typeToConvert);
        var props = typeToConvert.GetProperties();
        var linq = from prop in props
            let attr = prop.GetCustomAttributes(typeof(JsonPlainArrayIndexAttribute), true)
            where prop.CanWrite && attr.Length is 1
            orderby ((JsonPlainArrayIndexAttribute)attr[0]).Index
            select prop;
        var arr = JsonSerializer.Deserialize<IEnumerable<JsonElement>>(ref reader, options);
        if (arr is null)
        {
            return default;
        }
        var result = new T();
        foreach (var (prop, value) in linq.Zip(arr))
        {
            prop.SetValue(result, value.Deserialize(prop.PropertyType, options));
        }
        return result;
    }
    public override void Write(Utf8JsonWriter writer, T value, JsonSerializerOptions options)
    {
        var type = typeof(T);
        var props = type.GetProperties();
        var linq = from prop in props
            let attr = prop.GetCustomAttributes(typeof(JsonPlainArrayIndexAttribute), true)
            where prop.CanRead && attr.Length is 1
            orderby ((JsonPlainArrayIndexAttribute)attr[0]).Index
            select prop.GetValue(value);
        JsonSerializer.Serialize<IEnumerable<object>>(writer, linq, options);
    }
}
[JsonNumberHandling(JsonNumberHandling.AllowReadingFromString)]
public record Depth(
    [property: JsonPropertyName("type")] DepthType Type,
    [property: JsonPropertyName("pair")] string Pair,
    [property: JsonPropertyName("sequence")] long Sequence,
    [property: JsonPropertyName("asks")] BookLevel Asks,
    [property: JsonPropertyName("bids")] BookLevel Bids,
    [property: JsonPropertyName("prev_sequence")] long PreviousSequence
    //[property: JsonPropertyName("changes")] IEnumerable<Changes> Changes
);
[JsonConverter(typeof(JsonStringEnumMemberConverter))]
public enum DepthType
{
    [EnumMember(Value = "snapshot")]
    Snapshot,
    [EnumMember(Value = "update")]
    Update
}
[JsonConverter(typeof(JsonPlainArrayConverter<BookLevel>))]
[JsonNumberHandling(JsonNumberHandling.AllowReadingFromString)]
public record BookLevel
{
    [JsonPlainArrayIndex(0)]
    public string Price { get; init; }
    [JsonPlainArrayIndex(1)]
    public string Quantity { get; init; }
}
public record Changes(string Side, decimal Price, decimal Quantity);
 
     
    
>](https://stackoverflow.com/q/71649101). In fact this looks to be a duplicate, agree?