Skip to content

Conversation

@Woollim
Copy link

@Woollim Woollim commented Nov 6, 2020

Hi~ First I'm happy for your great library. it makes our code more more simple and easy.

But I thinks AnyCodable has one problem.
When we use AnyCodable, we must implemented Codingkeys and Codable's many function 😱
This problem makes me write more codes. it's bad.

So I think good solution that is use PropertyWrapper.
When we use PropertyWrapper, we don't have to write many codes.
Just put it on to prefix.

This idea is inspired by KeyedCodable.CodedBy

class Example: Codable {
  @CodedAnyArray var array: [Any]
  @CodedIfPresentAnyDictionary var dict: [String: Any]?
}

Before merge this pull request, I have some problems to want to solve.

Problem

  • I don't know "CodedAnyArray", "CodedAnyDictionary", "CodedIfPresentAnyArray", "CodedIfPresentAnyDictionary" is good name.
  • "CodedIfPresentAnyArray", "CodedIfPresentAnyDictionary" isn't work in no json key. like this json "{}"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant