我试图使用RestSharp读取一些json数据.
但是我在阅读json对象时遇到了一些问题.我有这个责任:
expand: "html",
self: "<url>/INCIDENT-447",
key: "INCIDENT-447",
fields: {
customfield_11414: {
name: "Corrective Measures",
type: "com.atlassian.jira.plugin.system.customfieldtypes:textarea"
},
summary: {
name: "summary",
type: "java.lang.String",
value: "BLA BLA BLA"
},
Run Code Online (Sandbox Code Playgroud)
我需要使用Property的summery和customfield_11414创建一个对象但是我只需要它们的值.不是整个JSON对象
L.B*_*L.B 10
您可以一起使用Json.Net和dynamic关键字
dynamic dynObj = JsonConvert.DeserializeObject(json);
Console.WriteLine(dynObj.fields.customfield_11414.name + " " +
dynObj.fields.summary.value);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
6971 次 |
| 最近记录: |