Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make all model Codable by default #198

Merged
merged 3 commits into from
Oct 21, 2019
Merged

Make all model Codable by default #198

merged 3 commits into from
Oct 21, 2019

Conversation

mackoj
Copy link
Contributor

@mackoj mackoj commented Oct 8, 2019

Add a new option codableModel to allow all models to be Codable by default.
For it to work I have to make AnyCodable public and make it a requirement for the AnyResponseValue.SuccesType and ApiResponseValue.SuccesType

@mackoj mackoj changed the title Make all model coddle by default Make all model Codable by default Oct 8, 2019
@mackoj mackoj marked this pull request as ready for review October 8, 2019 21:45
README.md Outdated Show resolved Hide resolved
@yonaskolb
Copy link
Owner

I'm interested in the use case you have for this @mackoj? What code are you writing that makes use of the fact that all responses are codable?

@mackoj
Copy link
Contributor Author

mackoj commented Oct 21, 2019

I think it's natural for my models that are simple struct to have an interface for simply serialized them.

With this I can:

  • compose the responses in more complex object/struct that can be serialized
  • cache them directly with https://github.com/mackoj/CacheManager
  • caching and serialization allow me to load them more easily too

This simplify my testing story and the development workflow.

@mackoj
Copy link
Contributor Author

mackoj commented Oct 21, 2019

I have build this(it's crappy I know) for an hackathon and one of the fear was to blow past the the API request limit and thus cache helped us.

mackoj and others added 3 commits October 21, 2019 11:07
# This is the 1st commit message:

Make all model conform to Codable by default

# The commit message #2 will be skipped:

# Update Fixture
@yonaskolb yonaskolb merged commit ccd0ec6 into yonaskolb:master Oct 21, 2019
@mackoj mackoj deleted the patch-8 branch October 21, 2019 22:50
@mackoj mackoj restored the patch-8 branch October 21, 2019 22:50
@mackoj mackoj deleted the patch-8 branch October 21, 2019 22:50
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.

2 participants