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

    • Type: Problem report
    • Status: Need info
    • Priority: Trivial
    • Resolution: Unresolved
    • Affects Version/s: 5.2.3rc1, 5.4.0alpha1
    • Fix Version/s: None
    • Component/s: API (A)
    • Labels:

      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

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

              Dates

              Created:
              Updated: