How do I use ternary operator in a yaml file for the snakeparser to parse it
I use groovy to parse the expression and the !e tag helps me in doing so. now when i use ternary operator the parser fails.
name : abc
value : !e 5>3 ? true : false
How do I get the parser to actually parse the expression instead of it assuming that the colon in ternary operator in the mapping colon used by yaml
Use any of the following:
Double-quoted scalar (may contain escape sequences):
value: !e "5>3 ? true : false"
Single-quoted scalar (may not contain escape sequences):
value: !e '5>3 ? true : false'
Folded block scalar (the - removes the trailing newline):
value: !e >-
5>3 ? true : false
Literal block scalar (as above):
value: !e |-
5>3 ? true : false
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With