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
TOML supports "dotted keys", that is about the same as our "dotted notation" when accessing facts.
Our stdlib::to_toml() uses toml-rb code, that has the issue when dealing with dotted keys.
I hit this when following the puppet-grafana's LDAP config example. It uses toml gem at the moment. When replaced with stdlib::to_toml() it produces a broken TOML.
As I see from unit tests, to_toml() expects a proper Puppet DSL Hash, while toml gem can work with dotted keys.
As a consequence, it's impossible to just replace TOML::Generator with our to_toml() function, because example syntax uses dotted key instead of a nested Hash or Array.
Another problem is sections reordering. E.g. [servers.attributes] section goes before [[servers]], which is wrong.
Expected Behavior
It'd be nice if dotted keys wouldn't be quoted.
It'd be nice if sections wouldn't be reordered.
The text was updated successfully, but these errors were encountered:
jay7x
changed the title
stdlib::to_toml is misbehaving on dotted keys
stdlib::to_toml behaves differently on dotted keys compared to TOML::Generator
Apr 26, 2025
Uh oh!
There was an error while loading. Please reload this page.
Describe the Bug
TOML supports "dotted keys", that is about the same as our "dotted notation" when accessing facts.
Our
stdlib::to_toml()
usestoml-rb
code, that has the issue when dealing with dotted keys.I hit this when following the
puppet-grafana
's LDAP config example. It usestoml
gem at the moment. When replaced withstdlib::to_toml()
it produces a broken TOML.As I see from unit tests,
to_toml()
expects a proper Puppet DSL Hash, whiletoml
gem can work with dotted keys.As a consequence, it's impossible to just replace
TOML::Generator
with ourto_toml()
function, because example syntax uses dotted key instead of a nested Hash or Array.Another problem is sections reordering. E.g.
[servers.attributes]
section goes before[[servers]]
, which is wrong.Expected Behavior
The text was updated successfully, but these errors were encountered: