我使用postman调用API,使用JObject发送动态属性,如下所示
我使用JSON将类数据发送到API,但忽略了重复数据的值
public class Details
{
public List<JObject> Mappings { get; set; }
// adding properties to jobject abd mappings
[JsonExtensionData]
public IDictionary<string, JToken> AdditionalProperties { get; set; }
}
我在postman中使用了以下JSON
{
"source": {
"details": "Sample Customer",
"compoet": "Sample Site",
"Name": "Sample Software",
"Version": "1.0.1",
"Creator": "Sample Company"
},
"Mappings":[
{
"data": Test.Name1",
"data": Test.Name23",
"newprop":"Account1",
}
{
"data": "Test.Name2",
"newprop":"Account2",
}
]
}
当我传递重复密钥时,API取第二个值"data": Test.Name23"
,我希望API从Map中取两个值,有人能帮忙吗?
1条答案
按热度按时间6rvt4ljy1#
最好不要这样做,这是my reason
可以将“data”值作为数组传递