-
Notifications
You must be signed in to change notification settings - Fork 49
Add linter rule to suggest the scope parameter #765
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
base: main
Are you sure you want to change the base?
Conversation
…zure/azure-openapi-validator into bdefoy/suggest-scope-parameter
This rule should remain separate as it is a warning, not an error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please update packages/rulesets/CHANGELOG.md
, similar to:
## How to fix | ||
|
||
Remove all explicitly-scoped paths that only vary in scope and create a path with the `scope` parameter. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may not be a good idea from a customer viewpoint as it makes it less obvious as to what scopes are truly supported. Before we decide one way or the other, lets first check how TypeSpec generates the different API paths for this scenario and align the linter rules to work with that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see support in TypeSpec for the scope parameter, but I'm also not seeing how you can generate a spec with a resource at multiple scopes aside from extension resources. I might look into this a bit more and follow up
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure that there is any use of a scope parameter outside of extension resources. I have not been able to find one in the private API specs repo yet, and I'm not sure how it would fit with the RPC.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The scenario described in #750 is a rare case where an RP is attempting to basically duplicate endpoints. I will change the rule to look for duplicate endpoints like this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🕐
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
Add a rule that helps disambiguate paths that share the same
/providers
suffix by suggesting the use of thescope
parameter.