Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-18754

Runtime error sending API request without square brackets in params

    XMLWordPrintable

Details

    • Problem report
    • Status: Need info
    • Trivial
    • Resolution: Unresolved
    • 5.2.3rc1, 5.4.0alpha1
    • None
    • API (A)

    Description

       

      Steps to reproduce:

      1) Send API request - "host.get"

      example:

       {
          "jsonrpc": "2.0",
          "method": "host.get",
          "params": {
              "output": "hostid",
              "selectGroups": "extend",
              "filter": {
                  "host": [
                      "H1"
                  ]
              }
          },

      "output": "hostid" - without square brackets (in zabbix documents, with - host.get)

       Result:
      No error in postman response. 

      But checking runtime errors we see: 

       in_array() expects parameter 2 to be array, string given [api_jsonrpc.php:63 -> CJsonRpc->execute() -> CLocalApiClient->callMethod() -> CHost->get() -> CHost->applyQueryOutputOptions() -> CApiService->outputIsRequested() -> in_array() -> CConfigFile->{closure}() in include/classes/api/CApiService.php:269]

      Expected:
      Not sure that runtime error should exists...

      Attachments

        Activity

          People

            zabbix.dev Zabbix Development Team
            smaklakovs Sergejs Maklakovs
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated: