Is your feature request related to a problem? Please describe.
Ref to Pull requests : #134
Describe the solution you'd like
Support for merging multiple JSON/XML fragments to cover complex types
- Sample JSON fragment 1,patch1
{
"spec": {
"containers": [
{
"env": [
{
"name": "DEBUG_ENABLE",
"value": "true"
},
{
"name": "ENV_FLAG",
"value": "test"
}
]
}
]
}
}
- Sample JSON fragment 1,patch2
{
"spec": {
"containers": [
{
"env": [
{
"name": "OPEN_TRACING",
"value": "true"
},
{
"name": "ENV_FLAG",
"value": "dev"
}
]
}
]
}
}
- Call the merge API sample
data := mergeTool.merge(&patch1,patch2)
Note: By specifying the merged parameters, the first is used as the basis, and the subsequent ones override and append related parameters in turn
{
"spec": {
"containers": [
{
"env": [
{
"name": "DEBUG_ENABLE",
"value": "true"
},
{
"name": "OPEN_TRACING",
"value": "true"
},
{
"name": "ENV_FLAG",
"value": "dev"
}
]
}
]
}
}