Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standard JSONPATH-Syntax please ! #27

Open
MajorCGN opened this issue Mar 29, 2021 · 0 comments
Open

Standard JSONPATH-Syntax please ! #27

MajorCGN opened this issue Mar 29, 2021 · 0 comments

Comments

@MajorCGN
Copy link

Please use standard JSONPATH syntax.

I used an evaluated syntax on https://jsonpath.com/ on following JSON:

{
  "uuid": "a6ee8177-107b-47dd-bcfd-30960ccc6e9c",
  "number": "2730010",
  "shortname": "KÖLN",
  "longname": "KÖLN",
  "km": 688.0,
  "agency": "WSA RHEIN",
  "longitude": 6.963300159749653,
  "latitude": 50.93694925646438,
  "water": {
    "shortname": "RHEIN",
    "longname": "RHEIN"
  },
  "timeseries": [
    {
      "shortname": "W",
      "longname": "WASSERSTAND ROHDATEN",
      "unit": "cm",
      "equidistance": 15,
      "currentMeasurement": {
        "timestamp": "2021-03-28T22:00:00+02:00",
        "value": 258.0,
        "trend": 0,
        "stateMnwMhw": "normal",
        "stateNswHsw": "normal"
      },
      "gaugeZero": {
        "unit": "m. ü. NHN",
        "value": 35.038,
        "validFrom": "2019-11-01"
      }
    },
    {
      "shortname": "Q",

(...)

with $.timeseries[0].currentMeasurement.value and it worked.: 258,0 was given back. Perfect, easy, works as exprected.

Couldn't figure out, why i could not get same result for systeminfo., because it uses a "special" but not easier "version" of JSONPATH. Documentation and support are very very limited on this "special" way opposite to "real" JSONPATH. And most users do not want to learn exotic ways to get a single value from a JSON, when ther's an easier way.

"Normal" JSONPATH would have solved my simple search.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant