Skip to content

Conversation

@dragonfly91
Copy link

RI from upstream/master into origin/release

nemanja88 and others added 12 commits August 17, 2015 17:56
HDInsight ARM SDK update - GetConfigurations extension
reverting unintentional changes to tests csproj
Site Recovery MAML changes
…it tests

NOTE: I am not incrementing the NuGet package version because there is
another PR coming very soon and there's no point in shipping a new SDK
version that will only live for one day.

Apparently deserialization of DateTime in Search results has been broken
since the Search SDK first shipped (DateTimeOffset deserialization works
fine). The root cause is the "double deserialization" we need to do in order
to "unflatten" the search response JSON. First we deserialize to JObject and
capture the OData annotations (for things like @search.highlight,
@search.score, etc.). This results in the DateTime fields being deserialized
into DateTimeOffsets. Next, we deserialize again into the user's model class,
which was resulting in an InvalidCastException because JSON.NET can't cast
DateTimeOffset to DateTime. The fix is to add some read logic to
DateTimeConverter (and a lot of new test coverage).

I also took the opportunity to fix some unit tests that weren't running
correctly in other time zones. This bug was reported back in June:

#1202
Fix nextLink json value for ARM APIs. This will change the nextLink k…
Search SDK: Fixing DateTime deserialization and time zone-specific un…
dragonfly91 pushed a commit that referenced this pull request Aug 20, 2015
RI from upstream/master into origin/release
@dragonfly91 dragonfly91 merged commit 8b84b45 into MabOneSdk:release Aug 20, 2015
dragonfly91 pushed a commit that referenced this pull request Oct 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants