Add redis firewallRules to swagger specs w/ examples. (+minor descrip…#989
Add redis firewallRules to swagger specs w/ examples. (+minor descrip…#989veronicagg merged 6 commits intoAzure:masterfrom
Conversation
…tive changes to existing APIs).
|
(Please assign this to @veronicagg who had #977!) |
|
@veronicagg It looks like there is some problem with the CI installing/running autorest for node.js? |
|
@veronicagg
3360 ReferenceError: error is not defined 3361 at SpecValidator.validateRequest (node_modules/openapi-validation-tools/lib/specValidator.js:567:79) 3362 at SpecValidator.validateXmsExamples (node_modules/openapi-validation-tools/lib/specValidator.js:470:60) 3363 at SpecValidator.validateOperation (node_modules/openapi-validation-tools/lib/specValidator.js:412:10) 3364 at SpecValidator.validateOperations (node_modules/openapi-validation-tools/lib/specValidator.js:446:12) 3365 at node_modules/openapi-validation-tools/validate.js:86:15 |
|
Still getting a cryptic build error after fixing parameter names. |
|
The github CLA bot does not like you :(. It does the same with me many times :( |
| } | ||
| } | ||
| }, | ||
| "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{cacheName}/firewallRules/": { |
There was a problem hiding this comment.
I think there is an extra slash in the end that shouldn't be there, correct ?
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{cacheName}/firewallRules /":
|
@amarzavery What should I do about the CLA issue? Node SDK generation failure is opaque. I also see a lot of linter errors which seem to be extraneous to the content of the specific PR, I think they are caused by improvements to the linter - are any of those going to be blockers for this? |
|
@veronicagg any advice on how to deal with the linter errors here? |
veronicagg
left a comment
There was a problem hiding this comment.
@TimLovellSmith I made some comments inline related to linter errors. And here are some comments for the others:
Is there an operations API you can expose for the service? This error https://travis-ci.org/Azure/azure-rest-api-specs/jobs/208317608#L979 comes from a request from the ARM team to have an operation in the spec that lists all the available operations, like: https://github.com/Azure/azure-rest-api-specs/blob/master/arm-cdn/2016-10-02/swagger/cdn.json#L1578
I'm following up on errors with code "ArmResourcePropertiesBag", as I believe the rule may not be appropriate for those cases. (https://travis-ci.org/Azure/azure-rest-api-specs/jobs/208317608#L1001)
Even though, this issue is not caused by this PR, please take a look at https://travis-ci.org/Azure/azure-rest-api-specs/jobs/208317608#L1090
| "Redis", | ||
| "FirewallRules" | ||
| ], | ||
| "operationId": "RedisFirewallRules_List", |
There was a problem hiding this comment.
Is there a reason why the operation is named RedisFirewallRules_List? To follow the convention, based on our latest rules: "Operation RedisFirewallRules_List must be one of: firewallrules_listbysubscriptionid, firewallrules_list, firewallrules_listbyresourcegroup, firewallrules_listbyredis" (see ahttps://travis-ci.org/Azure/azure-rest-api-specs/jobs/208317608#L968), naming this operation "FirewallRules_List" would fix the issue.
There was a problem hiding this comment.
@veronicagg The naming guidance seems a little arbitrary. E.g. We call the create operation RedisFirewallRule_CreateOrUpdate and there's no error for that? (Or I overlooked it)
| } | ||
| } | ||
| }, | ||
| "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/patchSchedules/default": { |
There was a problem hiding this comment.
https://travis-ci.org/Azure/azure-rest-api-specs/jobs/208317608#L990
The recommendation would be to follow the pattern /typename1/{typename1type}/typename2/{typename2type} after the namespace in the path. In this case, it's complaining because of "default" at the end. This could be resolved by replacing "default" with a {property} and have the property as part of the parameters, you could define it as an enum with one value "default" which would produce a similar result.
|
@veronicagg What contexts will humans be exposed to the operation name FirewallRules_List/firewallrulesListByRedis in? Do operation names have to be globally unique for any reason (e.g. using as programmatic ID)? The latter is not an intuitive name, so I'd prefer FirewallRules_List if possible, I just want to make sure there's no extra constraints... |
|
@veronicagg I've made the change with patchSchedules 'default' as enum - I do still have a worry here that this might have been overvalidation - as it might end up making the actual generated sdk client more confusing to have to specify an enumeration with a single value... but we can wait to preview what sdk changes would result. |
|
@veronicagg |
|
@veronicagg No, my bad, I didn't update parameter set for all METHODs. |
d6e3d16 to
38ee3a2
Compare
|
@TimLovellSmith for your fist question "FirewallRules_List" looks good, the operation id is used in the method name in the SDK. |
…ist' for what we hope will be nicer method naming.
38ee3a2 to
ad66be2
Compare
|
@veronicagg Thanks for the answers! I'll change it to FirewallRules_List then, and bring back the patchSchedules/default change. |
|
@veronicagg So I think I've fixed all the important feedbacks and linter errors. However, node SDK build job still seems to be failing in TravisCI - and outputting usage instructions instead of an actual error!? Could you please check on that? |
|
@TimLovellSmith we're working on fixing the CI failure that you're seeing, we expect to have that working today.
Thanks! |
|
@veronicagg No, I was not planning to address that as part of this PR. Is there an easy way to define the operations API without having to define the entire operation operations body shape in our redis.json? It's rather a lot of declarations to add, and I would think usually every RP implements the same contract. |
|
@TimLovellSmith There seem to still be issues with CI, not just yours, so I've pinged someone else on that. I'll restart this job in case it helps anyway. |
|
@veronicagg Re "Operations" api, I think I was hoping for something like "Resource" such that every RP definition can link to one common definition, since they should all follow the same basic contract. Although yes, "Resource" is in our spec too... |
|
@TimLovellSmith ah, yes, I believe you're asking for https://github.com/Azure/azure-rest-api-specs-pr/pull/40, it's coming, at which point you'll be able to point to the common definition. |
|
@veronicagg I had a look at pull/40 but I don't see Operations anywhere in that diff? It feels nitpicky that we are discussing linter errors Operations API as part of this PR as it is really orthogonal to the changes proposed. Edit... I suck at reading swagger |
2e16c46 to
6500525
Compare
|
@veronicagg I've added the Operations API... its definition slightly varies from CDN's. |
veronicagg
left a comment
There was a problem hiding this comment.
Minor comment regarding descriptions. I agree this change is orthogonal with the proposed change, so in my previous comments I was mostly asking if you were planning on addressing it now or not. What's blocking this PR at the moment, is that we're having issues with CI, I've restarted the job a couple of times, there seems to still be failures, which I'm trying to understand.
| } | ||
| }, | ||
| "OperationListResult": { | ||
| "description": "Result of the request to list CDN operations. It contains a list of operations and a URL link to get the next set of results.", |
There was a problem hiding this comment.
please update description
| "items": { | ||
| "$ref": "#/definitions/Operation" | ||
| }, | ||
| "description": "List of CDN operations supported by the CDN resource provider." |
There was a problem hiding this comment.
please update description
|
@ravbhatnagar do you have any thoughts on the question above regarding OperationsAPI?: "@veronicagg I had a look at pull/40 but I don't see Operations anywhere in that diff? It feels nitpicky that we are discussing linter errors Operations API as part of this PR as it is really orthogonal to the changes proposed. Edit... I suck at reading swagger" thanks! |
|
@veronicagg Woohoo, checks passed! |
|
@veronicagg Thank you! |
…tive changes to existing APIs).
(Reissue of PR #977 to get around CI 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