diff --git a/specs/schemas/workspace.json b/specs/schemas/workspace.json index f0c683d415..89b2bb089e 100644 --- a/specs/schemas/workspace.json +++ b/specs/schemas/workspace.json @@ -1,5 +1,5 @@ { - "$schema": "", + "$schema": "https://json-schema.org/2020-12/schema", "type": "object", "properties": { "version": { @@ -104,4 +104,4 @@ } } } -} \ No newline at end of file +} diff --git a/vscode/microsoft-kiota/src/extension.ts b/vscode/microsoft-kiota/src/extension.ts index 564d3fd57d..2edb17f965 100644 --- a/vscode/microsoft-kiota/src/extension.ts +++ b/vscode/microsoft-kiota/src/extension.ts @@ -659,9 +659,12 @@ async function showUpgradeWarningMessage(clientPath: string, context: vscode.Ext } const workspaceFileData = await vscode.workspace.fs.readFile(vscode.Uri.file(workspaceFilePath)); const workspaceFile = JSON.parse(workspaceFileData.toString()) as { kiotaVersion: string }; - const clientVersion = workspaceFile.kiotaVersion.toLocaleLowerCase(); - if (clientVersion.toLocaleLowerCase() !== kiotaVersion) { - await vscode.window.showWarningMessage(vscode.l10n.t("Client will be upgraded from version {0} to {1}, upgrade your dependencies", clientVersion, kiotaVersion)); + // don't fail if kiotaVersion isn't in the workspace config file + if (workspaceFile.kiotaVersion) { + const clientVersion = workspaceFile.kiotaVersion.toLocaleLowerCase(); + if (clientVersion !== kiotaVersion) { + await vscode.window.showWarningMessage(vscode.l10n.t("Client will be upgraded from version {0} to {1}, upgrade your dependencies", clientVersion, kiotaVersion)); + } } }