private static PatchSection readPatchSection(JsonObject patchSectionElem) throws IOException {
		JsonArray path = patchSectionElem.get("path") instanceof JsonArray arr ? arr : null;
		JsonArray elements = patchSectionElem.get("elements") instanceof JsonArray arr ? arr : null;
		if (path == null || elements == null) {
			throw new IOException();
		}
		List<PatchLine> lines = new ArrayList<>();
		for (int i = 0; i < elements.size(); i++) {
			lines.add(lineFromJson(elements.get(i).getAsJsonObject()));
		}
		return new PatchSection(path, lines);
	}
Converts this patch to a json array.

@return json array with json encoded patch/diff elements.
Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/golang/rtti/JsonPatch.java