Skip to content

Instantly share code, notes, and snippets.

@esacteksab
Created December 31, 2018 19:29
Show Gist options
  • Save esacteksab/f564096fe624a08b2085a846d514c6fc to your computer and use it in GitHub Desktop.
Save esacteksab/f564096fe624a08b2085a846d514c6fc to your computer and use it in GitHub Desktop.
How do you handle the different fields that may exist in a yaml file w/o defining every possible component in a struct?
# this yaml file will have two key pairs.
foo: val
bar: val1
# This has teh same key pairs, but also includes a list
# All of these are optional
foo: val
bar: val1
baz:
- val2
- val3
# This has just one key pair, `foo` is not required, so not defined.
#baz is also optional, so not defined in this scenario
bar: val2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment