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
remove usage of Newtonsoft.Json #2017
remove usage of Newtonsoft.Json #2017
Conversation
name = $"GitVersion_{name}", | ||
value = $"{value}" | ||
}; | ||
var body = $"{{\"name\": \"GitVersion_{name}\",\"value\": \"{value}\"}}"; |
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 doubt we need to evaluate whether value is an Integer or not.
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.
Are you sure?
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.
Before it was going through JsonConvert.SerializeObject as object with the value of value = $"{value}"
ergo it was turned into strings. The serialized JSON is unchanged.
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.
Good point. Let's tackle that in a separate PR, if at all.
I see the appveyor actually tests the built DLL. |
@asbjornu unsure why docker tests failed. |
@Casz there are 2 more files to change, Directory.Build.props and test.props in the src folder |
There are some tests that I rather not rewrite I think it's fine that tests use newtonsoft.json 😄 |
The problem that newtonsoft.json solves in tests is deserialize json to poco. |
@arturcic I can use system.text.json instead for the tests if you want? Or I can use |
Sure works for me |
Hmmm that's odd system.text.json is already included... Looking into which package pulls it in 🤔 |
I am not sure how this ever worked, it seems that Newtonsoft.Json was filtering out none JSON objects from a string object. I dare not touch... |
I see Newtonsoft.Json by default have no error handling setup. So even if it receives an output string object like:
Such errors are completely ignored by Newtonsoft.Json. |
How can such errors be ignored, @Casz? |
Still think this is mergable, I can cleanup the Newtonsoft.Json in tests in a follow up PR. |
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 think this looks good besides treating every value as string
.
name = $"GitVersion_{name}", | ||
value = $"{value}" | ||
}; | ||
var body = $"{{\"name\": \"GitVersion_{name}\",\"value\": \"{value}\"}}"; |
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.
Are you sure?
Hm. Is the serialization of integers related to #1688 in any way? |
Thank you so much for your contributions, @Casz! 🙏 |
Sounds good, @Casz. |
fixes #2009