
You must specify data or datas, but not both in the same invocation. data (optional): An Optional Object containing the data to be serialized.It is required that either file is provided, or returnText is true. If provided, then returnText must be false or omitted. file (optional): Optional path to a file in the workspace to write the YAML datas to.The call will fail if the file already exists. Writes yaml to a file in the current working directory or a String from an Object or a String. String json = writeJSON returnText: true, json: amap Writing to a string: def amap = ['something': 'my datas', Writing to a file: def amap = ['something': 'my datas', returnText (optional): Return the JSON as a string instead of writing it to a file.pretty (optional): Prettify the output with this number of spaces added to each level of indentation.file (optional): Optional path to a file in the workspace to write to.

Can either be a JSON instance or another Map/List implementation. Write JSON to a file in the current working directory, or to a String. With file dir/my.yml containing something: 'my datas' : def datas = readYaml file: 'dir/my.yml', text: "something: 'Override'" With several YAML documents : def datas = readYaml text: """Īssert datas.something = 'my first document'Īssert datas.something = 'my second document' With only one YAML document : def datas = readYaml text: """ These are added to the resulting object after file and so will overwrite any value already present if not a new YAML document



readYaml: Read yaml from files in the workspace or text.readProperties: Read properties from files in the workspace or text.readMavenPom: Read a maven project file.readJSON: Read JSON from files in the workspace.readCSV: Read content from a CSV file in the workspace.prependToFile: Create a file (if not already exist) in the workspace, and prepend given content to that file.
#Json compare tool offline Offline
nodesByLabel: List of nodes by Label, by default excludes offline nodes.compareVersions: Compare two version number strings.
