Dart Classes for Models from JSON (Code Generation)

I have looked at this thread: https://groups.google.com/a/dartlang.org/forum/#!topic/misc/0pv-Uaq8FGI but still cannot find a solution for what I would like to have on client side (possibly on the server).

I guess there must be a way to provide a standard data structure format that is exposed as a JSON object in JS territory (like json schema or yaml or whatever) that can be used as input to create Dart classes that contain from a JSON constructor and a JSON method (maybe some validation for data ranges) that the developer can proceed with if additional logic is required for the data coming over the wire.

I don't want to use mirrors if possible, classes should be statically generated instead (i.e. run tool -> get class to match latest schema / input).

Can you point me in the right direction?

Thank.

+3


source to share





All Articles