1

I have the Json below where I want to retrieve the value of the Line field which in this example is "component = '1.37.1-number-1234-SNAPSHOT'" if it has the word SNAPSHOT in the value.

I'm trying this in python but I'm having trouble accessing this part of Json.

If you can give some light at the end of the tunnel I would appreciate it

"diffs":[
      {
         "source":"None",
         "destination":{
            "components":[
               "abc"
            ],
            "parent":"",
            "name":"abc",
            "toString":"abc"
         },
         "hunks":[
            
         ],
         "truncated":false
      },
      {
         "source":{
            "components":[
               "abcd"
            ],
            "parent":"",
            "name":"abcd",
            "extension":"txt",
            "toString":"abcd"
         },
         "destination":"None",
         "hunks":[
            {
               "sourceLine":1,
               "sourceSpan":2,
               "destinationLine":0,
               "destinationSpan":0,
               "segments":[
                  {
                     "type":"REMOVED",
                     "lines":[
                        {
                           "source":1,
                           "destination":0,
                           "line":"alteração 2",
                           "truncated":false
                        },
                        {
                           "source":2,
                           "destination":0,
                           "line":"",
                           "truncated":false
                        }
                     ],
                     "truncated":false
                  }
               ],
               "truncated":false
            }
         ],
         "truncated":false
      },
      {
         "source":"None",
         "destination":{
            "components":[
               "build.gradle"
            ],
            "parent":"",
            "name":"build.gradle",
            "extension":"gradle",
            "toString":"build.gradle"
         },
         "hunks":[
            {
               "sourceLine":0,
               "sourceSpan":0,
               "destinationLine":1,
               "destinationSpan":615,
               "segments":[
                  {
                     "type":"ADDED",
                     "lines":[
                        {
                           "source":0,
                           "destination":18,
                           "line":"        componente = '1.37.1-number-1234-SNAPSHOT'",
                           "truncated":false
                        },

0 Answers0