Add exceptions for resources where the user needs to specify the API version#3985
Merged
Conversation
4b462bd to
52bcb44
Compare
Contributor
Does the PR have any schema changes?Found 4 breaking changes: Resources
Functions
|
52bcb44 to
31f379a
Compare
31f379a to
8c50247
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #3985 +/- ##
==========================================
+ Coverage 57.47% 57.51% +0.04%
==========================================
Files 82 82
Lines 13081 13092 +11
==========================================
+ Hits 7518 7530 +12
+ Misses 4987 4986 -1
Partials 576 576 ☔ View full report in Codecov by Sentry. |
danielrbradley
left a comment
Contributor
There was a problem hiding this comment.
I think the logic looks okay based on the tests, but I think both the implementation function name and tests could be quite easily refactored to be more understandable.
8c50247 to
45d2b4c
Compare
Contributor
|
This PR has been shipped in release v2.89.0. |
This was referenced Sep 1, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #3524
This PR adds an exception for two resources where the
api-versionquery parameter works differently. Here, the endpoints receiving the API version merely pass it on to another service, and it's meant to express the API version the second service should use. Therefore, our usual logic of auto-adding the API version doesn't work. The user must instead specify the API version for the second service.Example:
The provider will make a request to the
resourcesservice (RP) here. Theresourcesservice will then in turn make a request to the Microsoft.Storage service. The API version is meant for the latter to receive, so we cannot use whatever API version we have as default forresources.Resource.This PR, specifically fixing
resource.Resource, unlocks the creation ofGitHub.Network/networkSettingsand other resources that are not in the Azure spec. It will also allow users to useResourceas an escape hatch when there are problems with the provider schema.#2467 is closely related - it's just a matter of adding the
ApiVersionproperty for all resources, maybe with a different name.Potential improvement: the description "The API version to use for the operation." for
ApiVersionis not useful, we could replace it.