From a124b8c2e802844c2326ee1a87c3b7bcefb957bf Mon Sep 17 00:00:00 2001 From: Scott Beddall Date: Wed, 23 Oct 2024 17:43:49 -0700 Subject: [PATCH] add the resourceId to the operationInfo --- ChangeLog.md | 4 ++++ lib/liveValidation/liveValidator.ts | 1 + lib/liveValidation/operationValidator.ts | 1 + package-lock.json | 4 ++-- package.json | 4 ++-- 5 files changed, 10 insertions(+), 4 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index ddb2a988..ac44e767 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,5 +1,9 @@ # Change Log - oav +## 10/23/2024 3.6.0 + +- Update `operationInfo` from `liveValidation` to include `resourceId` of the matched operation. + ## 10/15/2024 3.5.1 - During example generation, include min/max in default titles. diff --git a/lib/liveValidation/liveValidator.ts b/lib/liveValidation/liveValidator.ts index 9495b356..88d65014 100644 --- a/lib/liveValidation/liveValidator.ts +++ b/lib/liveValidation/liveValidator.ts @@ -667,6 +667,7 @@ export class LiveValidator { info.operationMatch = result.operationMatch; } info.operationId = info.operationMatch.operation.operationId!; + info.resourceId = info.operationMatch.operation._path._pathTemplate; return { info }; } catch (error) { return { info, error }; diff --git a/lib/liveValidation/operationValidator.ts b/lib/liveValidation/operationValidator.ts index 31c1390b..896d8b01 100644 --- a/lib/liveValidation/operationValidator.ts +++ b/lib/liveValidation/operationValidator.ts @@ -48,6 +48,7 @@ export interface ValidationRequest { export interface OperationContext { operationId: string; apiVersion: string; + resourceId?: string; operationMatch?: OperationMatch; validationRequest?: ValidationRequest; position?: FilePosition | undefined; diff --git a/package-lock.json b/package-lock.json index cc6db2d9..1e3fd262 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "oav", - "version": "3.5.0", + "version": "3.6.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "oav", - "version": "3.5.0", + "version": "3.6.0", "license": "MIT", "dependencies": { "@apidevtools/swagger-parser": "10.0.3", diff --git a/package.json b/package.json index 4aa15487..2f514a41 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "oav", - "version": "3.5.1", + "version": "3.6.0", "author": { "name": "Microsoft Corporation", "email": "azsdkteam@microsoft.com", @@ -138,4 +138,4 @@ "jest-junit": { "output": "test-results.xml" } -} +} \ No newline at end of file