From 1d6f5f3ab93e66f11af3eb05c9255802386ee320 Mon Sep 17 00:00:00 2001 From: vinbab Date: Fri, 21 Aug 2026 11:24:30 +0100 Subject: [PATCH] Fix x-api-version header sent as [object Object] The REST API version field uses the `autocomplete` control, which stores the whole `{value, label}` option object rather than the value string. Interpolating it straight into the header produced `x-api-version: [object Object]`. Veeam 13 tolerates the invalid value and falls back to its latest revision, so this went unnoticed. Veeam 12 correctly rejects it, failing the token request: [400] {"errorCode":"NotImplemented","message":"Unsupported RESTAPI version. The following versions are supported: v1.0-rev1, ... v1.2-rev0"} Resolve the value in the header expression instead, handling both shapes - the object a dropdown selection produces and the plain string that `defaultValue` holds when the field is untouched (which is why only v12 setups, where the revision must be changed from the default, ever failed). Keeps the dropdown and its options, labels, default and help text unchanged. Co-Authored-By: Claude Opus 4.8 --- plugins/VeeamBackupReplication/v1/metadata.json | 12 +++++++++--- plugins/VeeamBackupReplication/v1/ui.json | 1 + 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/plugins/VeeamBackupReplication/v1/metadata.json b/plugins/VeeamBackupReplication/v1/metadata.json index bbbdab64..01c77183 100644 --- a/plugins/VeeamBackupReplication/v1/metadata.json +++ b/plugins/VeeamBackupReplication/v1/metadata.json @@ -1,7 +1,7 @@ { "name": "veeam-backup-replication", "displayName": "Veeam Backup & Replication", - "version": "1.0.0", + "version": "1.0.1", "author": { "name": "SquaredUp Labs", "type": "labs" @@ -41,10 +41,16 @@ "oauth2Scope": "", "ignoreCertificateErrors": "{{ignoreCertificateErrors}}", "oauth2TokenExtraHeaders": [ - { "key": "x-api-version", "value": "{{apiVersion}}" } + { + "key": "x-api-version", + "value": "{{ typeof apiVersion === 'object' ? apiVersion.value : apiVersion }}" + } ], "headers": [ - { "key": "x-api-version", "value": "{{apiVersion}}" } + { + "key": "x-api-version", + "value": "{{ typeof apiVersion === 'object' ? apiVersion.value : apiVersion }}" + } ] } } diff --git a/plugins/VeeamBackupReplication/v1/ui.json b/plugins/VeeamBackupReplication/v1/ui.json index 01978c59..5b1eb914 100644 --- a/plugins/VeeamBackupReplication/v1/ui.json +++ b/plugins/VeeamBackupReplication/v1/ui.json @@ -37,6 +37,7 @@ "defaultValue": "1.3-rev1", "isMulti": false, "isClearable": false, + "allowCustomValues": false, "validation": { "required": true },