Conversation
| "Capabilities" | ||
| ], | ||
| "operationId": "Capabilities_Get", | ||
| "description": "Returns information about the Azure SQL capabilities available for the specified region.", |
There was a problem hiding this comment.
Remove "information about"
There was a problem hiding this comment.
also please replace 'region' with 'location' throughout this file, e.g.
"Gets the capabilities available for the specified location."
| "in": "path", | ||
| "required": true, | ||
| "type": "string", | ||
| "description": "The Id of the region for which the Azure SQL capabilities are retrieved." |
| ], | ||
| "x-ms-enum": { | ||
| "name": "MaxSizeUnits", | ||
| "modelAsString": true |
There was a problem hiding this comment.
Can modelAsString be removed? It's unlikely we will go past petabytes in the foreseeable future
| ], | ||
| "x-ms-enum": { | ||
| "name": "CapabilityStatus", | ||
| "modelAsString": true |
| "modelAsString": true | ||
| } | ||
| }, | ||
| "status": { |
There was a problem hiding this comment.
Can status be extracted as a common definition to reduce duplication?
| } | ||
| } | ||
| }, | ||
| "description": "Represents the maximum size limits for an Azure SQL Database." |
There was a problem hiding this comment.
"an Azure SQL Database" -> "a database"
| "items": { | ||
| "$ref": "#/definitions/MaxSizeCapability" | ||
| }, | ||
| "description": "The list of supported maximum Azure SQL Database sizes for this Service Objective." |
There was a problem hiding this comment.
"Azure SQL Database" -> "database"
There was a problem hiding this comment.
et cetera for other "Azure SQL" in descriptions other than at top of tile
|
Thanks for providing the example! It seems like one of our validators has uncovered some inconsistencies between the Swagger and the example: https://travis-ci.org/Azure/azure-rest-api-specs/jobs/209204805#L975 |
|
@olydis So we have a lot of errors regarding examples having null not matching the expected data types for our resource definitions. Since this is what the API actually returns, we are including the nulls in the examples, and ignoring the example validation errors for now. I think it's an open discussion here: #798 |
|
@nathannfan oh, I was not aware of that problem! fair enough, I'm okay with ignoring those null-related messages then, but what about https://travis-ci.org/Azure/azure-rest-api-specs/jobs/209204805#L1650? |
|
also, slightly concerned about https://travis-ci.org/Azure/azure-rest-api-specs/jobs/209204805#L2122 (think the Z suffix is missing in order to conform with rfc3339), not sure if our runtime throw up on that! |
|
@olydis For this https://travis-ci.org/Azure/azure-rest-api-specs/jobs/209204805#L2122, we checked, and the client runtimes handle it as UTC time, which is correct in our API's case, so we also ignore these warnings. |
|
@olydis well spotted, we'll file this as a bug ('Z' issue) |
|
@jaredmoo @nathannfan Excellent, thanks for testing with client runtime! |
| "Default" | ||
| ], | ||
| "x-ms-enum": { | ||
| "name": "CapabilityStatus" |
There was a problem hiding this comment.
if the set of values has a chance of getting changed in the near future I'd suggest using "modelAsString": true here. (just be aware that otherwise, every change is a breaking change!)
There was a problem hiding this comment.
also, please extract the data type you implicitly define here:
type: string
enum: ...
x-ms-enum: ...
into a top-level definition (with some generic description of what the enum represents) and just $reference it here and in all other places (valuable deduplication, especially in case of a change to the enum!)
There was a problem hiding this comment.
None of these are likely to change. I'm happy to put the modelAsString back in if you think we still should.
@jaredmoo are you okay with this?
There was a problem hiding this comment.
They should not be modelasstring.
There was a problem hiding this comment.
could you please still deduplicate the Swagger? There are 5 identical copies of this enum in here!
| }, | ||
| "description": "Represents the capabilities for a region." | ||
| }, | ||
| "Resource": { |
There was a problem hiding this comment.
never referenced - note that you can also cross reference to other swagger files, so even if you plan to use a Resource in here, you can use the one defined in sql.core.json! Deduplication makes both reviewers and maintainers happy ;-)
There was a problem hiding this comment.
How do I do this? When I did the initial checkin in October, I asked about this and was told it wasn't possible. I'd be happy to go through and remove all duplicates in another review.
There was a problem hiding this comment.
How do I do this? When I did the initial checkin in October, I asked about this and was told it wasn't possible. I'd be happy to go through and remove all duplicates in another review.
There was a problem hiding this comment.
oh things have changed (to the better) since then :-) as per the Swagger standard, you can now give references such as ./sql.core.json#/definitions/Resource
There was a problem hiding this comment.
Good to know! I'd like to keep this separate, since capabilities doesn't use Resource at all, but I will fix it in a future PR
There was a problem hiding this comment.
@olydis hey Johannes, I tried it out, and the linter is failing.
I moved SqlSubResource and Resource definitions to a Resource.json file, and change the reference to it like this:
"$ref": "./resource.json#/definitions/SqlSubResource"
Validate-spec continues to pass, but I get a linter error back: file: 'file:///e%3A/Azure/azure-rest-api-specs/arm-sql/2014-04-01/swagger/firewallRules.json'
severity: 'Error'
message: 'Error generating client model: Could not find file 'C'
at: '1,1'
source: 'lint'
I'm using linter 0.6.0. Am I doing the reference correctly?
There was a problem hiding this comment.
what is "linter 0.6.0."? don't know that tool and sounds like it cannot handle external references
There was a problem hiding this comment.
| ], | ||
| "x-ms-azure-resource": true | ||
| }, | ||
| "SubResource": { |
| "name": { | ||
| "readOnly": true, | ||
| "type": "string", | ||
| "description": "The Service Objective name." |
There was a problem hiding this comment.
capitalization inconsistent, below you are talking about "server version" and "server edition" which reads well :-)
| "DTU" | ||
| ], | ||
| "x-ms-enum": { | ||
| "name": "PerformanceLevelUnit" |
There was a problem hiding this comment.
this again sounds like a good candidate for modelAsString: true or do you want adding a unit (seems likely from looking at it) to break everyone?
There was a problem hiding this comment.
Also don't think this is likely to change either. I'm willing to add it, but Azure Team always wants to know why I'm adding modelAsString, and in this case I can't really say it's likely to change any time soon.
There was a problem hiding this comment.
@amarzavery can you take a quick look at this? aren't the ARM guidelines the opposite? Or what do you mean with "Azure Team" @nathannfan?
There was a problem hiding this comment.
My experience in the past was that we're reluctant to use model-as-string:true unless it's actually likely to change. In this case, I don't think it is.
There was a problem hiding this comment.
this seems good to me. DTU is standard measuring unit and another one is not coming soon.
| "description": "Represents the Service Objectives capabilities." | ||
| }, | ||
| "PerformanceLevel": { | ||
| "description": "Represents a possible performance level of a Service Objective Capability.", |
There was a problem hiding this comment.
So the properties in here are not readonly? :-o
| "Petabytes" | ||
| ], | ||
| "x-ms-enum": { | ||
| "name": "MaxSizeUnits" |
There was a problem hiding this comment.
see other comments about enums
|
Apart from the above comments, this looks good to me, the CI issues have been addressed, I see you're discussing the validation messages regarding |
| "Capabilities" | ||
| ], | ||
| "operationId": "Capabilities_Get", | ||
| "description": "Returns information about the Azure SQL capabilities available for the specified region.", |
There was a problem hiding this comment.
also please replace 'region' with 'location' throughout this file, e.g.
"Gets the capabilities available for the specified location."
| "limit": { | ||
| "readOnly": true, | ||
| "type": "integer", | ||
| "format": "int32", |
There was a problem hiding this comment.
will is always be int32? consider int64 here
| "Capabilities" | ||
| ], | ||
| "operationId": "Capabilities_Get", | ||
| "description": "Returns the capabilities available for the specified region.", |
| "tags": [ | ||
| "Capabilities" | ||
| ], | ||
| "operationId": "Capabilities_Get", |
There was a problem hiding this comment.
Isn't this technically Capabilities_List ? Since it returns a list. Or arguably Capabilities_ListByLocation
There was a problem hiding this comment.
although, it does (technically) not just return a list, also name and status - otherwise our validation rules should also have caught it.
|
Hey @olydis, I'm not sure why the last two commits started failing validation. The error message doesn't say much, and my changes were mostly description updates. Validate-spec, validate-example, linter and generate.cmd are all running without error as well. Is there a way to drill down deeper? |
| "$ref": "#/parameters/SubscriptionIdParameter" | ||
| }, | ||
| { | ||
| "name": "locationID", |
There was a problem hiding this comment.
Capitalization: locationId ?
| ], | ||
| "x-ms-enum": { | ||
| "name": "CapabilityStatus" | ||
| } |
There was a problem hiding this comment.
good catch, somehow our CI tools didn't catch that!
| "edition": { | ||
| "type": "string", | ||
| "description": "The edition of the database. The DatabaseEditions enumeration contains all the valid editions. If createMode is NonReadableSecondary or OnlineSecondary, this value is ignored.", | ||
| "description": "The edition of the database. The DatabaseEditions enumeration contains all the valid editions. If createMode is NonReadableSecondary or OnlineSecondary, this value is ignored. To see possible values, query the capabilities API (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) referred to by operationId: \"Capabilities_Get.\"", |
There was a problem hiding this comment.
This is now Capabilities_List
|
@olydis Hey Johannes, commits have been consistently failing build validation, and I'm not seeing much in the way of error messages in the build pages. Any tips on how to dig deeper? Locally, it's still passing all validate-spec, validate-example, and successfully generating a client in SDK, which is odd. |
|
@nathannfan that's an internal issue that's hopefully gonna be resolved today |
|
Swagger used to generate Azure/azure-sdk-for-net#2914 |
|
@nathannfan Tooling back up and running: You changing the description of the |
…into master_capabilities
|
FYI I'm refactoring our references to Resource in #1005 . So Nathan will make minimal changes to Resource in this PR. |
|
@olydis I see what happened, the conflicting definition of Resource wasn't checked in when I sent the commit with the Resource description change. Should be good to go now. |
| "tags": [ | ||
| "Capabilities" | ||
| ], | ||
| "operationId": "Capabilities_List", |
There was a problem hiding this comment.
According to https://github.com/Azure/azure-rest-api-specs/blob/master/documentation/swagger-good-patterns.md section "Consistency in the naming of list methods", this should be Capabilities_ListByLocation.
| "unit": { | ||
| "type": "string", | ||
| "readOnly": true, | ||
| "description": "Unit type used to measure SLO performance level.", |
There was a problem hiding this comment.
"SLO" -> "service objective"
| "Capabilities" | ||
| ], | ||
| "operationId": "Capabilities_List", | ||
| "description": "Returns the capabilities available for the specified location.", |
There was a problem hiding this comment.
Avoid "Returns". How about "Gets"
| "in": "path", | ||
| "required": true, | ||
| "type": "string", | ||
| "description": "The Id of the location for which the capabilities are retrieved." |
There was a problem hiding this comment.
The location id whose capabilities are retrieved
| "definitions": { | ||
| "CapabilityStatus": { | ||
| "type": "string", | ||
| "description": "The availability status of the Capability", |
| "$ref": "#/definitions/CapabilityStatus" | ||
| } | ||
| }, | ||
| "description": "Represents the maximum size limits for a database." |
There was a problem hiding this comment.
Remove "represents" here and in other descriptions. It's a useless word
| "description": "Represents the service objectives capabilities." | ||
| }, | ||
| "PerformanceLevel": { | ||
| "description": "Represents a possible performance level of a service objective Capability.", |
| "status": { | ||
| "readOnly": true, | ||
| "type": "string", | ||
| "description": "The status for the location with respect to Azure SQL.", |
There was a problem hiding this comment.
Azure SQL Database's status for the location.
|
@olydis Thanks, Johannes! |
|
No modification for NodeJS |
Add swagger for SQL capabilities API and refer to it in capabilities.json.
Validate-spec, validate-example, and linter all passing with no issues.
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