Skip to content

Builtin function for setting a nested object key? #231

Discussion options

You must be logged in to vote

You could use the json.patch builtin function:

updated_meta := json.patch(base_test_input, [
	{"op": "replace", "path": "/resource_changes/0/change/after/metadata/foo", "value": "baz"}
])

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@caulagi
Comment options

Answer selected by caulagi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants