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

Adding new API version for Microsoft.Web RP which fixes swagger errors #2802

Merged
merged 15 commits into from
Apr 12, 2018
Merged

Adding new API version for Microsoft.Web RP which fixes swagger errors #2802

merged 15 commits into from
Apr 12, 2018

Conversation

ruslany
Copy link
Contributor

@ruslany ruslany commented Apr 3, 2018

This checklist is used to make sure that common issues in a pull request are addressed. This will expedite the process of getting your pull request merged and avoid extra work on your part to fix issues discovered during the review process.

PR information

  • [X ] The title of the PR is clear and informative.
  • [ X] There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For information on cleaning up the commits in your pull request, see this page.
  • [ X] Except for special cases involving multiple contributors, the PR is started from a fork of the main repository, not a branch.
  • [ X] If applicable, the PR references the bug/issue that it fixes.
  • [ X] Swagger files are correctly named (e.g. the api-version in the path should match the api-version in the spec).

Quality of Swagger

@AutorestCI
Copy link

AutorestCI commented Apr 3, 2018

Automation for azure-sdk-for-python

The initial PR has been merged into your service PR:
Azure/azure-sdk-for-python#2065

@AutorestCI
Copy link

AutorestCI commented Apr 3, 2018

Automation for azure-sdk-for-go

The initial PR has been merged into your service PR:
Azure/azure-sdk-for-go#1573

@AutorestCI
Copy link

AutorestCI commented Apr 3, 2018

Automation for azure-libraries-for-java

The initial PR has been merged into your service PR:
AutorestCI/azure-libraries-for-java#4

@AutorestCI
Copy link

AutorestCI commented Apr 3, 2018

Automation for azure-sdk-for-node

The initial PR has been merged into your service PR:
Azure/azure-sdk-for-node#2612

@lmazuel
Copy link
Member

lmazuel commented Apr 3, 2018

@AutorestCI rebuild azure-sdk-for-python

Copy link
Contributor

@olydis olydis left a comment

Choose a reason for hiding this comment

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

@ruslany generally cool, see comments. Anything starting with [informational] is more of a statement, not a request for action on your side, but please review real quick if those changes are expected 🙂

Note that github (STILL!!!???) has this annoying bug of showing comments on any line >2048 on line 2048... so for WebApps, I also tried annotating which type/operation I meant.

"summary": "Renew a domain.",
"description": "Renew a domain.",
"operationId": "Domains_Renew",
"parameters": [
Copy link
Contributor

Choose a reason for hiding this comment

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

[informational] example removed!?

"204": {
"description": "Domain does not exist."
},
"400": {
Copy link
Contributor

Choose a reason for hiding this comment

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

[informational] changed from default to explicit status codes (note that this changes the SDK's behavior!)

}
}
},
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/changeVirtualNetwork": {
Copy link
Contributor

Choose a reason for hiding this comment

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

[note to self] new operation

],
"summary": "Resume an App Service Environment.",
"description": "Resume an App Service Environment.",
"operationId": "AppServiceEnvironments_SyncVirtualNetworkInfo",
Copy link
Contributor

Choose a reason for hiding this comment

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

[note to self] new operation

"200": {
"description": "Succesfully deleted web app backup item.",
"schema": {
"$ref": "#/definitions/BackupItem"
Copy link
Contributor

Choose a reason for hiding this comment

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

[informational] added response schema (so you return the deleted item? cool!)

"$ref": "./CommonDefinitions.json#/definitions/ProxyOnlyResource"
}
],
"properties": {
Copy link
Contributor

Choose a reason for hiding this comment

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

[informational] geoRegion property removed

"sourceWebAppId"
],
"type": "object",
"properties": {
Copy link
Contributor

Choose a reason for hiding this comment

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

[informational] ignoreQuotas property removed

"SystemAssigned",
"UserAssigned"
],
"x-ms-enum": {
Copy link
Contributor

Choose a reason for hiding this comment

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

@ruslany type: string removed! On purpose?

Copy link
Contributor

Choose a reason for hiding this comment

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

@olydis ManagedServiceIdentity is now a flag enumeration. What is the correct swagger representation of such an enumeration?

Copy link
Contributor

Choose a reason for hiding this comment

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

@naveedaz how would that enumeration be sent over the wire? I suspect there is no good Swagger representation, but assuming that you want something like "SystemAssigned|UserAssigned" to be sent, that's still a string so it must be modeled like that 🙂

},
"x-ms-client-flatten": true
},

Copy link
Contributor

Choose a reason for hiding this comment

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

@ruslany isLinux? 😄 I don't know the details of this, but sounds like a year from now there could be an isMacOS or similar - wouldn't it make more sense to introduce an enum property that just says platform or something? May well be that that makes no sense here, just dumping my brain 🙂

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@olydis - while I agree that enum probably would be better, for now it is a bool. Should we add another platform later then we'll rework the API to be enum. As far as I know there are currently no plans for that.

Copy link
Contributor

Choose a reason for hiding this comment

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

sounds good to me 🙂

@@ -0,0 +1,264 @@
{
Copy link
Contributor

@olydis olydis Apr 3, 2018

Choose a reason for hiding this comment

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

@ruslany is this the first version of this Swagger? Or is there a previous API version? Examples for this presumably new API are missing.

Copy link
Contributor

Choose a reason for hiding this comment

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

@ruslany We should not expose the ClassicMobileServices.json. It is not really useful for customers and was only used during transition (Zumo -> ARM web apps).

@olydis olydis added potential-sdk-breaking-change WaitForARMFeedback <valid label in PR review process> add this label when ARM review is required labels Apr 3, 2018
@olydis
Copy link
Contributor

olydis commented Apr 3, 2018

@ravbhatnagar new API version, mostly resolved linter errors

@naveedaz
Copy link
Contributor

naveedaz commented Apr 5, 2018

@olydis The "underscore_separated_words" is for the KUDU APIs (https://github.com/projectkudu/kudu/wiki/REST-API). Due to a bug in the swagger generator, they came out as pascalCasing earlier, but the actual API follows the "underscore_separated_words" convention. So the swagger was incorrect before.

@ruslany
Copy link
Contributor Author

ruslany commented Apr 5, 2018

@olydis @naveedaz - I removed ClassingMobileServices.json

@ravbhatnagar
Copy link
Contributor

Signing off from ARM side since these are all existing APis already deployed.

@ravbhatnagar ravbhatnagar added the ARMSignedOff <valid label in PR review process>add this label when ARM approve updates after review label Apr 5, 2018
@ravbhatnagar ravbhatnagar removed the WaitForARMFeedback <valid label in PR review process> add this label when ARM review is required label Apr 5, 2018
"id": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/providers/Microsoft.DomainRegistration/topLevelDomains/com",
"name": "com",
"type": "Microsoft.DomainRegistration/topLevelDomains",
"location": "global",
Copy link
Contributor

@olydis olydis Apr 6, 2018

Choose a reason for hiding this comment

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

@ruslany @naveedaz This example (and that for TopLevelDomains_Get) is failing validation right now since the type here is modeled as a ProxyOnlyResource which doesn't have a location field. It this intended or do you think that
a) maybe there is a slight modeling bug or
b) these examples should not have location on them?

Copy link
Contributor

Choose a reason for hiding this comment

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

Apart from that, please acknowledge whether all changes I point out in my first review (removed example, property changes, etc.) are on purpose. Note that this is a real issue, please fix it 🙂

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@olydis are you referring to the "ManagedServiceIdentity is now a flag enumeration"?

Copy link
Contributor

Choose a reason for hiding this comment

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

correct - just responded to the comment, depending on how that flag enum is supposed to be sent over the wire, it has to be documented accordingly. 🙂

Copy link
Contributor

@olydis olydis left a comment

Choose a reason for hiding this comment

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

  1. Outstanding discussion: Adding new API version for Microsoft.Web RP which fixes swagger errors #2802 (comment)

  2. Also, there seems to be a slight issue with example ListTopLevelDomainAgreements.json: The operation requires a agreementOption parameter, but none is provided in the example.

@ruslany
Copy link
Contributor Author

ruslany commented Apr 11, 2018

@olydis - fixed the ListTopLevelDomainAgreements example

@olydis
Copy link
Contributor

olydis commented Apr 11, 2018

@ruslany Looking good, thanks! :)

#2802 (comment) remains - note that this is critical, no user-friendly code is generated for this as it is right now. In C#:

        /// <summary>
        /// Gets or sets type of managed service identity.
        /// </summary>
        [JsonProperty(PropertyName = "type")]
        public object Type { get; set; }

Cool. What can I set this to now?

@ruslany
Copy link
Contributor Author

ruslany commented Apr 11, 2018

@olydis - fixed the type for "ManagedServiceIdentityType",

Copy link
Contributor

@olydis olydis left a comment

Choose a reason for hiding this comment

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

thanks for your efforts everyone! 🙂

@olydis olydis merged commit 67edb3f into Azure:master Apr 12, 2018
@ruslany
Copy link
Contributor Author

ruslany commented Apr 12, 2018

@olydis - thanks for the thorough review and feedback!

@azuresdkciprbot
Copy link

Hi There,

I am the AutoRest Linter Azure bot. I am here to help. My task is to analyze the situation from the AutoRest linter perspective. Please review the below analysis result:

File: specification/web/resource-manager/readme.md
Before the PR: Warning(s): 0 Error(s): 22
After the PR: Warning(s): 0 Error(s): 22

AutoRest Linter Guidelines | AutoRest Linter Issues | Send feedback

Thanks for your co-operation.

1 similar comment
@azuresdkciprbot
Copy link

Hi There,

I am the AutoRest Linter Azure bot. I am here to help. My task is to analyze the situation from the AutoRest linter perspective. Please review the below analysis result:

File: specification/web/resource-manager/readme.md
Before the PR: Warning(s): 0 Error(s): 22
After the PR: Warning(s): 0 Error(s): 22

AutoRest Linter Guidelines | AutoRest Linter Issues | Send feedback

Thanks for your co-operation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ARMSignedOff <valid label in PR review process>add this label when ARM approve updates after review potential-sdk-breaking-change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants