0

How to deserialize JSON response if response contains the field System.AreaPath (it is containing dot). Since, I can't create the class with the member System.AreaPath in .NET.

{
  "count": 1,
  "value": [
    {
      "id": 297,
      "rev": 1,
      "fields": {
        "System.AreaPath": "Fabrikam-Fiber-Git",
        "System.TeamProject": "Fabrikam-Fiber-Git",
        "System.IterationPath": "Fabrikam-Fiber-Git",
        "System.WorkItemType": "Product Backlog Item",
        "System.State": "New",
        "System.Reason": "New backlog item",
        "System.CreatedDate": "2014-12-29T20:49:20.77Z",
        "System.CreatedBy": "Jamal Hartnett ",
        "System.ChangedDate": "2014-12-29T20:49:20.77Z",
        "System.ChangedBy": "Jamal Hartnett ",
        "System.Title": "Customer can sign in using their Microsoft Account",
        "Microsoft.VSTS.Scheduling.Effort": 8,
        "WEF_6CB513B6E70E43499D9FC94E5BBFB784_Kanban.Column": "New",
        "System.Description": "Our authorization logic needs to allow for users with Microsoft accounts (formerly Live Ids) - http://msdn.microsoft.com/en-us/library/live/hh826547.aspx"
      },
      "url": "https://fabrikam.visualstudio.com/_apis/wit/workItems/297"
    }
]
}
dbc
  • 104,963
  • 20
  • 228
  • 340

1 Answers1

1

Mark property with [JsonProperty("System.AreaPath")]

MistyK
  • 6,055
  • 2
  • 42
  • 76
  • Thank you for your reply. I found workaround, if we replace substring system.AreaPath by string AreaPath then we can deserialize AreaPath easily. – Hansmukh Jain Aug 02 '18 at 23:32