Skip to content

AppServicePlans.json 2022-09-01- Duplicate model name in spec #23709

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@
"type": "string"
},
{
"name": "appServicePlan",
"name": "appServicePlanPatch",
Copy link
Member

@weidongxu-microsoft weidongxu-microsoft Apr 28, 2023

Choose a reason for hiding this comment

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

the change of "name" on body parameter seems unnecessary, as probably only python uses the "name" (it won't affect REST API -- body is body, but it may break SDK if they indeed uses the "name" of body).

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This makes the SDK generation non-deterministic? If this is used as is, the wrong model will be selected (without some override) in some languages SDKs (Python/Go etc). So the PATCH will use the PUT model here, so this is correcting this. This should have a unique name in this spec as it refers to a different model to the PUT, as @JeffreyRichter called out above:

That being said, if the service has already GA'd then we don't want to introduce a breaking change. So is this change correcting the swagger to make it accurately reflect the currently-shipping service behavior?

Ideally, we'd not want this to refer to another model, as this doesn't match standard behaviour in this and other APIs, but if there's legitimate reason not to, we should update here for the name to be unique?

Copy link
Member

@weidongxu-microsoft weidongxu-microsoft May 5, 2023

Choose a reason for hiding this comment

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

This is a parameter name, not a model name.

The model is here (which is the correct one AppServicePlanPatchResource?)

"schema": {
"$ref": "#/definitions/AppServicePlanPatchResource"
}

This model will be used whatever the parameter name.


I know Java don't need this change (though it won't break as well; probably same for .NET). API signature would be patch(String, String, ..., AppServicePlanPatchResource), parameter name would not show anywhere.

Add @msyyc for Python, @tadelesh for Go.

@jackofallops If this change is intended for SDK, do talk to SDK owners. I've already added them above.

Copy link
Contributor

Choose a reason for hiding this comment

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

@jackofallops Could you please let us know the intended SDK ? Depending on that we can tag the right SDK owners.

Copy link
Contributor

Choose a reason for hiding this comment

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

@navba-MSFT this change is for github.com/hashicorp/go-azure-sdk (so we'd be the owners/folks to tag there, fwiw)

Copy link
Member

Choose a reason for hiding this comment

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

It will not break Azure Go SDK. But it is labeled as a swagger breaking change (though I don't think it will break payload), it's better to get approval from Jeff.

Copy link
Member

Choose a reason for hiding this comment

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

Here's what I think is happening: Today, there is an SDK-only method parameter named appServicePlan and there is desire to change this name to appServicePlanPatch. I'm not sure why this desire exists but the only real language it might affect is C#; not Go. And this has such a small chance of breaking .NET that we'd approve it. But I don't understand the motivation for making this change?

Do I have this right?

"in": "body",
"description": "Details of the App Service plan.",
"required": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"resourceGroupName": "testrg123",
"name": "testsf6141",
"api-version": "2022-09-01",
"appServicePlan": {
"appServicePlanPatch": {
"kind": "app",
"properties": {}
}
Expand Down