Closed pagongamedev closed 5 years ago
+1. Is there any reason it's handled like this or is it a bug?
The ability to write an entry without a name was originally added to save space in collections, without realizing that when used in cases like this it would, strictly speaking, result in invalid JSON. So far, we've just let it be, since it does save space, and (so far as we know) the only serializer that can do something useful with Odin-generated JSON is Odin itself. It seemed harmless, in short.
It is very easily remedied if a compelling case is made to fix it, though.
I'm trying to use Odin as a serializer for the microsoft graph sdk. The current issue is that the library does a weirdish thing in it's source. When a successful json response is received it takes reponse headers of the http request (which is a dictionary), serializes it using Odin, and then appends it to the response json manually through string editing. So now the response contains both Odin serialized data and normal response json. Odin breaks with this.
Sorry for the long delay; I've had a leave from work, and have also been sick on top of that. I just committed a fix that gives names to key ("$k") and value ("$v") entries for all dictionary formatters. Hopefully that should resolve this.
i try to Serialization class to json but "key" of dictionary is not valid json type
example
i think it must look like this
test code
test output