You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hej, it is nice to have JSON as an intermediate correctly-typed abstraction over same JSON data, but at some point I might still want to work with some dedicated data class. However, at that point I might only have the JSON left and I can not make use of some Decoder to turn my JSON into an appropriate Decodable for the task at hand.
I have a concret use case for that, where the concrete structure of my JSON is only clear at a later point in time.
Thus, I would suggest to provide a GenericJSONDecoder to turn a JSON into a Decodable. Analogous to JSONDecoder and Data.
The solution proposed here solves the issue in the meantime, but is really wasteful and rather just a short-time fix:
It is not a technical problem, but rather a concern that this is not ideal and can get wasteful for larger JSON structures, as we have to convert back to a JSON string and than into a proper Decodable.
As we have done the JSON parsing already, it makes sense to not redo this work. Also it seems that I am not the only one missing that feature. It is basically a feature request. :)
Hej, it is nice to have
JSON
as an intermediate correctly-typed abstraction over same JSON data, but at some point I might still want to work with some dedicated data class. However, at that point I might only have theJSON
left and I can not make use of someDecoder
to turn myJSON
into an appropriateDecodable
for the task at hand.I have a concret use case for that, where the concrete structure of my JSON is only clear at a later point in time.
Thus, I would suggest to provide a
GenericJSONDecoder
to turn aJSON
into aDecodable
. Analogous toJSONDecoder
andData
.The solution proposed here solves the issue in the meantime, but is really wasteful and rather just a short-time fix:
The text was updated successfully, but these errors were encountered: