-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Adding App Insights data plane client #2767
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
Conversation
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
Codecov Report
@@ Coverage Diff @@
## master #2767 +/- ##
==========================================
+ Coverage 56.71% 56.91% +0.19%
==========================================
Files 7647 7772 +125
Lines 158352 159826 +1474
==========================================
+ Hits 89803 90958 +1155
- Misses 68549 68868 +319
Continue to review full report at Codecov.
|
|
@lmazuel Does the python SDK support XML deserialization? I see some code for it in ms-rest . I'm seeing however that events_get_odata_metadata (an operation which returns XML), tries to deserialize as JSON. I also get a log message indicating it's forcing the Accept header to application/json -- figured might be related if the client is expecting JSON. See test output and relevant swagger lines. I also verified that using 'raw = true', the request is successful and only the deserialization is failing. |
|
Better test example, illustrating successful response but failed deserialization |
|
@alexeldeib , yes starting autorest.python 3.0.53 and msrest 0.5.0, there is XML support! If the content-type is XML. |
|
@lmazuel I think that's accurate as to what I would have expected, or if there's a different way to model it that works with the client otherwise I'd be happy to adjust. This also came up with respect to nodejs -- see Azure/azure-sdk-for-node#3021 (comment) Not decided yet on a solution there |
|
I think autorest.typescript will parse the XML and pass it along as a simple object tree, similar to what is returned by |
|
I think it's fine, it's just I didn't consider this scenario. In all transparency, XML is still pretty new and really vague in the Swagger spec, in particular I didn't find anything about free-form object (what you have) and XML. But I guess it makes sense to return the raw XML tree when we see "object". At least on deserialization, I don't think it can be supported on serialization. Edit: on serialization could be done actually, serializing the tree in place without the |
|
@alexeldeib I released a msrest 0.5.1 that should fixes your XML issue. Please confirm when you have some time :) |
|
Looks good 😄 I can see the same test fixed in CI build, thanks @lmazuel ! |
|
@lmazuel hmm, seems like after using latest generation the XML deserialization no longer works? The raw response is still fine, but the object isn't. Was there anything changed here? I didn't see anything obvious that looked problematic in the code myself |
|
@alexeldeib I have some deep tests to do on "object" + "additionalProperties", I will double-check this closely, and be sure to add precise test (I did it already, but seems I didn't model your situation close enough :/) |
|
@lmazuel I also did some digging into this -- looks like 0.5.1 works, but 0.5.2 breaks. Weird thing is, the parsing works fine when __call__'ed with content-type 'application/xml'. However, the generated method calls it without a content-type. I'm not sure why this would have worked before, still looking at how to fix. Looking at the diffs i'm not sure how this even broke between 0.5.1 and 0.5.2. The swagger has produces: application/xml, do you have any ideas how to fix the invocation generation here with that additional info? |
|
@alexeldeib The generation does not use "content_type", because "response" is a HTTP response object, and the content-type is extracted from the headers. Edit: looking at your recording:
this means "content_type" is "application/xml" and is not needed |
|
@alexeldeib ok got it, damn....
does not work if it's I'll improve my |
|
Nice catch, I looked at that if statement but thought it was okay 👍 I will also go ahead and push the 3.0.58 generation. |
|
Fixed in Azure/msrest-for-python#117 |
| # Construct headers | ||
| header_parameters = {} | ||
| header_parameters['Accept'] = 'application/json;odata=none' | ||
| header_parameters['Accept'] = 'application/json' |
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.
why is that? Is this an Autorest issue? Something weird in 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.
Bug in the swagger on my end, see Azure/azure-rest-api-specs#3409
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.
ok, saw your comment, thanks!
This PR has a very similar Query operation group to #2557, which also means that Azure/msrest-for-python#103 (ISO8601 intervals) and Azure/msrest-for-python#104 apply (raw field without transformation).
Azure/azure-rest-api-specs#3257 adds the configuration for auto PRs.
I'm still adding tests, but wanted to begin the review process since the client works nicely 😄