[swift-evolution] Idea: Exposing _JSONEncoder and _JSONDecoder functionality

Morten Bek Ditlevsen bek at termestrup.dk
Tue Jul 25 02:44:41 CDT 2017

In the implementation og JSONEncoder and JSONDecoder we have the internal
functionality that encodes Codable types to a structure that is compatible
with JSONSerialization.
The JSONEncoder then calls JSONSerialization on this structure - and
JSONDecoder vice versa.
In some situations it could be nice to just encode or decode to or from
this structure - and not have the final encoding to Data performed. For
instance if you have some library that hands you a structure in this format
and you would like to perform decoding.

Can anyone else see the relevance of exposing this functionality? It could
be exposed by wrapping _JSONEncoder in a public JSONStructureEncoder or
something similar.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20170725/ca65d11b/attachment.html>

More information about the swift-evolution mailing list