You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
.NET Core new JSON DeSerializer dont work with extra properties #475
In JSON.NET when we sent object with extra properties from JavaScript app in body of requests deserializer just ignored extra properties.
New deserializer don't work and deserialize null if model does not match 100% which is wrong.
We use ES6/ES7 and we don't need to have all models match 100% like in TypeScript.
@radenkozec - out of curiosity, what was the error you fixed? I want to understand it, particularly for the benefit of others who might hit the same issue you did.
deserializer just ignored extra properties.
If you have extra properties in the payload and need to roundtrip them, you could use the JsonExtensionData attribute to annotate an "overflow" dictionary.
New deserializer don't work and deserialize null if model does not match 100% which is wrong.
Was there a naming policy or casing mismatch issue?
This was not extra properties problem.
I was sending "5" in JSON instead of 5 for integer property. JSON.NET probably fixed these conversion issues however I fixed my errors in code. I don't prefer these kind of "auto-fixing" because it will affect performance. So on your side you don't need to do anything
Reacted by Ahson Khan
ghost locked as resolved and limited conversation to collaborators on Dec 11, 2020
Activity
radenkozec commentedon Dec 3, 2019
My error in code delete this.
ahsonkhan commentedon Dec 9, 2019
@radenkozec - out of curiosity, what was the error you fixed? I want to understand it, particularly for the benefit of others who might hit the same issue you did.
If you have extra properties in the payload and need to roundtrip them, you could use the
JsonExtensionDataattribute to annotate an "overflow" dictionary.Was there a naming policy or casing mismatch issue?
radenkozec commentedon Dec 16, 2019
This was not extra properties problem.
I was sending "5" in JSON instead of 5 for integer property. JSON.NET probably fixed these conversion issues however I fixed my errors in code. I don't prefer these kind of "auto-fixing" because it will affect performance. So on your side you don't need to do anything