-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[MetricsAdvisor] Bug fix: service returns null in unexpected scenarios #17776
Conversation
@@ -83,6 +83,113 @@ directive: | |||
$.properties.upperBoundaryList.items["x-nullable"] = true; | |||
``` | |||
|
|||
``` yaml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there an Issue we can link to that tracks these issues with the swagger?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, but I can create a new one. I think we'll never close it, though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the intention to communicate to the service about this changes and make sure they address them in their swagger?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. However, based on previous experiences in which we faced literally the same issue, this tends to be treated as a very low priority issue and ends up never being fixed (specially since we can workaround it on the client side). You can see we already had a set of similar transforms in MA for the same reason (service team already aware).
@@ -43,7 +43,7 @@ internal HttpRequestDataFeedSource(HttpRequestParameter parameter) | |||
|
|||
Parameter = parameter; | |||
|
|||
Url = new Uri(parameter.Url); | |||
Url = parameter.Url == null ? null : new Uri(parameter.Url); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a test covering this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When making a
GetDataFeed
request to the service, the parameters of the returned Data Source will benull
if the requester doesn't have an Administrator role. The corresponding properties are not marked withx-nullable = true
in the swagger, so we're throwing aNullReferenceException
in these scenarios.This PR adds transforms to
autorest.md
and regenerates the code to fix this issue.