Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no-response-body rule is triggering for some standard templates #1740

Open
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

AlitzelMendez
Copy link
Member

issue: #1552

@azure-sdk
Copy link
Collaborator

azure-sdk commented Oct 24, 2024

All changed packages have been documented.

  • @azure-tools/typespec-azure-resource-manager
  • @azure-tools/typespec-azure-rulesets
Show changes

@azure-tools/typespec-azure-resource-manager - feature ✏️

Update the arm no-response-body rule to behave similarly to the core rule, but with the additional requirement that the 202 response can and should also be empty

@azure-tools/typespec-azure-rulesets - feature ✏️

Update the arm no-response-body rule to behave similarly to the core rule, but with the additional requirement that the 202 response can and should also be empty

@azure-sdk
Copy link
Collaborator

You can try these changes here

🛝 Playground 🌐 Website 📚 Next docs

@@ -24,6 +24,8 @@ describe("typespec-azure-resource-manager: no response body rule", () => {
await tester
.expect(
`
namespace Azure.MyService;
Copy link
Member

Choose a reason for hiding this comment

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

shouldn't this cause the rule not to execute?

await tester
.expect(
`
namespace Azure.MyService;
Copy link
Member

Choose a reason for hiding this comment

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

Doesn't this cause the rule not to execute?

Copy link
Member Author

Choose a reason for hiding this comment

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

no, this is what makes the rule to execute, this rule is only executed on Azure namespaces, this is also the core rule for reference: https://github.com/Azure/typespec-azure/blob/main/packages/typespec-azure-core/src/rules/no-response-body.ts

Copy link
Member

@markcowl markcowl Oct 31, 2024

Choose a reason for hiding this comment

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

Most ARM namespace start with Microsoft. Our namespaces in typespec-azure, like Azure.Core and Azure.ResourceManager start with Azure.

await tester
.expect(
`
namespace Azure.MyService;
Copy link
Member

Choose a reason for hiding this comment

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

same

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

no-response-body rule is triggering for some standard templates
3 participants