Open Halkcyon opened 1 year ago
@matthiasbeyer not sure I understand; the default case is yaml-rust
with the second test case being for serde_yaml
.
Yes, I meant add another case where you use only yaml-rust
, without config-rs
in between. This way we can verify that we don't mess things up in the config-rs
implementation!
@matthiasbeyer Done. Surprising result, the new test passes
So if I understand correctly:
yaml-rust
succeedsconfig-rs
(which uses yaml-rust
) failsOkay, so we have to investigate why that is.
This is not specific to YAML parsing, but feature of config-rs
with map lookup keys using dot notation.
Okay, so we have to investigate why that is.
Failure is due to .
not being a permitted raw identifier char (accepting .
here will fix this):
Instead .
is used to designate a child field (accepting a .
above will cause the test for this feature to fail):
That above code is called from this method during config build:
which multiple locations will call via this method:
I'm not too familiar with config-rs
, but vaguely recall some feature to access fields with dot notation. I assume it's for the value map as a string key lookup feature. Thus you probably can't have both here unless there was support to make the distinction 🤷♂️
I understand the intent was to deserialize with the serde rename feature to the desired field. This won't work AFAIK since the builder is creating this cache
prior to deserializing which splits up the key:
# Example input
hello.world: example
192.168.1.1: a string value
Nice. Could you also add one with
yaml-rust
, so that we have all three cases?I will then take these patches and continue based on them... not sure how, but I guess I will think of something.