Share Link
Copied to clipboard
Embed on Your Page
Copied to clipboard
We Stand with Ukraine
https://stackoverflow.com/questions/59937740/how-to-determine-if-a-node-exists-in-after-dynamic-parsing-of-json by dbc_MinLength
Environment version: .NET 9.0.0 (9.0.0)
Json.NET version: Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed


Input JSON:
{
  "deviceId": "ATT",
  "product": "testprod",
  "data": {
    "001": 1,
    "002": 3.1,
    "003": {
      "lat": 0,
      "lng": 0
    },
    "000": -80
  },
  "ts": "2020-01-27T19:29:34Z"
}
Re-serialized JSON:
{
  "deviceId": "ATT",
  "product": "testprod",
  "data": {
    "001": 1,
    "002": 3.1,
    "003": {
      "lat": 0,
      "lng": 0
    },
    "000": -80
  },
  "ts": "2020-01-27T19:29:34Z"
}

Input JSON:
{
      "deviceId": "ATT",
      "product": "testprod",
      "data_in": {
        "ts": "2020-01-27T19:29:34Z",
        "001": 1,
        "002": 3.1,
        "003": {
          "lat": 0,
          "lng": 0
        },
        "000": -80
      }

    }
Re-serialized JSON:
{
  "deviceId": "ATT",
  "product": "testprod",
  "data": {
    "001": 1,
    "002": 3.1,
    "003": {
      "lat": 0,
      "lng": 0
    },
    "000": -80
  },
  "ts": "2020-01-27T19:29:34Z"
}

Input JSON:
{
      "deviceId": "ATT",
      "product": "testprod",
      "data_in": {
        "timestamp": "2020-01-27T19:29:34Z",
        "001": 1,
        "002": 3.1,
        "003": {
          "lat": 0,
          "lng": 0
        },
        "000": -80
      }

    }
Re-serialized JSON:
{
  "deviceId": "ATT",
  "product": "testprod",
  "data": {
    "001": 1,
    "002": 3.1,
    "003": {
      "lat": 0,
      "lng": 0
    },
    "000": -80
  },
  "ts": "2020-01-27T19:29:34Z"
}
Last Run: 7:32:43 pm
Compile: 0.03s
Execute: 0.11s
Memory: 9.27Mb
CPU: 0.14s