Skip to content

Conversation

@dnayantara
Copy link
Contributor

@dnayantara dnayantara commented Apr 5, 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

msftclas commented Apr 5, 2017

@dnayantara,
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

Copy link
Contributor

@nathannfan nathannfan left a comment

Choose a reason for hiding this comment

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

Looks good! A few minor changes for it to work for SDK, but it's close.

"info": {
"version": "2015-05-01-preview",
"title": "SqlManagementClient",
"description": "The Database management API provides a RESTful set of web APIs that interact with Database services to manage your databases. The API enables users to create, retrieve, update, and delete databases, servers, and other entities."
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you update description to something more specific to VNetRules?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure. Makes sense

"VnetFirewallRule"
],
"description": "Returns information about a Vnet Firewall Rule.",
"operationId": "VnetFirewallRule_Get",
Copy link
Contributor

Choose a reason for hiding this comment

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

VnetFirewallRules

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry, I should clarify. VnetFirewallRules_Get - we've been going plural_operation for operation id

}
}
},
"x-ms-long-running-operation": true
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you return 202? If so, I think you'll need to add
"202": {
"description": "Accepted"
}

to responses. No need to include the response body for 202 that in the swagger or examples though, just the response code with an empty body.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm assuming this operation follows azure async pattern, which returns 202 initially?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes it does. I will add that.

}
},
"definitions": {
"OperationListResult": {
Copy link
Contributor

Choose a reason for hiding this comment

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

Are the Operations definitions being used?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I dont think so. I didnt think we would have to do anything separately for the operations

Copy link
Contributor

Choose a reason for hiding this comment

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

You're right, we only need them in one file per API version. You can remove all the Operations definitions then.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Got it.

Copy link
Contributor

Choose a reason for hiding this comment

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

This should also clear up one of the validation errors

@nathannfan
Copy link
Contributor

@dnayantara Looks like the validation failures are because of parameter description mismatches. Copying the parameters from https://github.com/Azure/azure-rest-api-specs/blob/master/arm-sql/2015-05-01-preview/swagger/blobAuditingPolicies.json should fix it.

Copy link
Contributor

@dsgouda dsgouda left a comment

Choose a reason for hiding this comment

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

Requesting minor changes

"Gets the virtual network firewall rule": { "$ref": "../examples/VirtualNetworkRulesGet.json" }
},
"parameters": [
{
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Maintain parameter ordering, place SubscriptionId and ApiVersion together at the beginning or the end of the parameters section

"Create or update a virtual network firewall rule": { "$ref": "../examples/VirtualNetworkRulesCreateOrUpdate.json" }
},
"parameters": [
{
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: parameter ordering

"x-ms-examples": {
"Delete a virtual network firewall rule": { "$ref": "../examples/VirtualNetworkRulesDelete.json" }
},
"parameters": [
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: parameter ordering

"Lists the virtual network firewall rules": { "$ref": "../examples/VirtualNetworkRulesList.json" }
},
"parameters": [
{
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: parameter ordering

"properties": {
"$ref": "#/definitions/VnetFirewallRuleResourceProperties"
},
"location": {
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like a Resource, there are a couple of options here either reference this model or redefine the same structure here and do an allOf. (I'd recommend not redefining simply since its duplication and overhead)

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, please copy Resource+TrackedResource/ProxyResource from other SQL files and use allOf to include TrackedResource/ProxyResource as appropriate.

"description": "Properties of a vnet firewall rule resource.",
"type": "object",
"properties": {
"virtualNetworkSubnetId": {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be readonly? Or do you allow this as a part of the request object?

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 is allowed as part of the request object. I dont think this is readonly

}
},
"nextLink": {
"type": "string"
Copy link
Contributor

Choose a reason for hiding this comment

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

set this to readonly

"$ref": "#/parameters/ServerNameParameter"
},
{
"name": "vnetFirewallRuleName",
Copy link
Contributor

Choose a reason for hiding this comment

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

this should be name: parameters

Copy link
Contributor

Choose a reason for hiding this comment

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

name:parameters makes sense for a body parameter. This is correct

"VnetFirewallRule"
],
"description": "Returns information about Vnet Firewall Rules.",
"operationId": "VnetFirewallRules_List",
Copy link
Contributor

Choose a reason for hiding this comment

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

should be VnetFirewallRules_ListByServer

"properties": {
"$ref": "#/definitions/VnetFirewallRuleResourceProperties"
},
"location": {
Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, please copy Resource+TrackedResource/ProxyResource from other SQL files and use allOf to include TrackedResource/ProxyResource as appropriate.

"type": "object",
"properties": {
"properties": {
"$ref": "#/definitions/VnetFirewallRuleResourceProperties"
Copy link
Contributor

Choose a reason for hiding this comment

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

Add x-ms-flatten:true

}
}
},
"VnetFirewallRuleList": {
Copy link
Contributor

Choose a reason for hiding this comment

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

VnetFirewallRuleListResult

"$ref": "#/definitions/VnetFirewallRule"
}
},
"nextLink": {
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you actually have paging? If no, remove this and add x-ms-paging: { nextLinkName: null } to the list operation.

},
"type": {
"type": "string"
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this a proxy resource? If so, remove location, id, name, and type from this definition and use allOf, e.g. https://github.com/Azure/azure-rest-api-specs/blob/master/arm-sql/2014-04-01/swagger/sql.core.json#L1627

}
}
},
"VnetFirewallRuleResourceProperties": {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should be named VnetFirewallRuleProperties

"x-ms-paging": {
"nextLinkName": "null"
},
"parameters": [
Copy link
Contributor

Choose a reason for hiding this comment

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

Formatting looks a little off

"VnetFirewallRule": {
"description": "Vnet Firewall Rule Resource.",
"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.

What @jaredmoo said

@jaredmoo
Copy link
Contributor

jaredmoo commented Apr 5, 2017

FYI the ListByOperationsValidation linter error regarding ListByServer should be ignored. See discussion with @veronicagg at #1005 (comment)

}
]
},
"VnetFirewallRule": {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: What I implied was cross-referencing using definitions that already exist under your RP like so
https://github.com/Azure/azure-rest-api-specs/blob/master/arm-recoveryservices/2016-06-01/swagger/replicationusages.json#L46
This is not a requirement but reduces duplication

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not making this change as @jaredmoo said in the email, cross references don't work.

Copy link
Contributor

Choose a reason for hiding this comment

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

Replied on the email thread. However, won't block on this.

"in": "path",
"description": "The name of the Virtual Network Firewall Rule.",
"required": true,
"type": "string"
Copy link
Contributor

Choose a reason for hiding this comment

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

needs "x-ms-parameter-location": "method"

"tags": [
"VnetFirewallRule"
],
"description": "Returns information about a Vnet Firewall Rule.",
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: can you use "virtual network firewall rule" (no capitalization) instead of "Vnet Firewall Rule" throughout this file? That will make Azure CLI commands look better when you get to 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.

Ill change it to virtual network rules since thats what we are calling it to the customers.

"tags": [
"VnetFirewallRule"
],
"description": "Creates a new Vnet Firewall Rule or updates an existing Vnet Firewall Rule.",
Copy link
Contributor

Choose a reason for hiding this comment

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

Creates or updates a virtual network firewall rule

"properties": {
"properties": {
"$ref": "#/definitions/VnetFirewallRuleProperties",
"x-ms-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.

This should be x-ms-client-flatten

"x-ms-examples": {
"Lists the virtual network firewall rules": { "$ref": "../examples/VirtualNetworkRulesList.json" }
},
"x-ms-paging": {
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be x-ms-pageable, please recheck extension names

@dsgouda
Copy link
Contributor

dsgouda commented Apr 6, 2017

@azuresdkci Test this please

@dnayantara
Copy link
Contributor Author

I will add another iteration which has been directly generated from the source code soon.

Copy link
Contributor

@dsgouda dsgouda left a comment

Choose a reason for hiding this comment

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

Couple of minor comments and a suggestion. LGTM pending CI builds

"type": "object",
"properties": {
"nextLink": {
"description": "Link to retrieve next page of results.",
Copy link
Contributor

Choose a reason for hiding this comment

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

Please mark this as readonly

"$ref": "#/parameters/ServerNameParameter"
},
{
"name": "vnetFirewallRuleName",
Copy link
Contributor

Choose a reason for hiding this comment

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

name:parameters makes sense for a body parameter. This is correct

"in": "body",
"description": "The requested vnetFirewall Resource state.",
"required": true,
"schema": {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Just want to point out that the VnetFirewallRule model has no required properties which means it could theoretically be an empty object, please verify that the service is fine with this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No. the parameters should be required. I will change this.

@@ -250,6 +250,7 @@
"x-ms-azure-resource": true
},
"ProxyResource": {
Copy link
Contributor

Choose a reason for hiding this comment

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

Did you plan to add required properties for VnetFirewallRule in this commit?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Lets just leave it like this for now. I may make changes later.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm fine with it as long as the service is OK with an empty body parameter

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am with the service team and we are ok with this for now. Please accept pull request if everything else looks good.

@dsgouda dsgouda merged commit 79c07cc into Azure:master Apr 7, 2017
@AutorestCI
Copy link

No modification for NodeJS

@AutorestCI
Copy link

@AutorestCI
Copy link

@AutorestCI
Copy link

No modification for Ruby

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants