Conversation
|
Hi There, I am the AutoRest Linter Azure bot. I am here to help. My task is to analyze the situation from the AutoRest linter perspective. Please review the below analysis result: File: AutoRest Linter Guidelines | AutoRest Linter Issues Send feedback and make AutoRest Linter Azure Bot smarter day by day! Thanks for your co-operation. |
fearthecowboy
left a comment
There was a problem hiding this comment.
I've got reservations here -- you're introducing breaking changes (and example data isn't matching types in the spec)
| { | ||
| "name": "domainNameLabel", | ||
| "in": "query", | ||
| "required": false, |
There was a problem hiding this comment.
Was this a mistake previously?
If they didn't pass it in would this fail?
This shouldn't be a binary breaking change, but it is technically be a source-level-breaking change (since someone could have omitted the parameter and now would have to pass one).
There was a problem hiding this comment.
domainNameLabel is a required property on the service. If users were not passing the parameter, the service would throw an exception.
Yes, it is a breaking change on the client but it is required and i dont expect any customers to get impacted since we were anyway throwing .
This is a bug that we are fixing on the client
There was a problem hiding this comment.
I figured as much -- it's not likely to cause a breaking change in the generated code unless someone used the function without the parameter, which would have failed... works for me.
| "unit": "Count", | ||
| "currentValue": 47, | ||
| "limit": 100, | ||
| "currentValue": 8.0, |
There was a problem hiding this comment.
I noticed these are now decimal values.
in usage.json -- these values are listed as int64 format and you're sending in non-integer values.
I don't think that this is OK -- if the values are coming back as non-integers, some deserializers will probably fail. Is there a service change?
"Usage": {
"properties": {
"unit": {
"type": "string",
"description": "An enum describing the unit of measurement.",
"enum": [
"Count"
],
"x-ms-enum": {
"name": "UsageUnit",
"modelAsString": true
}
},
"currentValue": {
"type": "integer",
"format": "int64",
"description": "The current value of the usage."
},
"limit": {
"type": "integer",
"format": "int64",
"description": "The limit of usage."
},
"name": {
"$ref": "#/definitions/UsageName",
"description": "The name of the type of usage."
}
},There was a problem hiding this comment.
we will not be sending non-integer values. sending non-integer values does not make sense for this api.
To be honest, the service uses this object Microsoft.Azure.Insights.Models.UsageMetric to populate the response and property definitions are as follows
private double _currentValue;
private string _id;
private double _limit;
private LocalizableString _name;
private string _nextResetTime;
private TimeSpan? _quotaPeriod;
private string _unit;
Even though it says double currentValue, it doesnt make sense to introduce a breaking change on our client (from int64 to double).
There was a problem hiding this comment.
The trouble is, some deserializers may not properly handle deserializing values like 50.0 into an integer field, even if the value is actually a whole number. If your service is returning number values with dots in them, that may not be good for some clients.
I'm more concerned with what the service is returning...
There was a problem hiding this comment.
at this point, i dont know what we can do here. you might have to take it up with the insight people. All usages implementations use that i believe.
There was a problem hiding this comment.
i thikn the right thing to do would be to convert the clients to double but that would be a breaking change :( . do you think we ought to do that. does this warrant a breaking change for the client? i personally dont think we should introduce a breaking change for this...
There was a problem hiding this comment.
I think we just stepped into a lose/lose situation.
If the service has been returning floating point numbers all along (even if they are whole numbers) -- that means the clients are broken already.
Which means, we're better off correcting the specification with the correct types and publishing a new version of the package, even if it means that it's a minor breaking change.
Given that the other things in this PR are corrections which may introduce minor breaking effects, my preference is that let's do the right thing and fix the spec and generate the new code.
There was a problem hiding this comment.
i agree with you but the not the timing. With ignite close by, i dont want to do this now. can we do this post ignite? this would require changes in PS as well.
There was a problem hiding this comment.
@fearthecowboy, i have opened an issue for this that we will get to after ignite: #1624
| }, | ||
| "Usage": { | ||
| "properties": { | ||
| "id": { |
There was a problem hiding this comment.
This will be a breaking change to a generated class.
There was a problem hiding this comment.
it is a read only string right? why is that considered a breaking change? what do you suggest we do?
this is a bug fix we are trying to do
There was a problem hiding this comment.
If it's a bugfix, I'm not going to flag it-- it's about as harmless as can be, when introducing a new property into a class where it wasn't before. Likely it's not going to screw anything up.
|
@fearthecowboy i have replied to your comments. please take a look. |
|
No modification for AutorestCI/azure-sdk-for-node |
…SaaSMaster Update communication swagger to have async PUT and DELETE
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