-
Notifications
You must be signed in to change notification settings - Fork 184
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
Improve accessing nested elements in JSON payloads #303
Comments
We have very good experiences with the jsonpointer Python module, please consider this as well. Personally, i would give JSON Pointer (RFC 6901) preference over JSONPath, as the former also sports RFC formalities. It is really easy to work with and we intensively use it across the board in different projects, e.g. here or here. |
That’s how we’ll do it.
|
Hi again, at 1 ff., @u-l-m-i shared with us how TTN's optional JSON event message filtering capabilities look like: You can use an expression like Other than this, I recently discovered the Morph! package, which also looks like an excellent candidate to spice up the transformation subsystem in one way or another, maybe only in the form of proper user guidance, maybe more. With kind regards, Footnotes |
I just discovered the excellent Footnotes |
On this topic, I just rediscovered the JMESPath query language and the corresponding Python implementation jmespath.py by @jamesls and contributors. Apparently, it is involved in the Mars Helicopter mission in some way or another 💯. Other than this, it seems to be well engineered (citing some highlights below), and supporting multiple languages would blend well with ideas like GH-667 and GH-669. A Complete Specification
A compliance test suite
Libraries in Multiple Languages
On Mars |
Hi again, at 12, we shared a recipe including a JMESPath expression to extract the most recent scalar measurement value from a list of measurement objects. The data is coming from Paxcounter devices. In this case, with respect to the example data shared below, the answer to the question in form of the JMESPath expression is 42. With kind regards, Expression
Data Samplepaxcounter_demo_data = [
{
"ble": 0.0,
"pax": 2.0,
"time": "2023-06-08T18:52:39.502Z",
"timesync_seqno": None,
"wifi": 2.0
},
{
"ble": 0.0,
"pax": 42.0,
"time": "2023-06-08T18:53:39.501Z",
"timesync_seqno": None,
"wifi": 2.0
}
] Footnotes |
I think we should add JSONPath support (perhaps JSONPath RW to mqttwarn; it would make people's lives easier when accessing elements in JSON payloads.
The text was updated successfully, but these errors were encountered: