Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.6",
"version": "2.0.7",
"description": "Azure OpenAPI Validator",
"main": "dist/index.js",
"scripts": {
Expand Down
3 changes: 2 additions & 1 deletion packages/rulesets/src/spectral/az-arm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,8 @@ const ruleset: any = {
message: "{{description}}",
disableForTypeSpec: true,
disableForTypeSpecReason: "Covered by TSP's '@azure-tools/typespec-azure-resource-manager/no-record' rule.",
resolved: true,
// Only report errors at the source, not from inside $refs (the resolved document)
resolved: false,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI I believe the resolved is defined here:
https://docs.stoplight.io/docs/spectral/d3482ff0ccae9-rules#resolved

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. After reading that, I feel even more confident this rule should use resolved: false.

formats: [oas2],
// In some cases, variable "@" will be "null" when evaluating the expression, so it must be checked before dereferencing
given:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,12 @@ test("AvoidAdditionalProperties should find errors", () => {
},
required: ["type"],
},
ThisRef: {
description: "Ensure error is NOT raised from inside $refs (rule sets resolved:false)",
properties: {
$ref: "#/definitions/This",
},
},
},
}
return linter.run(oasDoc).then((results) => {
Expand Down