Skip to content

Handling json object with an array #6

@aivgi

Description

@aivgi

1ST THING

This is just AWESOME!

EXAMPLE RESPONSE

This is the response from my API

{
  "data": [
    {
      "scanId": "609a746a-1263-422d-b0c9-4a941bc8fdd5",
      "scanIndex": 20,
      "environmentName": "Default",
      "environmentId": "37971b21-8002-49bf-9727-a0ac8abf65ba",
      "progressPrecentage": 100,
      "status": "Completed",
      "apis": 12,
      "issues": 25,
      "highIssues": 10,
      "mediumIssues": 8,
      "lowIssues": 6,
      "infoIssues": 1,
      "duration": "00:00:33.684",
      "date": "2024-09-01T23:36:23.397548+00:00",
      "testProfileId": "62f5921c-d200-4f6f-a104-29674ad30a94",
      "workerPool": "default_pool",
      "applicationId": "35a579eb-036e-43e7-b682-0984dc1c45f0"
    }
  ]
}

CONTEXT

I'm trying to capture the value for data[0].highIssues

EXPECTED BEHAVIOR

      - name: Check API Status
        uses: mydea/action-wait-for-api@v1
        with:
          url: ${{env.SCAN_URL}}
          expected-response-field: "data[0].highIssues"
          expected-response-field-value: "10"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions