-
Notifications
You must be signed in to change notification settings - Fork 48
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
Always comes an empty tracking fields array #294
Comments
The problem is that the first StartObject token is always skipped due to calling reader.Read() before the loop and calling it again in the loop condition. Therefore, you can simply remove reader.Read() before the loop and move the reader.Read() call to the beginning of the loop condition. I can't create a branch and pull request with the necessary fix. But Read method of KeyValuePairConverter should look like this: public override KeyValuePair<string, string>[] Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
if (reader.TokenType == JsonTokenType.StartArray)
{
var values = new List<KeyValuePair<string, string>>();
while (reader.Read() && (reader.TokenType != JsonTokenType.EndArray))
{
if (reader.TokenType == JsonTokenType.StartObject)
{
var fieldName = string.Empty;
var fieldValue = string.Empty;
while ((reader.TokenType != JsonTokenType.EndObject) && reader.Read())
{
if (reader.TokenType == JsonTokenType.PropertyName)
{
var propertyName = reader.GetString();
reader.Read();
if (propertyName == _keyFieldName) fieldName = reader.GetString();
else if (propertyName == _valueFieldName) fieldValue = reader.GetString();
}
}
values.Add(new KeyValuePair<string, string>(fieldName, fieldValue));
}
}
return values.ToArray();
}
throw new Exception("Unable to read Key/Value pair");
} Please check it and release the new version of the ZoomNet lib as soon as it possible. I'm realy looking forward to it. :) |
Thanks for reporting this issue. I was able to confirm there's an issue in the custom JSON converter that causes the first item in the array to be skipped. In other words:
So the resulting array is not always empty, but if your JSON only contains a single tracking field I can see how you would reach this conclusion. Regardless, this bug needs to be fixed. |
That's right, I tested this method when using a single tracking_field. Anyway, thank you for the fast answer and commit. |
Package is being built as I write this. Will be on Nuget shortly (probably in an hour or so... depending how long it takes for Nuget to index the package) |
🎉 This issue has been resolved in version 0.63.1 🎉 The release is available on: Your GitReleaseManager bot 📦🚀 |
When calling the ZoomClient method.Meetings.GetAsync always receives an empty TrackingFields array.
The problem clearly lies in the parsing of the incoming response.
The text was updated successfully, but these errors were encountered: