Add Microsoft.Cache/redis/firewallRules resource operations#977
Add Microsoft.Cache/redis/firewallRules resource operations#977TimLovellSmith wants to merge 1 commit intoAzure:masterfrom
Conversation
|
Build failed. Looks like TravisCI may have been affected by AWS. Can I get a rebuild? |
|
Hooray - build passed! |
veronicagg
left a comment
There was a problem hiding this comment.
Thanks @TimLovellSmith . I left some comments inline.
Please also take a look at the output of our validation tools:
https://travis-ci.org/Azure/azure-rest-api-specs/jobs/206299812#L2515
https://travis-ci.org/Azure/azure-rest-api-specs/jobs/206299814#L2522
There was a problem hiding this comment.
seems that this operation should be marked with x-ms-pageable https://github.com/Azure/autorest/blob/master/docs/extensions/readme.md#x-ms-pageable
There was a problem hiding this comment.
@veronicagg Is it required? I don't think we would ever actually page the response in practice.
There was a problem hiding this comment.
@TimLovellSmith - https://github.com/Azure/azure-rest-api-specs/pull/977/files#diff-785771b0c72c01e60191a5d798d6d508R1128 The model has a property named nextLink.
If you think that the server will never return more than one server page of response and the service does not have support for nextLink property in the response body then please remove nextLink as the property from the model.
However, you would still need to add the x-ms-pageable extension to the operation. The minor difference would be "nextLinkName": null in the x-ms-pageable extension. This is done explicitly to indicate AutoRest that there is no nextLink. Then AutoRest will still flatten the "value" property and return an IEnumerable<RedisFirewallRule> instead of IPage<RedisFirewallRule>
There was a problem hiding this comment.
@amarzavery OK sounds simpler then to just declare x-ms-pageable now in case we ever add it - and it won't matter if server doesn't actually set the nextLink property for now right?
There was a problem hiding this comment.
In this case, I think it is ok to fudge. The server always returns the first page. Whenever the server adds the capability to add a next page it wouldn't be a breaking change in the API or the sdk. IMHO, pageable is a standard pattern in all the ARM services. All the services should just copy paste that implementation all the time and make it the defacto standard. In that way there is consistency and the swagger spec is also an accurate representation of the API.
There was a problem hiding this comment.
From https://github.com/Azure/azure-rest-api-specs/blob/master/documentation/swagger-checklist.md :
M2017: The model definition for the body parameter and the response MUST be the same for a PUT operation. This ensures that the same entity will be reusable between GET and PUT.
Please evaluate whether the current definition is intentional.
There was a problem hiding this comment.
are there any readOnly properties in this definition?
There was a problem hiding this comment.
is the operation returning the deleted resource for "200"?
There was a problem hiding this comment.
@veronicagg Nope, we would just return 200 with no body. Is returning the deleted resource a recommended pattern?
There was a problem hiding this comment.
This is what the HTTP spec https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html says:
9.7 DELETE
The DELETE method requests that the origin server delete the resource identified by the Request-URI. This method MAY be overridden by human intervention (or other means) on the origin server. The client cannot be guaranteed that the operation has been carried out, even if the status code returned from the origin server indicates that the action has been completed successfully. However, the server SHOULD NOT indicate success unless, at the time the response is given, it intends to delete the resource or move it to an inaccessible location.
A successful response SHOULD be 200 (OK) if the response includes an entity describing the status, 202 (Accepted) if the action has not yet been enacted, or 204 (No Content) if the action has been enacted but the response does not include an entity.
If the request passes through a cache and the Request-URI identifies one or more currently cached entities, those entries SHOULD be treated as stale. Responses to this method are not cacheable.
There was a problem hiding this comment.
missing the body parameter, which is marked as required in swagger file: https://travis-ci.org/Azure/azure-rest-api-specs/jobs/206299814#L2546
There was a problem hiding this comment.
are you missing flattening for these properties?
There was a problem hiding this comment.
should it be called "ruleName"?
There was a problem hiding this comment.
@veronicagg I'm not sure. Is that a recommended pattern for nested resources?
There was a problem hiding this comment.
typo: there's ":" inside the "properties:" string.
9464949 to
0b2f50f
Compare
|
@veronicagg Any idea why linters were thinking that 'RedisCreateParameters' was a tracked resource type? |
0b2f50f to
0d5f1f1
Compare
0d5f1f1 to
6ca78c1
Compare
veronicagg
left a comment
There was a problem hiding this comment.
@TimLovellSmith regarding "RedisCreateParameters" I believe it was wrongly categorized by the tool and we're looking into that.
Are you planning on updating the return on 200 for delete method?
There's one more thing I found, property names should follow camel case format, so some properties "RedisFirewallRuleProperties/startIP", "RedisFirewallRuleProperties/endIP", "RedistProperties/staticIP" and "RedisForceRebootResponseMessage" are being flagged by our validation tools.
For some reason, I don't see CI results for the latest commit, if you push again, I expect to see them.
It looks like the latest update was squashed with the original commit, please try not to do that, as it makes it more difficult to review changes. Thanks!
| "subscriptionId": "subid", | ||
| "parameters": { | ||
| "properties": { | ||
| "startIP": "192.168.1.1", |
There was a problem hiding this comment.
Property names should follow camel case style: "startIp" , similarly for "endIp"
|
Closing this and will open new PR, since we've discussed feedbacks, and am not getting new builds... |
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