Skip to content

Conversation

@dragonfly91
Copy link

RI from csm-master into csm-anudeeb

nemanja88 and others added 17 commits August 17, 2015 17:56
HDInsight ARM SDK update - GetConfigurations extension
reverting unintentional changes to tests csproj
…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:

Azure#1202
Fix nextLink json value for ARM APIs. This will change the nextLink k…
Search SDK: Fixing DateTime deserialization and time zone-specific un…
FI from csm-master into release
Fixing Bug 4265568. Signed off by SwatiM.
FI from csm-master into release
RI from upstream/master into origin/release
RI from release into csm-master
dragonfly91 pushed a commit that referenced this pull request Aug 21, 2015
RI from csm-master into csm-anudeeb
@dragonfly91 dragonfly91 merged commit c654114 into csm-anudeeb Aug 21, 2015
dragonfly91 pushed a commit that referenced this pull request Oct 6, 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.

8 participants