Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
std.mergePatch should create resulting object fields at Normal visibi…
…lity, not Unhide (#255) This PR changes the default visibility of fields in objects created by `std.mergePatch`: previously they were at `Unhide` visibility, equivalent to the `:::` operator, but as of this PR they are now at `Normal` standard visibility. Concretely, previously ```sjsonnet {a:: 0} + std.mergePatch({a: 1}, {}) ``` would return `{a: 1}` but after this patch it returns `{a:: 1)`, i.e. it preserves the hidden field. It turns out that v0.20.0 of google/jsonnet and google/go-jsonnet also differ in their behavior here. That, in turn, is due to a behavior difference in the default visibility of fields in object comprehension results: jsonnet marks object comprehension fields as forced-visible, while go-jsonnet marks them as inherited visibility; see google/jsonnet#1111. jsonnet accepted google/jsonnet#1140 to match go-jsonnet's behavior. Note that sjsonnet already matches go-jsonnet's behavior for object comprehensions: we only have a difference in `std.mergePatch` because our current implementation explicitly hardcodes Unhide visibility. This PR changes that mergePatch-specific behavior to match the current go-jsonnet (and future jsonnet) behavior.
- Loading branch information