Created
December 31, 2018 19:29
-
-
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 file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# this yaml file will have two key pairs. | |
foo: val | |
bar: val1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This has teh same key pairs, but also includes a list | |
# All of these are optional | |
foo: val | |
bar: val1 | |
baz: | |
- val2 | |
- val3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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