Skip to content

Commit

Permalink
Disable LintDiff rules for TypeSpec 0.55 (#669)
Browse files Browse the repository at this point in the history
* Disable ResourceNameRestriction LintDiff rule.

* Disable rules for TypeSpec.

* Bump ruleset version.
  • Loading branch information
tjprescott authored Apr 3, 2024
1 parent 2b7ea65 commit d277c5b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/rulesets/package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
8 changes: 8 additions & 0 deletions packages/rulesets/src/spectral/az-arm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down Expand Up @@ -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: {
Expand All @@ -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],
Expand Down Expand Up @@ -798,6 +804,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'].*.^",
Expand Down
2 changes: 2 additions & 0 deletions packages/rulesets/src/spectral/az-common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.*"],
Expand Down

0 comments on commit d277c5b

Please sign in to comment.