I am trying to start implementing ZAP automation in one of our project, i am able to run scan using YAML file and it's also generating html report file at this location /root/2022-06-13-ZAP-Report-example.com.html
But, i want to get results in JSON format, how can i achieve it? I tried to look over lot of resources, didn't found anything interesting.
env: Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â
 contexts :             Â
  - name: my_context       Â
   urls:           Â
    - "
https://example.com"
 parameters:
  failOnError: true
  failOnWarning: false Â
  progressToStdout: true
jobs:
 - type: passiveScan-config      # Passive scan configuration
  parameters:
   maxAlertsPerRule: 10       # Int: Maximum number of alerts to raise per rule
   scanOnlyInScope: true       # Bool: Only scan URLs in scope (recommended)
   maxBodySizeInBytesToScan:     # Int: Maximum body size to scan, default: 0 - will scan all messages
  Â
 - type: spider            # The traditional spider - fast but doesnt handle modern apps so well
  parameters:
   context:             # String: Name of the context to spider, default: first context
   url:               # String: Url to start spidering from, default: first context URL
   failIfFoundUrlsLessThan:     # Int: Fail if spider finds less than the specified number of URLs, default: 0
   warnIfFoundUrlsLessThan:     # Int: Warn if spider finds less than the specified number of URLs, default: 0
   maxDuration:           # Int: The max time in minutes the spider will be allowed to run for, default: 0 unlimited
   maxDepth:             # Int: The maximum tree depth to explore, default 5
   maxChildren:           # Int: The maximum number of children to add to each node in the tree
   acceptCookies:          # Bool: Whether the spider will accept cookies, default: true
   handleODataParametersVisited:   # Bool: Whether the spider will handle OData responses, default: false
   handleParameters:         # Enum [ignore_completely, ignore_value, use_all]: How query string parameters are used when checking if a URI has already been visited, default: use_all
   maxParseSizeBytes:        # Int: The max size of a response that will be parsed, default: 2621440 - 2.5 Mb
   parseComments:          # Bool: Whether the spider will parse HTML comments in order to find URLs, default: true
   parseGit:             # Bool: Whether the spider will parse Git metadata in order to find URLs, default: false
   parseRobotsTxt:          # Bool: Whether the spider will parse 'robots.txt' files in order to find URLs, default: true
   parseSitemapXml:         # Bool: Whether the spider will parse 'sitemap.xml' files in order to find URLs, default: true
   parseSVNEntries:         # Bool: Whether the spider will parse SVN metadata in order to find URLs, default: false
   postForm:             # Bool: Whether the spider will submit POST forms, default: true
   processForm:           # Bool: Whether the spider will process forms, default: true
   requestWaitTime:         # Int: The time between the requests sent to a server in milliseconds, default: 200
   sendRefererHeader:        # Bool: Whether the spider will send the referer header, default: true
   threadCount:           # Int: The number of spider threads, default: 2
   userAgent:            # String: The user agent to use in requests, default: '' - use the default ZAP one
 - type: passiveScan-wait       # Passive scan wait for the passive scanner to finish
  parameters:
   maxDuration: 1          # Int: The max time to wait for the passive scanner, default: 0 unlimited
 - type: activeScan
 - type: report            # Report generation
  parameters:
   displayReport: true
  risks: Â
   - high
   - medium
   - low
   - info