-
Notifications
You must be signed in to change notification settings - Fork 118
Open
Description
When adding a empty string "" in array, it is removed after parsing:
Small example
from pyhocon import ConfigFactory
from pyhocon import HOCONConverter
conf = ConfigFactory.parse_string('''
features: [
less noisy / less pedantic syntax
"hey"
""
# ability to write comments
]
features2 = ["a", "b", "", "d"]
''')
print(conf.as_plain_ordered_dict())
print(HOCONConverter.to_json(conf))
print(conf)
Prints
OrderedDict([('features', ['less noisy / less pedantic syntax', 'hey']), ('features2', ['a', 'b', 'd'])])
{
"features": [
"less noisy / less pedantic syntax",
"hey"
],
"features2": [
"a",
"b",
"d"
]
}
ConfigTree([('features', ['less noisy / less pedantic syntax', 'hey']), ('features2', ['a', 'b', 'd'])])
When using the regular (scala) HOCON:
https://hocon-playground.herokuapp.com/
Output:
{
"features" : [
"less noisy / less pedantic syntax",
"hey",
""
],
"features2" : [
"a",
"b",
"",
"d"
]
}
dhuang, davlee1972 and yuntaoL
Metadata
Metadata
Assignees
Labels
No labels