Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement TOML InjectFormat for Inject Input Plugin #182

Open
robfitzgerald opened this issue Apr 8, 2024 · 0 comments
Open

Implement TOML InjectFormat for Inject Input Plugin #182

robfitzgerald opened this issue Apr 8, 2024 · 0 comments
Labels
good first issue Good for newcomers rust Applies to the rust code

Comments

@robfitzgerald
Copy link
Collaborator

robfitzgerald commented Apr 8, 2024

there's a placeholder to inject TOML data in the Inject plugin's value argument but it is not implemented in the corresponding InputFormat enum. providing this would allow for idiomatic TOML injections instead of quote-escaped JSON values. the latter is difficult to read, often exceeding the text window column width, and our IDEs cannot validate it since it is treated as a string. as TOML, it becomes vertical, flatter and easier to be read by a human.

[[plugin.input_plugins]]
type = "inject"
format = "json"
key = "grid_search"
value = '{"a": 123456, "b": 126897, "c": { "something": [1, 2, 3] } }'

instead, as TOML:

[[plugin.input_plugins]]
type = "inject"
format = "toml"
key = "grid_search"
[plugin.input_plugins.value]
a = 123456
b = 126897
[plugin.input_plugins.value.c]
something = [1, 2, 3]
@robfitzgerald robfitzgerald added the good first issue Good for newcomers label Apr 8, 2024
@nreinicke nreinicke added the rust Applies to the rust code label May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers rust Applies to the rust code
Projects
None yet
Development

No branches or pull requests

2 participants