Replies: 4 comments 7 replies
-
There is no plan to do that. It is a rather specialized feature. A more generic feature that might help would be to have a callback parser that calls back on each node with a path and value. Maybe just leaf node. Not sure how performant that would be. Another option might be to add a function to flatten tree. Have to give it some thought. |
Beta Was this translation helpful? Give feedback.
-
@notdodo Depending on your use case, you might have some success with using https://github.com/filip26/ld-cli which I sponsored it's creation. It's a CLI created from their other project https://github.com/filip26/titanium-json-ld which uses the Jakarta JSON Processing. You can open an issue for the ld-cli if it doesn't work out for your use case and we might be able to help further. But I know @ohler55 loves challenges for ojg. :-) |
Beta Was this translation helpful? Give feedback.
-
Have you looked at the jp.Walk() function? It seems like that may satisfy what you are looking for with a simple callback that builds the map you described. |
Beta Was this translation helpful? Give feedback.
-
Released v1.20.3 with a justLeaves option to jp.Walk(). |
Beta Was this translation helpful? Give feedback.
-
Hi!
I'd like to know, if it's possible or if you planned to add it, an option to "flat" all the maps or structs during a Marshal or Decompose.
Something like:
from:
{"a": "3", "b": {"c":true}}
to:
{"a":"3","b.c":true}
but also for embedded structs and arrays
Beta Was this translation helpful? Give feedback.
All reactions