stablekernel / dart-codable

A library for converting dynamic, structured data (JSON, YAML) into Dart types.
BSD 2-Clause "Simplified" License
38 stars 9 forks source link

API improvement suggestion: decodeObjects → decodeObjectList #6

Open daniel-v opened 6 years ago

daniel-v commented 6 years ago

Cool project! I can see myself using it. One of the things I ran into when testing things was that pesky s.

We have things that look like this:

    members = object.decodeObjects("members", () => Person());
    manager = object.decodeObject("manager", () => Person());

As it turns out, I am a functional analphabet and that extra s to indicate that we are talking about an interable skipped me. I think I would have spotted my error if the indication was much more explicit. Something like object.decodeObjectList

What do you think?

itsjoeconway commented 6 years ago

Sure. I think having both and having one proxy into another is ok.