Skip to content

Conversation

@mihymel
Copy link
Contributor

@mihymel mihymel commented May 25, 2017

…cryption Protector, Server Key, and Servers

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

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

@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.

Looks in pretty good shape. Left a few comments.

"azurekeyvault",
"servicemanaged"
],
"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.

You'd want to consider setting "modelAsString":true if this enum is bound to change later, not doing so could result in breaking change. This applies to all other enums.

"description": "The requested encryption protector resource state.",
"required": true,
"schema": {
"$ref": "#/definitions/EncryptionProtector"
Copy link
Contributor

Choose a reason for hiding this comment

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

Since EncryptionProtector is a body parameter here, please ensure you have set all the correct properties to readonly.

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 double checked to be safe - ServerKeyType and ServerKeyName are the only properties of EncryptionProtector that are not readonly. This is what we want.

"produces": [
"application/json"
],
"paths": {
Copy link
Contributor

Choose a reason for hiding this comment

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

Please ensure there is an Operations API that exposes information about the operations exposed here.

Copy link
Contributor

Choose a reason for hiding this comment

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

It's in sql.core.json

"EncryptionProtectors"
],
"description": "Returns a list of the server encryption protectors",
"operationId": "Servers_ListEncryptionProtectors",
Copy link
Contributor

Choose a reason for hiding this comment

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

You probably mean Servers_ListByEncryptionProtectors

Copy link
Contributor Author

Choose a reason for hiding this comment

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

EncryptionProtector is a singleton, so this is following the pattern for naming singleton operations. See blob auditing policies for example of the pattern.

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

Choose a reason for hiding this comment

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

Just to confirm, by adding location you dont intend to make this a tracked resource.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Correct. This is not a tracked resource.

"Servers"
],
"description": "Creates or updates a server.",
"operationId": "Servers_CreateOrUpdate",
Copy link
Contributor

Choose a reason for hiding this comment

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

If you already have an update operation you probably don't need a createOrUpdate

Copy link
Contributor Author

Choose a reason for hiding this comment

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

"CreateOrUpdate" is for PUT, "Update" is for PATCH.

Copy link
Contributor

Choose a reason for hiding this comment

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

Let me rephrase that, do you think you will need a CreateOrUpdate even if you had Create and Update operations?
CreateOrUpdate is useful if the update operation only allows an update on the tags property. If you wish to expose a PATCH operation that allows updating of other properties, its better to have a separate Update operation like you have here.

Copy link
Contributor

Choose a reason for hiding this comment

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

There is no Create operation. Just Servers_CreateOrUpdate and Servers_Update

}
},
"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.

Please provide x-ms-examples here.

},
"kind": {
"description": "Kind of sql server. This is metadata used for the Azure portal experience.",
"enum": [
Copy link
Contributor

Choose a reason for hiding this comment

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

please provide an x-ms-enums section with appropriate options here,

"operationId": "Servers_CreateOrUpdateEncryptionProtector",
"parameters": [
{
"$ref": "#/parameters/ResourceGroupParameter"
Copy link
Contributor

Choose a reason for hiding this comment

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

Maintain consistent parameter ordering, either place "ResourceGroupParameter" and "ApiVersionParameter" together at the beginning or at the end of the parameters section.

Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this? You previously told us that SubscriptionId and ApiVersion should be together since they are client params, not method params. Did this change?

Copy link
Contributor

@dsgouda dsgouda May 26, 2017

Choose a reason for hiding this comment

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

Whoops I confused SubscriptionId with ResourceGroupName, sorry about that, please disregard this

…tring for enum parameters, fixing sql.core name to servers, adding x-ms-examples to servers
@jaredmoo
Copy link
Contributor

@nathannfan to review

],
"x-ms-enum": {
"name": "EncryptionProtectorName",
"modelAsString": true
Copy link
Contributor

Choose a reason for hiding this comment

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

I assume this might change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

EncryptionProtector is a singleton now and we intend for it to be that way for the unforeseeable future. Technically (with some changes) the API is designed to support multiple EncryptionProtectors, so I used modelAsString.

…odelAsEnum" for some string properties due to resulting errors in generated .net SDK
@mihymel
Copy link
Contributor Author

mihymel commented May 26, 2017

I removed "x-ms-enum" for some parameters where an acceptable enum value included an empty string because in this case this resulted in errors in the generated .NET SDK. The generated .NET SDK generates an enum class where the enum with value "" doesn't have a name: e.g. public const string = "";

@nathannfan
Copy link
Contributor

@dsgouda the validation error for syntax isn't very clear. Is this a legitimate syntax error in the swagger?

@dsgouda
Copy link
Contributor

dsgouda commented May 26, 2017

If there are no explicit properties you wish to add under "x-ms-enums", you can remove it or just put an empty object there, I leave it to your discretion.

@dsgouda
Copy link
Contributor

dsgouda commented May 26, 2017

@nathannfan which specific error is this related too, I can try and help you out with it.

@nathannfan
Copy link
Contributor

…r api 2014-04-01 so they can be added to compositeSql
@dsgouda dsgouda merged commit 76ef41d into Azure:master May 27, 2017
@AutorestCI
Copy link

No modification for NodeJS

@AutorestCI
Copy link

@AutorestCI
Copy link

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.

6 participants