-
-
Notifications
You must be signed in to change notification settings - Fork 134
Conversation
Oh wow this is exactly what I needed right now :D good timing @paulw11 |
How about decoding? Will it decoded correctly? |
As per my comment on the PR - What would be the semantics of decoding an Hopefully when you are decoding something you know what you are decoding. If you don't know then you would need to implement your own decoding logic that determined the embedded type somehow. Conceivably you could provide a list of potential types and when the decoder encountered an embedded object it could |
I know it is redundant but please add the same test for Thank you for your contributions. |
Do you mean add code to the test to confirm that decoding the result of encoding gives the expected result? This sounds like a reasonable test that should probably have been included in current test suite. |
Oh, I am sorry. I meant, encoding, not decoding, and add same test into AnyEncodableTests.swift. |
Oh ok. That makes more sense 😀 |
I have updated the AnyEncodableTests |
This PR adds minimal support for encoding any value that conforms to
Encodable
(#58).Tests have been updated for this case.
What is missing:
Equatable and Hashable support for a wrapped
Codable
Decodable
support, however it does not make much sense to decode directly toAnyCodable
anyway; You would decode the concrete type and then type erase toAnyCodable
if required.