edit_json

A tool to edit a JSON file.

Arguments

NameTypeDescriptionRequired

path_to_file

string

The path to the file that needs editing, relative to the project root.

json_path

string

The JSON path to the target location for change, using dot notation (e.g., 'key.subkey').

action

string

The action to perform: add, delete, or update.

values

array

A list of objects, each containing a 'key' and 'value' to be added, deleted, or updated.

Returns

TypeDescription

string

The path to the edited file.

Example

- name: edit_json
  arguments:
    path_to_file: <path-to-file>
    json_path: <json-path>
    action: <action>
    values: <values>
  returns: <path-to-file>

Last updated