parson icon indicating copy to clipboard operation
parson copied to clipboard

Iterator Functions

Open WillianBR opened this issue 5 years ago • 1 comments

I missed a iterator routines, to allow people to easy walk through JSON as list keys as properties (dot) notation. It'll make things easy to get data from a file where we don't now nothing about the fields.

Let's supose I iterate over a github commit output, a output could be:

Input file:

[
  {
    "sha": "5de0af1694360f09f...fff0776bcc54c6580e63",
    "node_id": "MDY6Q29tbWl0Mz....mYwNzc2YmNjNTRjNjU4MGU2Mw==",
    "commit": {
      "author": {
        "name": "DeCoRawr",
        "email": "[email protected]",
        "date": "2013-12-17T15:49:18Z"
      },

With a output like:

sha=5de0af1694360f09f...fff0776bcc54c6580e63
node_id=MDY6Q29tbWl0Mz....mYwNzc2YmNjNTRjNjU4MGU2Mw==
commit.author.name=DeCoRawr 
[email protected]
commit.author.date=2013-12-17T15:49:18Z

WillianBR avatar Apr 16 '19 00:04 WillianBR

Hi, Sounds nice, I could use it as well.

zarie3 avatar Mar 17 '22 15:03 zarie3