def write_json()

in migration_toolkit/common/file_writer.py [0:0]


def write_json(filepath: str, data: Any):
  logger.info(f"Writing JSON to file: '{filepath}'")
  logger.debug(f"Data: {data}")

  dirname = os.path.dirname(filepath)
  if not os.path.exists(dirname):
    os.makedirs(dirname)
  with open(filepath, "w") as f:
    json.dump(data, f)