-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Migrate from Newtonsoft.Json to System.Text.Json #9881
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
Conversation
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.
I've left some suggestions.
Thanks for your contribution.
src/Files.App/Filesystem/Cloud/Detector/DropBoxCloudDetector.cs
Outdated
Show resolved
Hide resolved
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.
LGTM.
Ignore my last approve. Seems that S.T.J will deserialize json to |
@ferrariofilippo Can you resolve the merge conflicts? |
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.
LGTM
AppCenter.Start((string)obj.SelectToken("key"), typeof(Analytics), typeof(Crashes)); | ||
using var document = System.Text.Json.JsonDocument.Parse(lines); | ||
var obj = document.RootElement; | ||
AppCenter.Start(obj.GetPropertyValue<string>("key"), typeof(Analytics), typeof(Crashes)); |
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.
It appears that this isn't reading the json file correctly.
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.
That exception was thrown even by Newtonsoft.Json because that file is empty
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.
You can test by adding data and seeing that it doesn't work (pipeline adds data when the app is built)
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.
This should fix the problem
AppCenter.Start(obj.GetProperty("key").GetString(), typeof(Analytics), typeof(Crashes));
Should I open a new PR?
You can also remove using Vanara.Extensions.Reflection;
as is no longer needed
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.
Should I open a new PR?
Please 👍
Can do the same for the bing api key
Resolved / Related Issues
Details of Changes
Validation