From 906b6a6f327bc259d996300680b77cef252dc55d Mon Sep 17 00:00:00 2001 From: Travis Prescott Date: Tue, 5 Mar 2024 13:09:24 -0800 Subject: [PATCH 1/3] Disable ResourceNameRestriction LintDiff rule. --- packages/rulesets/src/spectral/az-arm.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/rulesets/src/spectral/az-arm.ts b/packages/rulesets/src/spectral/az-arm.ts index c1b227eeb..9aa34bb7c 100644 --- a/packages/rulesets/src/spectral/az-arm.ts +++ b/packages/rulesets/src/spectral/az-arm.ts @@ -798,6 +798,8 @@ const ruleset: any = { description: "This rule ensures that the authors explicitly define these restrictions as a regex on the resource name.", message: "{{error}}", severity: "error", + disableForTypeSpec: true, + disableForTypeSpecReason: "Covered by TSP's '@azure-tools/typespec-azure-resource-manager/arm-resource-name-pattern' rule.", resolved: true, formats: [oas2], given: "$[paths,'x-ms-paths'].*.^", From 68a7ceac70348894cce252efa259dad3577ef2cb Mon Sep 17 00:00:00 2001 From: Travis Prescott Date: Wed, 3 Apr 2024 09:30:15 -0700 Subject: [PATCH 2/3] Disable rules for TypeSpec. --- packages/rulesets/src/spectral/az-arm.ts | 6 ++++++ packages/rulesets/src/spectral/az-common.ts | 2 ++ 2 files changed, 8 insertions(+) diff --git a/packages/rulesets/src/spectral/az-arm.ts b/packages/rulesets/src/spectral/az-arm.ts index 9aa34bb7c..b944726db 100644 --- a/packages/rulesets/src/spectral/az-arm.ts +++ b/packages/rulesets/src/spectral/az-arm.ts @@ -93,6 +93,8 @@ const ruleset: any = { rpcGuidelineCode: "RPC-Async-V1-01, RPC-Put-V1-11", description: "LRO and Synchronous PUT must have 200 & 201 return codes.", severity: "error", + disableForTypeSpec: true, + disableForTypeSpecReason: "Covered by TSP's '@azure-tools/typespec-azure-resource-manager/arm-put-operation-response-codes' rule.", message: "{{error}}", resolved: true, formats: [oas2], @@ -157,6 +159,8 @@ const ruleset: any = { description: "Location header must be supported for all async operations that return 202.", message: "A 202 response should include an Location response header.", severity: "error", + disableForTypeSpec: true, + disableForTypeSpecReason: "Covered by TSP's '@azure-tools/typespec-azure-resource-manager/arm-location-header' rule.", formats: [oas2], given: "$.paths[*][*].responses[?(@property == '202')]", then: { @@ -173,6 +177,8 @@ const ruleset: any = { description: "Synchronous POST must have either 200 or 204 return codes and LRO POST must have 202 return code. LRO POST should also have a 200 return code only if the final response is intended to have a schema", severity: "error", + disableForTypeSpec: true, + disableForTypeSpecReason: "Covered by TSP's '@azure-tools/typespec-azure-resource-manager/arm-post-operation-response-codes' rule.", message: "{{error}}", resolved: true, formats: [oas2], diff --git a/packages/rulesets/src/spectral/az-common.ts b/packages/rulesets/src/spectral/az-common.ts index 1e1b03499..9ce5ec220 100644 --- a/packages/rulesets/src/spectral/az-common.ts +++ b/packages/rulesets/src/spectral/az-common.ts @@ -412,6 +412,8 @@ const ruleset: any = { message: "'{{property}}' parameter lacks 'description' property. Consider adding a 'description' element. Accurate description is essential for maintaining reference documentation.", severity: "error", + disableForTypeSpec: true, + disableForTypeSpecReason: "Covered by TSP's '@azure-tools/typespec-azure-core/documentation-required' rule.", resolved: false, formats: [oas2], given: ["$.parameters.*"], From dd6f0ae9a0ea6ef55410b80a9150144fde333d59 Mon Sep 17 00:00:00 2001 From: Travis Prescott Date: Wed, 3 Apr 2024 10:12:24 -0700 Subject: [PATCH 3/3] Bump ruleset version. --- packages/rulesets/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/rulesets/package.json b/packages/rulesets/package.json index 180bd9987..5633f5a63 100644 --- a/packages/rulesets/package.json +++ b/packages/rulesets/package.json @@ -1,6 +1,6 @@ { "name": "@microsoft.azure/openapi-validator-rulesets", - "version": "2.0.1", + "version": "2.0.2", "description": "Azure OpenAPI Validator", "main": "dist/index.js", "scripts": {