A function that updates JSON disk object
You could define a default disk object, so you can show all fields on default values and document the values allowed for each:

var DiskSkelethon = {
    "componentTypeId" : "com.vmware.csp.iaas.blueprint.service",
    "componentId" : null,
    "classId" : "Infrastructure.Compute.Machine.MachineDisk",
    "typeFilter" : null,
    "data" : {
        "capacity" : -1,
        "custom_properties" : null,
        "id" : null,
        "initial_location" : "",
        "is_clone" : false,
        "label" : "",
        "storage_reservation_policy" : "",
        "userCreated" : true,
        "volumeId" : -1
    }
}


Then in your function you will make a copy of it and override just the fields you're changing:

function addDisk(disk, size) {
    var diskNumber = parseInt(disk.slice(-1), 10);
    if (isNaN(diskNumber)) {
       log("some error...");
       return false;
    }
    var diskLabel = "Hard disk " + diskNumber;
    var diskIndex = diskNumber - 1;

    //Updating JSON data object
    var diskData = Object.assign({}, DiskSkelethon)

    diskData.data.capacity = size;
    diskData.data.label = diskLabel;
    diskData.data.volumeId = diskIndex

    data.disks[diskIndex] = diskData
    log(diskLabel + " has capacity of: " + size + " GBs");
}