I'm trying to merge sequence values with YAML to after deserialize with SnakeYAML with JAVA.
I expected this results:
{
"root": {
"seq4": [
"001",
"002",
"003"
],
"seq3": [
"001",
"002",
"003"
],
"seq2": [
"001",
"002"
],
"seq1": [
"001",
"002"
]
}
}
But this is not possible for me with this YAML example:
root:
seq1: &seq1
- '001' #first
- '002' #secod
seq2: *seq1
seq3: &seq3
*seq1
- '003' #third
seq4: *seq3
This example return the message:
while parsing a block mapping in "", line 2, column 3: seq1: &anch1 ^ expected , but found '' in "", line 7, column 5: *anch1 ^
Also, I probe this YAML definition but its return error to:
root:
seq1: &anch1
- '001' #first
- '002' #secod
seq2: *anch1
seq3: &anch2
<<: *anch1
- '003' #third
seq4: *anch2
Any idea?? Thanks