-
Notifications
You must be signed in to change notification settings - Fork 62
Fixes deserialization of OData primitive types #135
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
new file: src/Microsoft.Graph.Core/Models/ODataMethodInt64Response.cs
baywet
previously approved these changes
Sep 25, 2020
zengin
previously approved these changes
Sep 25, 2020
tests/Microsoft.Graph.DotnetCore.Core.Test/Serialization/SerializerTests.cs
Outdated
Show resolved
Hide resolved
zengin
previously approved these changes
Sep 30, 2020
nikithauc
previously approved these changes
Oct 2, 2020
baywet
reviewed
Oct 2, 2020
| <PackageReference Include="Moq" Version="4.10.1" /> | ||
| <PackageReference Include="xunit" Version="2.4.1" /> | ||
| <PackageReference Include="Microsoft.Graph" Version="1.*" /> | ||
| <PackageReference Include="Microsoft.Graph" Version="3.14.0" /> |
Member
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.
shouldn't this be 3.* instead of locking down the version?
Collaborator
Author
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. Will change.
nikithauc
reviewed
Oct 6, 2020
zengin
previously approved these changes
Oct 6, 2020
zengin
approved these changes
Oct 6, 2020
nikithauc
approved these changes
Oct 6, 2020
MIchaelMainer
added a commit
that referenced
this pull request
Oct 6, 2020
* Support native plaform Http handlers for Xamarin.Mac * Update macOS to use NSUrlSessionHandler in foundation namespace. * Add support for Xamarin.Mac20 * Compression header handling (#118) * Copy Http Content headers to the destination stream in compression handler. * Ensure headers are not empty. * Ensure that compressed data is the same as decompressed data. * Add `IBaseRequestBuilder` interface to `BaseRequestBuilder` class (#128) * Update Microsoft.Graph.Core.csproj (#129) * Use new service connection (#130) * Fixes deserialization of OData primitive types (#135) Adds intermediate response objects for deserialization of OData primitives. new file: src/Microsoft.Graph.Core/Models/ODataMethodInt64Response.cs new file: src/Microsoft.Graph.Core/Models/ODataMethodInt32Response.cs new file: src/Microsoft.Graph.Core/Models/ODataMethodBooleanResponse.cs new file: src/Microsoft.Graph.Core/Models/ODataMethodStringResponse.cs
Merged
andrueastman
pushed a commit
that referenced
this pull request
Dec 8, 2020
Adds intermediate response objects for deserialization of OData primitives. new file: src/Microsoft.Graph.Core/Models/ODataMethodInt64Response.cs new file: src/Microsoft.Graph.Core/Models/ODataMethodInt32Response.cs new file: src/Microsoft.Graph.Core/Models/ODataMethodBooleanResponse.cs new file: src/Microsoft.Graph.Core/Models/ODataMethodStringResponse.cs
This was referenced Dec 8, 2020
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Functions and actions that return OData primitive types are wrapped in a JSON object. That encapsulating JSON object is handled for Graph types, but not for OData primitives. This PR fixes deserialization for request builders generated for actions and functions that returned OData primitives. The following response was not being deserialized:
{ "@odata.context": "https://graph.microsoft.com/beta/$metadata#String", "value": "somevalue" }This is causing deserialization errors for generated API signatures like this as the response body is not a string
There are some actions like
checkMemberObjectsthat return a collection of OData primitives. These scenarios are accounted for in the generator:Fixes
Fixes #134
Fixes microsoftgraph/msgraph-sdk-dotnet#549
Discovered bug
microsoftgraph/msgraph-sdk-serviceissues#9
Scenarios
I'm a bit concerned about breaking existing v1.0 scenarios that work contrary to the assumptions here. I've marked the scenarios that I have tested as validated.
v1.0 scenarios addressed by this fix
Tool tip
You can use LinqPAD to query the metadata like this
https://github.com/MIchaelMainer/graph-test-harness/blob/master/src/LINQPad/Query%20-%20Metadata.linq#L56