lucasmpaim / EasyRest

MIT License
13 stars 3 forks source link

Make (De)Serialization more abstract #11

Open Hazer opened 5 years ago

Hazer commented 5 years ago

Hi, I think the serialization may have a more abstract approach, so we can change the underlying serialization method without breaking changes.

Codable is great, but as you @lucasmpaim said, some old projects with bad API structures cannot easily update to Codable, so I want to open a discussion into changing the project APIs in such way that we can swap the Json Parsing engine like Retrofit does.

We could start with a discussion topic and defining a checklist of requirements, no need to rush, but are you into? @lucasmpaim

lucasmpaim commented 5 years ago

Yeah, I think that's a good idea, The codable directly it's a temporary approach for quickly support for Swift 4+

Now it's a good idea to made a better approach like Retrofit, to made possible Json parsing way not be forced by library, so we can use what's is better for each project, like Codable, SwiftJson, Gloss or anything else.

I think we can create a generic Protocol and made Codable the Standard of library, because this protocol is on Swift natively, and add official support for the more common libraries, like Swift Json and put in a subpod, like:

EasyRest/SwiftJson

For change it, I like the Stripe approach on Python library, I'm thinking on something like it.

Let me know about your thoughts