Skip to content

Commit dcbc78c

Browse files
authored
fix(docs): update example result, when using null_override = false (#33)
This pull request updates documentation examples to accurately reflect the behavior of the `deep_merge` function when merging values with `null` and `null_override = false`. Documentation corrections: * Updated the example result in `docs/functions/deep_merge.md` to show that `optional_setting` retains its original value ("enabled") when overridden with `null` and `null_override = false`. * Made the same correction in `internal/provider/deep_merge_function.md` for consistency and accuracy. * Changes have been also tested ``` > provider::lara-utils::deep_merge([{ name = "service", port = 8080, optional_setting = "enabled" }, { port = 9090, optional_setting = null }], { null_override = true }) { "name" = "service" "optional_setting" = null "port" = 9090 } > provider::lara-utils::deep_merge([{ name = "service", port = 8080, optional_setting = "enabled" }, { port = 9090, optional_setting = null }], { null_override = false }) { "name" = "service" "optional_setting" = "enabled" "port" = 9090 } ```
1 parent 3e5fcc7 commit dcbc78c

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

docs/functions/deep_merge.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ locals {
6161
overrides = { port = 9090, optional_setting = null }
6262
6363
result = provider::lara-utils::deep_merge([local.base, local.overrides], { null_override = false })
64-
# Result: { name = "service", port = 9090, optional_setting = null }
64+
# Result: { name = "service", port = 9090, optional_setting = "enabled" }
6565
# Note: null doesn't override the existing value
6666
}
6767
```

internal/provider/deep_merge_function.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ locals {
5151
overrides = { port = 9090, optional_setting = null }
5252
5353
result = provider::lara-utils::deep_merge([local.base, local.overrides], { null_override = false })
54-
# Result: { name = "service", port = 9090, optional_setting = null }
54+
# Result: { name = "service", port = 9090, optional_setting = "enabled" }
5555
# Note: null doesn't override the existing value
5656
}
5757
```

0 commit comments

Comments
 (0)