MelbourneDeveloper / Jayse

Lossless conversion of JSON to and from statically-typed, immutable objects in Dart and .NET
https://pub.dev/packages/jayse
MIT License
29 stars 2 forks source link

Suggestion: Allow Jayse objects inside JsonObject.fromJson() #2

Open timovandeput opened 4 months ago

timovandeput commented 4 months ago

To create nested structures of JSON objects, it makes sense to build them using JsonObject.fromJson(...).

But when I try to put any JsonValue inside such structure, parsing throws an exception like: "Invalid argument(s): Unknown JSON value type: JsonString".

Please consider allowing the (re-)use of JsonValue instances inside JsonObject.fromJson(), so wrapping earlier parsed JSON does not require repackaging.

Thank you for the otherwise amazing library!