[ZBXNEXT-1623] Generic JSON validation support Created: 2013 Feb 14 Updated: 2024 Sep 10 |
|
Status: | Open |
Project: | ZABBIX FEATURE REQUESTS |
Component/s: | Agent (G), Proxy (P), Server (S) |
Affects Version/s: | None |
Fix Version/s: | None |
Type: | Change Request | Priority: | Trivial |
Reporter: | Andris Zeila | Assignee: | Unassigned |
Resolution: | Unresolved | Votes: | 1 |
Labels: | json, validation | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified |
Description |
Currently the validation of received JSON data is done locally in various components. The validation level depends on the component - for example in some places the field format (type) is checked while in other places it is not. One way would be to use JSON schemas for validation. However that might be too 'heavy' approach and it would be better to create some generic lightweight validation funcitonality. |
Comments |
Comment by richlv [ 2013 Oct 15 ] |
(1) not strictly json validation, but general validation issue - how zabbix sender data is validated. |
Comment by Mickael Martin [ 2023 Mar 27 ] |
hello, we use this code in item validation : try { JSON.parse(value); } catch (e) { return e; } return value; } with a trigger find(itemkey,#1,"like","SyntaxError") = 1 or just
return JSON.parse(value);
with a nodata trigger. |