Skip to content

Conversation

@bdefoy
Copy link
Member

@bdefoy bdefoy commented Jan 25, 2025

Add a rule that helps disambiguate paths that share the same /providers suffix by suggesting the use of the scope parameter.

@bdefoy bdefoy marked this pull request as ready for review January 28, 2025 19:45
Copy link
Member

@mikeharder mikeharder left a comment

Choose a reason for hiding this comment

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

@bdefoy bdefoy requested a review from Copilot January 28, 2025 20:15
## How to fix

Remove all explicitly-scoped paths that only vary in scope and create a path with the `scope` parameter.

Copy link
Member

@rkmanda rkmanda Jan 29, 2025

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.

Copy link
Member Author

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

Copy link
Member Author

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.

Copy link
Member Author

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.

Copy link
Member

@rkmanda rkmanda left a comment

Choose a reason for hiding this comment

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

🕐

Copy link

Copilot AI left a 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.

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.

[GetCollectionResponseSchema] Does not disambiguate paths that share the same "/providers" suffix

4 participants