var myPerson = deserialise<Person>(json);
If you want a map, that's already supported; but you'll lose all the "type-safety" that Dart brings!
var myPerson = deserialise<Person>(json);
If you want a map, that's already supported; but you'll lose all the "type-safety" that Dart brings!
Why are you worried about type-safety? JSON itself only supports object, array, string, number, true/false, and null, so type safety isn't even an issue because invalid JSON will fail to parse. If you're talking about taking a string and regexing it into an address or whatever, then yeah: you should be writing that code yourself.
Because that's one of the huge selling points of Dart?!
If you're writing a client application, you probably have data structures. Some of those data structures you need to send to the server (or receive). When you write code that interacts with those structures, you want code-completion; static analysis, etc.; that's kinda the point of Dart's typing!
Having to choose your serialization strategy is not a bad thing. At the very least, Dart's JSON support is very similar to JavaScript already, and there are several packages that do serialization in different ways.
Just because requirements can be made complicated doesn't mean there should be no support for something simple.
The built-in .NET JSON serialise is very limited; and there are third party libraries (even used by MS themselves for ASP.NET) to address that.
I'm against super complex things, but things going into a standard library should be general enough for 80% of the use-cases in the wild (and no, I don't agree with you here), otherwise it's very hard to make changes in the standard library later, therefore instead of pushing for something half-baked, I would rather wait for third-parties to build such a library.
Scala for example has a shitty JSON parser in the standard library that nowadays nobody uses because it is limited and because third-party libraries are better. I suspect, from what you're telling me, that C#'s standard parser is in the same league.
But "99%" of developers just need serialisation, which is supported. You (and myself) want more than that.