-
Notifications
You must be signed in to change notification settings - Fork 217
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
fix: Change YAML crate to serde_yaml
#474
Conversation
Note, I have implemented the equivalent for #472 which could include the Presently the The feature has I'm inclined to ignore it since it's not a previously supported feature 🤷♂️ |
05d8cbb
to
b815062
Compare
- `yaml-rust` is unmaintained for over 2 years. - Like with `yaml-rust`, requires special handling for table keys. Signed-off-by: Brennan Kinney <5098581+polarathene@users.noreply.github.com>
b815062
to
cb27a47
Compare
First of all, sorry for the delay. I got sick and am writing this from my bed. So what I see here is a lot of change in behavior when switching from one yaml implementation to another. I am not sure whether I like that, but on the other hand we are in a zero-dot version ( I'll leave it up to you, really! |
Ah, no worries rest up 👍 I pinged due to your activity appearing active and wasn't sure if you were notified of the PR.
It's roughly at parity, at least the implementation is very similar on I've otherwise made note above of known issues. Some of these may not be relevant to
Tests were helpful and ensured that the switch at least passes those, if there is something that wasn't covered, new tests could be added. It may warrant bumping to a
My preference is to #472 which already bundles the equivalent feature change, but without the The yaml format file becomes very simple with one special case for the yaml maps (due to string keys for table being necessary). There may be some differences between this PR and #472 untagged enum approach, but current tests pass all the same. In the event there is an issue, this PR provides an alternative to fallback to. |
Note to self:
|
Now that the MSRV lock file issue is out of the way, I'll be revisiting my PRs this weekend. If you want to block on any let me know, otherwise I'll self-review again and merge after addressing any existing concerns I raised. |
Please do that! Thank you so much for your contributions! |
We now use |
yaml-rust
is unmaintained for over 2 years.yaml-rust
, requires special handling for table keys (ensuring numbers are converted to strings).Resolves: #473
Just some insights below that might be worth noting considering the switch. Presumably this should be delayed until a breaking release is acceptable?
Since
config-rs
is only interested in deserialization, some concerns users may have regarding serializing valid YAML files may be a non-issue, but changing from one YAML crate to another may behave differently with deserialization still:0.9
release (July 2022) ofserde_yaml
, it used theyaml-rust
crate internally. Now it uses a transpiledlibyaml
crate.yaml-rust
format had parsing logic byconfig-rs
to ensure a single document or create an empty Map. You should get similar withserde_yaml
for an empty Map orValueKind::Nil
Map
type inconfig-rs
.serde_yaml
, ideally that would be resolved upstream to properly handle number to string conversion (only seems to be an issue for untagged enums).serde_yaml
changed tagged enums with0.9
release, that is causing some issues from users upgrading from0.8
.config-rs
test suite is passing, but the test coverage for config files input to Rust types may not cover some of these concerns? 🤷♂️serde_yaml
only implements support for what the YAML 1.2 spec states should be treated as bools.yaml-rust
is any better at this though.String
instead of throwing an error depending on the input, as it's technically valid.