You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am encountering an issue with the TOML configuration when trying to pass integer values to a finding field with a custom written plugin. When the integer field (testfield) is included in the TOML file, the parsing fails, and an error is generated. However, string values are parsed and handled correctly.
Steps to Reproduce:
Create in the design Template a finding field as an integer. In my case the following structure was created. ciscatfinding(list) -> object -> name(string), testfield(integer).
Define in the TOML-File of the Plugin the following:
Ensure that data.passed is a string and data.fail is an integer.
Run the plugin
Expected Behavior:
The TOML file should be parsed without errors, and both fields should be correctly filled with values from the data placeholders.
Actual Behavior:
An error occurs when loading the TOML finding template: WARNING Error while loading toml finding template /home/user/.sysreptor/plugins/ciscatpro/findings/ciscat.toml.
If the integer field testfield is removed, the finding is created successfully with the name field correctly pre-filled.
Additional Information:
The issue seems related specifically to integer handling in the TOML configuration.
The text was updated successfully, but these errors were encountered:
Yes, this is currently not possible, unfortunately.
The reason is that reptor first loads the toml and therefore your template must have a valid format. testfield=<!--{{data.fail}}-->, however, is no valid toml because the value is a string and strings must be enclosed with quotes.
The quickest workaround would be to enclose the value with quotes (testfield="<!--{{data.fail}}-->") and to transform the field type to string.
I will, however, have a look if we can cast int values to numbers to make it compatible with number fields.
Description:
I am encountering an issue with the TOML configuration when trying to pass integer values to a finding field with a custom written plugin. When the integer field (testfield) is included in the TOML file, the parsing fails, and an error is generated. However, string values are parsed and handled correctly.
Steps to Reproduce:
Define in the TOML-File of the Plugin the following:
ciscatfinding = [{name="<!--{{data.passed}}-->", testfield=<!--{{data.fail}}-->}]
Expected Behavior:
The TOML file should be parsed without errors, and both fields should be correctly filled with values from the data placeholders.
Actual Behavior:
An error occurs when loading the TOML finding template:
WARNING Error while loading toml finding template /home/user/.sysreptor/plugins/ciscatpro/findings/ciscat.toml.
If the integer field testfield is removed, the finding is created successfully with the name field correctly pre-filled.
Additional Information:
The issue seems related specifically to integer handling in the TOML configuration.
The text was updated successfully, but these errors were encountered: