-
Notifications
You must be signed in to change notification settings - Fork 29
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
Serialized JSON is incorrect (Case #4) #18
Comments
It does not because I was checking for default value of type and |
Eliminating default values could be 'questionable'. When you serializing the object currently you assume the client deserializing the object will use exactly the same class definition. In my case I could deserialize this missing (server-side int) id = 0 in client side as int? to null. You know, it can lead to problems. This optimization should be used when the implications are understood. |
That is why I will have a flag for determining when to eliminate primitive |
Test it again. I added a new flag to turn it off and on. The default is true, so you will have to set it to false or just compile the dll with false hard-coded. The issue with leading comma has been fixed too which causes invalid json. |
It works, thanks. |
When I serialized the following C# instance:
using the following class definition:
I receive the following JSON:
The fields latitude and longitude contains ',' instead of '.'.
The specification requires dot. I use Polish regional settings.
The friends array is corrupted. The first item doesn't contain id.
The text was updated successfully, but these errors were encountered: