Skip to content

Conversation

@muazmian
Copy link
Member

@muazmian muazmian commented Sep 12, 2017

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

  • The title of the PR is clear and informative.
  • 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.
  • Except for special cases involving multiple contributors, the PR is started from a fork of the main repository, not a branch.
  • If applicable, the PR references the bug/issue that it fixes.
  • Swagger files are correctly named (e.g. the api-version in the path should match the api-version in the spec).

Quality of Swagger

@msftclas
Copy link

@muazmian,
Thanks for your contribution as a Microsoft full-time employee or intern. You do not need to sign a CLA.
Thanks,
Microsoft Pull Request Bot

@sergey-shandar sergey-shandar added the WaitForARMFeedback <valid label in PR review process> add this label when ARM review is required label Sep 13, 2017
@sergey-shandar
Copy link
Contributor

@ravbhatnagar new spec: resources/resource-manager/Microsoft.Management/2017-08-31-preview/management.json

Copy link
Contributor

@ravbhatnagar ravbhatnagar left a comment

Choose a reason for hiding this comment

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

Just a couple of comments around read-only attribute for id, name and type properties. This has already been reviewed in person. So ARM signs off.

"ManagementGroupInfo": {
"description": "The management group.",
"properties": {
"id": {
Copy link
Contributor

Choose a reason for hiding this comment

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

id, name and type properties should be marked as read-only.

"ManagementGroup": {
"description": "The management group details.",
"properties": {
"id": {
Copy link
Contributor

Choose a reason for hiding this comment

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

id, name and type as read-only

@ravbhatnagar ravbhatnagar added ARMSignedOff <valid label in PR review process>add this label when ARM approve updates after review ReadyForSDKReview and removed WaitForARMFeedback <valid label in PR review process> add this label when ARM review is required labels Sep 13, 2017
@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/resources/resource-manager/readme.md
Before the PR: Warning(s): 0 Error(s): 0
After the PR: Warning(s): 0 Error(s): 0

AutoRest Linter Guidelines | AutoRest Linter Issues

Send feedback and make AutoRest Linter Azure Bot smarter day by day!

Thanks for your co-operation.

Copy link
Member

@anuchandy anuchandy left a comment

Choose a reason for hiding this comment

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

@muazmian really appreciate the fact that you are providing example for each model properties, in-addition to the x-ms-example. Just a suggestion, do you think you can keep only description and merge example content with it? That way IDE intellisense can show more details and api doc would be more cleaner. Just a thought.

I mean something like The ID of the management group for e.g. /providers/Microsoft.Management/managementGroups/20000000-0000-0000-0000-000000000000

}
},
"nextLink": {
"description": "The link (URL) to the next page of results.",
Copy link
Member

Choose a reason for hiding this comment

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

nextLink should be readonly

}
},
"x-ms-pageable": {
"nextLinkName": "nextLink"
Copy link
Member

Choose a reason for hiding this comment

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

What exactly the content of nextLink property?

is it (1) fully qualified url (2) relative url (3) something else (e.g. guid)..

Asking because this operation also has a query parameter PageTokenParameter and it description says it will needs to be populated with the value of nextLink present in the current page in-order to get the next page.

Does your service requires user to follow below flow to enumerate all pages?

  1. Get the first page GET /providers/Microsoft.Management/managementGroups. The response can contain value for nextLink e.g. abcd (just a token not a url)

  2. Get the next page by using the original operation url /providers/Microsoft.Management/managementGroups and a query parameter token which is populated with the value of nextLink from the previous page

Copy link
Member Author

Choose a reason for hiding this comment

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

    "x-ms-pageable": {
      "nextLinkName": "nextLink"
    }

I am seeing same property defined in three other swaggers.
https://github.com/Azure/azure-rest-api-specs/blob/current/specification/billing/resource-manager/Microsoft.Billing/2017-04-24-preview/billing.json

I don't think there is anything wrong with this.

Copy link
Member

Choose a reason for hiding this comment

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

@muazmian there is nothing wrong here w.r.t the usage of x-ms-pagable. My question is about relationship between PageTokenParameter and nextLink and how service is expecting user to use these properties together.

Copy link
Member Author

Choose a reason for hiding this comment

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

@anuchandy ..The RP has not yet implemented anything regarding generating NextLink or PageTokenParameter but the plan is that nextLink will be a relative url with $skiptoken.

I am renaming the PageTokenParameter to SkipToken make it more clear.

Copy link
Member

Choose a reason for hiding this comment

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

@muazmian, if an operation is marked as x-ms-pagable then the code generator emits two methods, in your case it generates following two methods:

ManagementGroups {
 Page<ManagementGroupInfo>  List(String skipToken);
 Page<ManagementGroupInfo>  ListNext(String nextLinkUrl, String skipToken);
}

So user will use it as

 Page<ManagementGroupInfo> firstPage = client.List( /* what should be value for skipToken param?*/);
 Page<ManagementGroupInfo> nextPage = client.ListNext(firstPage.nextLink, /* what should be value for skipToken param?*/);

Iam trying to understand - If odata $skipToken is already present in the nextLink property when why do we need separate skipToken argument for the method?

Copy link
Member Author

Choose a reason for hiding this comment

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

@anuchandy

You are right, this is wrong. I have removed "x-ms-parameter-location" from $skipToken. Hopefully this will resolve the issue.

Copy link
Member Author

Choose a reason for hiding this comment

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

In case this does not fix this, please let me know the actual fix.

I am just helping the team in publishing the Swagger and Azure PS.

Copy link
Member

Choose a reason for hiding this comment

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

removal of "x-ms-parameter-location" will simply make skipTokenParameter global, it goes to client from list method. Should we just remove this property given that it is not used anywhere?

Copy link
Member Author

Choose a reason for hiding this comment

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

What do you think about moving the $SkipToken out of parameters and only define it for that 1 api that will use it? The reason I am asking is that so skipToken is shown as a query paramter on swagger

Copy link
Member

Choose a reason for hiding this comment

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

sure sounds good..

"in": "query",
"required": false,
"type": "boolean",
"description": "The $recurse=true query string parameter allows clients to request inclusion of entire hierarchy in the response payload."
Copy link
Member

Choose a reason for hiding this comment

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

specify x-ms-parameter-location: method

Copy link
Member

Choose a reason for hiding this comment

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

see above comment

"in": "query",
"required": false,
"type": "string",
"description": "Page continuation token is only used if a previous operation returned a partial result. \nIf a previous response contains a nextLink element, the value of the nextLink element will include a token parameter that specifies a starting point to use for subsequent calls.\n"
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Is this a new requirement? None of our older RPs has this property defined.

Copy link
Member

Choose a reason for hiding this comment

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

this is not a new requirement - if you don't apply this attribute then these become properties of the client (ManagementGroups.cs), only the global properties (e.g. apiVersion, subscriptionId) which are applicable across all operations are supposed to be in the client level.

"enum": [
"children"
],
"description": "The $expand=children query string parameter allows clients to request inclusion of children in the response payload."
Copy link
Member

Choose a reason for hiding this comment

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

specify x-ms-parameter-location: method

Copy link
Member

Choose a reason for hiding this comment

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

see above 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/resources/resource-manager/readme.md
Before the PR: Warning(s): 28 Error(s): 56
After the PR: Warning(s): 0 Error(s): 0

AutoRest Linter Guidelines | AutoRest Linter Issues

Send feedback and make AutoRest Linter Azure Bot smarter day by day!

Thanks for your co-operation.

@AutorestCI
Copy link

@AutorestCI
Copy link

No modification for AutorestCI/azure-sdk-for-node

@AutorestCI
Copy link

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 ReadyForSDKReview

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants