json_serializable.dart icon indicating copy to clipboard operation
json_serializable.dart copied to clipboard

root level arrays

Open TheDevelolper opened this issue 5 years ago • 7 comments

Hi there,

I wondered if this library has support for root level arrays? What happens if your JSON http endpoint returns a collection of objects?

I've been struggling to serialise these so if you have any examples I'd really appreciate it.

TheDevelolper avatar May 29 '20 08:05 TheDevelolper

You'll have to wire that up by hand. It's not too hard.

On Fri, May 29, 2020 at 1:18 AM ISimplifyComplexity < [email protected]> wrote:

Hi there,

I wondered if this library has support for root level arrays? What happens if your JSON http endpoint returns a collection of objects?

I've been struggling to serialise these so if you have any examples I'd really appreciate it.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/dart-lang/json_serializable/issues/648, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAEFCS64WRC6P3OM7O2N3DRT5VWLANCNFSM4NN2PWDQ .

kevmoo avatar May 29 '20 18:05 kevmoo

See https://stackoverflow.com/questions/50360443/parsing-json-that-has-a-nested-array-of-objects-in-dart/50360708#50360708

kevmoo avatar Jun 10 '20 22:06 kevmoo

@kevmoo Thank you.

TheDevelolper avatar Jun 16 '20 09:06 TheDevelolper

You'll have to wire that up by hand. It's not too hard.

so that means that the library doesn't support root level arrays?

albert0m avatar Sep 23 '20 08:09 albert0m

so that means that the library doesn't support root level arrays?

Not – yet. I'm actually working on this now. I'll reopen this issue to track my work.

No promises on timeline, though.

kevmoo avatar Sep 23 '20 16:09 kevmoo

@kevmoo Whats your concept to implement this? Automatic detection via types or configuration in annotations? Any updates - just asking for a friend ;-)

matsp avatar Jul 05 '21 12:07 matsp

It's...tricky. Not high priority for me now.

On Mon, Jul 5, 2021 at 5:37 AM Mats Pfeiffer @.***> wrote:

@kevmoo https://github.com/kevmoo Whats your concept to implement this? Automatic detection via types or configuration in annotations? Any updates

  • just asking for friend ;-)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/google/json_serializable.dart/issues/648#issuecomment-874079844, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAEFCQVBEJSV7Z5PU6Z5DLTWGRQZANCNFSM4NN2PWDQ .

kevmoo avatar Jul 05 '21 17:07 kevmoo