. Advertisement .
..3..
. Advertisement .
..4..
I need to find a solution for the mapping values are not allowed in this context problem. Could you give me some advice? Here is my code:
landingPage:
include: false
transitions:
-
condition:location
nextState:location
location:
include:false
transitions:
-
condition:excluded
nextState:excluded
excluded:
include:false
transitions:
-
condition:excluded
nextState: excluded
-
condition:age
nextState:age
The cause:
You get the ”mapping values not allowed in this context” error because you cannot use a multiline plain scalar, like your include:false transitions, as the key to a mapping.
Solution:
After (
:
) in the value indicator, you need to put a space as the following:Your multi-line scalar also need to be quoted:
Another way is putting the plain scalar on a line:
However, there’s one thing to keep in mind. Some libraries do not accept value indicators in a simple scalar form at all, even if they aren’t followed by a space.
we need to use space before “:” Then it will excecute check the yaml script in below http://www.yamllint.com/