Storage sku list operation and fix a comment to VirtualNetworkResourceId#1579
Storage sku list operation and fix a comment to VirtualNetworkResourceId#1579veronicagg merged 4 commits intoAzure:currentfrom
Conversation
|
Also resolve issue #651 |
|
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: AutoRest Linter Guidelines | AutoRest Linter Issues Send feedback and make AutoRest Linter Azure Bot smarter day by day! Thanks for your co-operation. |
veronicagg
left a comment
There was a problem hiding this comment.
Thanks @JasonYang-MSFT for submitting this PR.
Have these changes been deployed to ARM already?
Since you're adding an operation and some properties, I'm adding @ravbhatnagar from ARM team to take a look and sign-off. Thanks!
| "type": "string", | ||
| "description": "The name of capability, The capability information in the specified sku, including file encryption, network acls, change notification, etc." | ||
| }, | ||
| "value": { |
There was a problem hiding this comment.
should this be an enum?
There was a problem hiding this comment.
Do you mean "value" or "SKUCapability"?
There was a problem hiding this comment.
@JasonYang-MSFT Maybe I'm off base, but if the "value" an only be "true" or "false", shouldn't be this defined as a boolean directly?
There was a problem hiding this comment.
@lmazuel Agreed, too. Boolean is the first thing I tried, but in fact, http response returned a 'string' with value 'true' or 'false' instead of true or false: https://github.com/JasonYang-MSFT/azure-rest-api-specs/blob/storageskus/specification/storage/resource-manager/Microsoft.Storage/2017-06-01/examples/SKUList.json#L69.
It also failed validation with oav validate-example .\storage.json, message: 'Expected type boolean but found type string'. Though generated .Net code could parse it as boolean, but not sure about other languages.
This api exists for a long time, even in 2015-05-01-preview, and it is only in response, so I choose to make it as a string.
There was a problem hiding this comment.
Got it. Note that for Python it would have work ok even with the string.
There was a problem hiding this comment.
@vishrutshah @amarzavery should ova be improved to accept "string" as potentially valid "bool" input? Or is it really a problem? Seems C# and Python support it at least, and would be a better customer experience.
There was a problem hiding this comment.
@lmazuel Isn't the 'true' a json string type and true as json boolean type? I think if service says it's boolean what are the possible reasons for the service to send string 'true'? Doesn't that make swagger contract wrong? I see that point for better SDK experience but not sure we should open gates where swagger contract gets violated? Thoughts?
| }, | ||
| "description": "The capability information in the specified sku, including file encryption, network acls, change notification, etc." | ||
| }, | ||
| "restrictions": { |
There was a problem hiding this comment.
considered a breaking change - @ravbhatnagar please review
There was a problem hiding this comment.
@veronicagg Do you mean adding parameters to an object? If so, I can create an 'sku' type specially for list operation. Current 'sku' is used in create/update storage account, extra parameters are not used in create/update. Adding extra parameters instead of creating a new object is trying to reuse the type name of 'SKU'.
There was a problem hiding this comment.
@veronicagg Just FYI, in Python we consider this non breaking (adding an optional parameter at the end). Please take this opportunity to tell in which language it's breaking (I need to improve my Swagger reviewing skill ;))
There was a problem hiding this comment.
@JasonYang-MSFT - ChecknameAvailability API as defined in the ARM RPC should be used to indicate whether a given resource name is available or not. It seems like in this case you are returning more information that what is required in the contract. Why is it needed to return all this extra information like kind, resource type, locations etc. resource type goes in the request body. Locations go in the URL to verify local uniqueness. Not sure why you need kind or SKUCapability to be returned for this API.
There was a problem hiding this comment.
@ravbhatnagar Sorry, am I miss something here?
This PR is about sku list operation, "ChecknameAvailability" is not updated in this PR and it is already in the swagger.
There was a problem hiding this comment.
Whoops.. @JasonYang-MSFT - please ignore my earlier comment. The way the changes were diff'd in Github gave the impression that all these properties are added to the response of checkNameAvailability :).
The only feedback here is that restrictions should have type, values and reasonCode properties and all these are require for restrictions. restriction.type is most likely locations today. And so the restriction.values will contain the list of locations where the skus is restricted. and then there will be a reason for the restriction in reasoncode. Does that make sense? and yes, this is not a breaking change.
There was a problem hiding this comment.
Yes, your comment is addressed. Please kindly take a look.
|
Hi @veronicagg, what do I need to do to drive this PR forward? It seems we stuck on the discussion. Will @ravbhatnagar evaluate this breaking? |
|
@JasonYang-MSFT not stuck, we're pending @ravbhatnagar sign-off from ARM side, once that's in, i'm good approving this PR. |
|
@veronicagg Yes, they all deployed already. |
|
@JasonYang-MSFT yes, he should know, plus I sent him offline email (with you cc'd) as well. We have a ton of PRs coming in right now, we're doing our best to keep up. |
|
@JasonYang-MSFT Please address pending comment from @ravbhatnagar above (#1579 (comment)). |
|
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: AutoRest Linter Guidelines | AutoRest Linter Issues Send feedback and make AutoRest Linter Azure Bot smarter day by day! Thanks for your co-operation. |
|
Looks good. @veronicagg @JasonYang-MSFT ARM signed off. |
|
No modification for AutorestCI/azure-sdk-for-node |
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
api-versionin the path should match theapi-versionin the spec).Quality of Swagger