Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Top-level keys should not be options by default. #10

Open
acobster opened this issue Feb 28, 2019 · 0 comments
Open

Top-level keys should not be options by default. #10

acobster opened this issue Feb 28, 2019 · 0 comments

Comments

@acobster
Copy link
Owner

With the possible exception of a small set of well-known options like name, we should not default to interpreting top-level keys as option names and inserting them as options. Instead we should just require a top level options: key.

Consider the scenario where we want to define a common structure using YAML's merge syntax:

some_stuff: &some_stuff
  a:
  b:
  c:

combined_stuff:
  <<: *some_stuff
  d:
  e:
  f:

other_stuff:
  <<: *some_stuff
  custom: abcd

This will be interpreted as defining an option called some_stuff with the value of an array, which is probably not what we want. We should be able to do this instead:

some_stuff: &some_stuff
  a:
  b:
  c:

options:
  combined_stuff:
    <<: *some_stuff
    d:
    e:
    f:

  other_stuff:
    <<: *some_stuff
    custom: abcd

...which will only define combined_stuff and other_stuff as options.

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

No branches or pull requests

1 participant