dlbuckley
(Dale Buckley)
April 4, 2018, 8:38am
2
Encodable
doesn't conform to Encodable
and never did. The errors are just now more robust with the introduction of the conditional conformance added in 4.1.
Unfortunately you either need to specify the type or use a method of fuzzy matching like with AnyCodable or JSON .
You can read more about this on these threads:
Hi Jon,
I just joined this mailing list and have tried to catch up on the
history of this thread, so please excuse me if I’ve missed something.
I’m sorry the Codable API at the moment does not answer your needs —
you’re clearly not the only one who’s run into this, so let’s see
how we can work together to make the API better for everyone.
For one thing, in the case of grabbing a subtree of JSON as
"unevaluated" or "unmapped" (as it appears to be in the metadata case),
it should be fairl…
And:
Currently it is impossible to ask a Decoder for some unevaluated data from it's storage. This problem arrises, if someone needs this data to re-encode it later, but does not know how it is structured. The problem was described in SR-53112 .
A Unevaluated type has also been discussed in relation to this question .
I am opening this topic, because the discussion seems no longer directly relevant to this other problem to me.
Dynamic Member Lookup