remove usage of Newtonsoft.Json#2017
remove usage of Newtonsoft.Json#2017asbjornu merged 10 commits intoGitTools:masterfrom jetersen:fix/newtonsoft.json-usage
Conversation
| name = $"GitVersion_{name}", | ||
| value = $"{value}" | ||
| }; | ||
| var body = $"{{\"name\": \"GitVersion_{name}\",\"value\": \"{value}\"}}"; |
There was a problem hiding this comment.
I doubt we need to evaluate whether value is an Integer or not.
There was a problem hiding this comment.
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.
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. |
asbjornu
left a comment
There was a problem hiding this comment.
I think this looks good besides treating every value as string.
| name = $"GitVersion_{name}", | ||
| value = $"{value}" | ||
| }; | ||
| var body = $"{{\"name\": \"GitVersion_{name}\",\"value\": \"{value}\"}}"; |
|
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