mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 22:57:16 -04:00
coerce scalars into single-valued arrays
This makes YAML config files look more sane stdout: debug: true Instead of stdout: debug: - true
This commit is contained in:
parent
89c2ee7060
commit
7c74bcce15
1 changed files with 2 additions and 0 deletions
|
@ -302,6 +302,8 @@ module LogStash::Config::Mixin
|
|||
elsif validator.is_a?(Symbol)
|
||||
# TODO(sissel): Factor this out into a coersion method?
|
||||
# TODO(sissel): Document this stuff.
|
||||
value = [*value] # coerce scalar to array if necessary
|
||||
|
||||
case validator
|
||||
when :hash
|
||||
if value.size % 2 == 1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue