diff --git a/ast/builtins.go b/ast/builtins.go index 188c9e7e77..0287432e8a 100644 --- a/ast/builtins.go +++ b/ast/builtins.go @@ -1477,7 +1477,9 @@ var JSONRemove = &Builtin{ var JSONPatch = &Builtin{ Name: "json.patch", Description: "Patches an object according to RFC6902. " + - "For example: `json.patch({\"a\": {\"foo\": 1}}, [{\"op\": \"add\", \"path\": \"/a/bar\", \"value\": 2}])` results in `{\"a\": {\"foo\": 1, \"bar\": 2}`. The patches are applied atomically: if any of them fails, the result will be undefined.", + "For example: `json.patch({\"a\": {\"foo\": 1}}, [{\"op\": \"add\", \"path\": \"/a/bar\", \"value\": 2}])` results in `{\"a\": {\"foo\": 1, \"bar\": 2}`. " + + "The patches are applied atomically: if any of them fails, the result will be undefined. " + + "Additionally works on sets, where a value contained in the set is considered to be its path.", Decl: types.NewFunction( types.Args( types.Named("object", types.A), // TODO(sr): types.A? diff --git a/builtin_metadata.json b/builtin_metadata.json index 4651aa554c..b5a20505c6 100644 --- a/builtin_metadata.json +++ b/builtin_metadata.json @@ -7568,7 +7568,7 @@ "v0.46.1", "edge" ], - "description": "Patches an object according to RFC6902. For example: `json.patch({\"a\": {\"foo\": 1}}, [{\"op\": \"add\", \"path\": \"/a/bar\", \"value\": 2}])` results in `{\"a\": {\"foo\": 1, \"bar\": 2}`. The patches are applied atomically: if any of them fails, the result will be undefined.", + "description": "Patches an object according to RFC6902. For example: `json.patch({\"a\": {\"foo\": 1}}, [{\"op\": \"add\", \"path\": \"/a/bar\", \"value\": 2}])` results in `{\"a\": {\"foo\": 1, \"bar\": 2}`. The patches are applied atomically: if any of them fails, the result will be undefined. Additionally works on sets, where a value contained in the set is considered to be its path.", "introduced": "v0.25.0", "result": { "description": "result obtained after consecutively applying all patch operations in `patches`",