Deep merge two JSON objects with configurable conflict resolution.
This utility combines two JSON objects by merging their properties recursively. When both objects have the same key, you can choose how to resolve the conflict.
| Field | Type | Default | Description |
|---|---|---|---|
| Conflict Strategy | enum | deepMerge | How to resolve when both objects have the same key |
| Array Strategy | enum | replace | How to handle array values during merge |
Base Input:
{
"name": "Alice",
"age": 30
}Merge Input:
{
"email": "alice@example.com"
}Config:
conflictStrategy: deepMerge
arrayStrategy: replaceOutput:
{
"name": "Alice",
"age": 30,
"email": "alice@example.com"
}Base Input:
{
"user": {
"name": "Alice",
"settings": {
"theme": "dark"
}
}
}Merge Input:
{
"user": {
"settings": {
"language": "en"
}
}
}Config:
conflictStrategy: deepMerge
arrayStrategy: replaceOutput:
{
"user": {
"name": "Alice",
"settings": {
"theme": "dark",
"language": "en"
}
}
}| Name | Type | Default | Description |
|---|---|---|---|
| Conflict Strategy | enum | deepMerge | How to resolve when both objects have the same key preferPrimary preferSecondary deepMerge |
| Array Strategy | enum | replace | How to handle array values during merge replace concat unique |
Deep merge these JSON inputs.1{2 "name": "Alice",3 "age": 304}1{2 "email": "alice@example.com"3}1{2 "name": "Alice",3 "age": 30,4 "email": "alice@example.com"5}curl -X POST https://your-domain.com/api/v1/utilities/merge.deep-merge \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"inputs":{"primary":{"name":"Alice","age":30},"secondary":{"email":"alice@example.com"}},"config":{"conflictStrategy":"deepMerge","arrayStrategy":"replace"}}'1{2 "name": "Alice",3 "age": 30,4 "email": "alice@example.com"5}