Jericho / ZoomNet

.NET client library for the Zoom.us REST API v2
MIT License
69 stars 45 forks source link

Registrant.CustomQuestions is not deserializing properly #329

Closed ZaL133 closed 7 months ago

ZaL133 commented 7 months ago

Using either the Meetings.GetRegistrantsAsync or Meetings.GetRegistrantAsync methods to retrieve meeting registrants, the custom questions are showing up with empty key/value. Interestingly the correct number of entries are there.

image

Checking the ZoomNet Registrant.CustomQuestions property is of type KeyValuePair<string, string>[]. https://github.com/Jericho/ZoomNet/blob/develop/Source/ZoomNet/Models/Registrant.cs#L120

Looking at the zoom docs, this field doesn't have key/value pair but a title/value pair which is I think the issue: https://developers.zoom.us/docs/api/rest/reference/zoom-api/methods/#operation/meetingRegistrants

I'd propose creating a CustomQuestion class with Key/Value properties but set the JsonProperty values to title/value as to not break.

Jericho commented 7 months ago

We have a unit test that validates the parsing of the registrant JSON but I just realized that it doesn't verify that the custom questions are properly parsed.

I added the following assertions to the unit test

result.CustomQuestions.ShouldNotBeNull();
result.CustomQuestions.Length.ShouldBe(1);
result.CustomQuestions[0].Key.ShouldBe("What do you hope to learn from this Webinar?");
result.CustomQuestions[0].Value.ShouldStartWith("Look forward to learning");

and, sure enough, the unit test fails because the key and value are null. Exactly as you described.

Let me think about how to fix it.

Jericho commented 7 months ago

:tada: This issue has been resolved in version 0.72.0 :tada:

The release is available on:

Your GitReleaseManager bot :package::rocket: