3 ms·
Agreed, this is borderline FUD. The main complaint of the thread starter is that Dart doesn't have as good built-in JSON deserialization as C# (which although
by WoodenChair 12y ago
Agreed, this is borderline FUD. The main complaint of the thread starter is that Dart doesn't have as good built-in JSON deserialization as C# (which although I haven't used C# in a while, from what he describes is essentially true). However, Dart does have built-in JSON support. See this article:
https://www.dartlang.org/articles/json-web-service/ https://www.dartlang.org/articles/json-web-service/
And here's a quote by Alan Knight from the thread on the state of third party libraries:
"I'm aware of three options, all already mentioned here, that are at least partly written by the Dart team, if you are looking for extremely simple there is a JSONCodec in dart:convert. If you are looking for something very general that can with minimal configuration (minimal configuration requires mirrors, so it will have overhead) there is the serialization package. If you are looking for high performance but need some configuration then protocol buffers are probably your best bet, and there are certainly things that support using protocol buffers in C#. There are various other options people have written for their specific requirements, as seen elsewhere in this thread."
- d2p 12y agoThe built-in stuff you mention deserialises into maps, not Dart classes. This loses all type checking, code-completion, etc. (this is all detailed in the thread ;-))
- WoodenChair 12y agoI read the whole thread, but your title here is misleading: "Google's Dart doesn't support deserialising JSON (or anything) into Dart Types " You mean that it doesn't have support for deserializing into custom Dart types - it does have built-in support for deserializing into Map, List, String, etc...
- d2p 12y agoYou're right; "Dart Types" is slightly ambiguous, it wasn't intended that way. It's possible to deserialise into a Map; but not into a type you defined (or even a built-in type that isn't in a small list of types it knows about).