-
Notifications
You must be signed in to change notification settings - Fork 2
Meta issue for discussion of this approach and API. #1
Description
This is an attempt to flesh out an idea that I've kicked around with a number of people to address the difficulty of interacting with untyped structured data in Dart 2. The canonical example is interacting with json, where the result of parsing is a large untyped blob of data that the user wants to be able to interact with in a typed way. This also arises with RPC calls in flutter, and also has come up with yaml.
See README for some examples of how this API would be used, as well as the test files.
Currently all that this provides is casting, but if the API turns out to work well, I would like us to explore using the schema to drive json and yaml parsing directly. That is, instead of parsing into untyped data and then casting, consider using the schema in the parser/RPC call/whatever to generate code with the expected reified type directly.
This meta issue is for discussion of the general idea of the API, as well as specifics around naming, missing functionality, etc.
I'll file a few specific sub-issues for additional discussions around the following:
- Should there be an incremental version of the API: Meta issue for discussion of an incremental API #2
- Should there be a lazy version of the API: Meta issue for discussion of a lazy API #3
- Should there be a debug version of the API: Meta issue for discussion of a debug API #4