-
-
Notifications
You must be signed in to change notification settings - Fork 174
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
Poor JsonUtility from UnityEngine #11
Comments
JsonUtility is used in Unity because Newtonsoft is not supported in all platforms, check the following link: Also, I can't see any oficial documentation to integrate Newtonsoft with Unity without issues, and I can't debug all platforms, sorry man |
@davidorbelian If you want, you can create a pull request with the changes and we can have other branch of this library, but the master is the most stable version |
@jdnichollsc sure I can create a PR. I think Unity limitations are very sick in this case. I already forked this and changed the JSON utility to use in my project, I will create a PR when finish code cleanup (It's targeting experimental .NET 4.6 in Unity and is planned to be only the desktop build). May be I can figure out how to fix the JsonUtility issues. |
@davidorbelian check the last version, some fixes were added, thanks for your help! 👍 |
@davidorbelian By other hand, can you attach any example of your models? |
@davidorbelian try this other package https://assetstore.unity.com/packages/tools/input-management/json-net-for-unity-11347 |
@jdnichollsc I will look at this at weekend. Sorry for so late answer. |
@davidorbelian No problem, check my example with NodeJS https://github.com/proyecto26/RestClient#example |
@davidorbelian A moment ago, I reverted all the changes from the master branch to create a pull request to compare with the previous version of the plugin, I'm going to add a property Pull request => #18 Regards, Nicholls |
Check my friend the files modified, thanks for your help and patience! 💯 https://github.com/proyecto26/RestClient/pull/18/files |
@davidorbelian any good comment from the Unity Asset Store would be really appreciated :) |
@jdnichollsc One more thing.
I have tried to POST some data to my ASP.NET Core API and every time ModelBinder from MVC failed to bind the incoming JSON to my model object. After some hours of debugging I tried to replace the JsonUtility to JsonConvert from Newtonsoft.Json package and it worked.
Also I can say, that JsonUtility can not serialize/deserialize dictionaries, which is important for me.
The dark side of that (I am not sure) is that JsonUtility may be faster, but I don't think it can compensate missing features or (in my case) just not working with my API (The problem is not from there, because Postman and Swagger working OK when testing).
You will not have any troubles with .NET Framework version, Newtonsoft requires .NET Framework 2.0.
What do you think about this?
The text was updated successfully, but these errors were encountered: