Skip to content
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

Fallback doesn't work as expected #60

Open
Jezza opened this issue Jan 22, 2019 · 0 comments
Open

Fallback doesn't work as expected #60

Jezza opened this issue Jan 22, 2019 · 0 comments

Comments

@Jezza
Copy link

Jezza commented Jan 22, 2019

For example:

first.toml

[metadata.a]
name = "value"

[metadata.b]
name = "value"

second.toml

[metadata.b]
name = "value"

[metadata.c]
name = "value"

If I load first.toml, set the result of that to the defaults for second.toml.

Toml defaults = new Toml().read("first.toml");
Toml custom = new Toml(defaults).read("second.toml");

I'd expect to be able to access second.toml's version of metadata.b and metadata.c, but first's version of metadata.c.
But right now, it overrides first.toml's declarations, so I can't access metadata.a.


It would also be nice if it could get to a point where something like this works:

first.toml

[metadata.a]
name = "value"
values = [ "value0", "value1" ]

[metadata.b]
name = "value"

second.toml

[metadata.a]
values = [ "value0"]

When accessing metadata.a, you'd get second.toml's version of values, but inherit the rest from first.toml.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant