Improve clarity of API error messages when read-only fields are passed in requests

XMLWordPrintable

    • Type: Change Request
    • Resolution: Unresolved
    • Priority: Minor
    • None
    • Affects Version/s: None
    • Component/s: None
    • None

      Since version 7.0, the Zabbix API became stricter when handling requests that include read-only fields during object creation or modification. While this behavior aligns with improved data integrity, the current error messages returned by the API are too generic and do not help users identify the root cause of failures.

      For example, when a request contains read-only fields that are not permitted in a specific method (such as create), the API responds with:

      {
        "error": {
          "code": -32602,
          "message": "Invalid params.",
          "data": "Incorrect arguments passed to function."
        }
      }

      This makes troubleshooting difficult, especially in scenarios involving version upgrades or API integration migrations.

      Enhance the API’s validation mechanism to identify and report invalid fields explicitly when they violate read-only constraints. A clearer error message will improve the developer experience and simplify integrations and debugging.

            Assignee:
            Unassigned
            Reporter:
            Lucas Frade
            Votes:
            3 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: