I'm trying to deserialize a kind of json as below. The problem is keys are dynamic. But we can find them using instrument_id or product_id. The second problem is about my algorithm. I use a library to get and deserialize string. I only specify api url and library gives it to me as an object. So I have limited options.
- I can use a custom json converter for class
- Or I can use regex on JsonProperty Name
But I dont know how. Any Ideas?
[
{
"currency:BTC":{
"available":"0.09995502",
"leverage":"5",
"leverage_ratio":"5",
"rate":"0.00009984"
},
"currency:USDT":{
"available":"400.00000000",
"leverage":"5",
"leverage_ratio":"5",
"rate":"0.00019992"
},
"instrument_id":"BTC-USDT",
"product_id":"BTC-USDT"
},
{
"currency:EOS":{
"available":"1.9343",
"leverage":"5",
"leverage_ratio":"5",
"rate":"0.00009984"
},
"currency:USDT":{
"available":"7.1571",
"leverage":"5",
"leverage_ratio":"5",
"rate":"0.00019992"
},
"instrument_id":"EOS-USDT",
"product_id":"EOS-USDT"
}
]