Quantcast
Channel: Json.NET
Viewing all articles
Browse latest Browse all 1767

Commented Issue: Dictionnary Deserialization Bug with TypeNameHandling [23589]

$
0
0
Using TypeNameHandling in Object

Reding need $type in first property in the json object to read the dictionnary

This does not work :

"Positions": {
"Big": {
"$type": "FormEngine.Model.Position,FormEngine.Model"
},
"$type": "System.Collections.Generic.Dictionary`2[[FormEngine.Model.LayoutType, FormEngine.Model],[FormEngine.Model.Position, FormEngine.Model]], mscorlib"

}


========================
This work

"Positions": {
"$type": "System.Collections.Generic.Dictionary`2[[FormEngine.Model.LayoutType, FormEngine.Model],[FormEngine.Model.Position, FormEngine.Model]], mscorlib",
"Big": {
"$type": "FormEngine.Model.Position,FormEngine.Model"
},


}
Comments: ** Comment from web user: airpaulg **

Must $type be first only for JSON arrays? Or it must be first also for any JSON object?


Viewing all articles
Browse latest Browse all 1767


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>