Hi,
please consider extending the API functionality so that attributes can be returned in their actual data types instead of strings. Consider this excerpt from 'hostinterface.get':
{ "interfaceid": "132", "hostid": "10725", "main": "1", "type": "2", "useip": "1", "ip": "128.1.253.131", "dns": "", "port": "161", "available": "2", "error": "Timeout while connecting to \"128.1.253.131:161\".", "errors_from": "0", "disable_until": "0", "details": { "version": "2", "bulk": "1", "community": "public", "max_repetitions": "10" } }
In order to use this response data, e.g. for further requests to the Zabbix API, unnecessary efforts have to be made, like
- looking up which attributes are acutally supposed to be integers in the docs and typecasting them as such.
- recursively searching strings that are actually integers and casting them, wasting performance and introducing potential errors.
Instead of the API user having to do either of this, API responses could encode their attribues according to their documentation instead of using strings for everything. I understand that changing the default behaviour of the API would be ill advised, however, I would imagine it should be possible to add an optional flag to the common get parameters called 'strict_return_types' or something similar which would trigger this behavior.
Thank you for considering my request and have a nice day!