-
Notifications
You must be signed in to change notification settings - Fork 200
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
Codegen failure: Enum types generates an invalid type definition as enums do not implement Codable #246
Comments
This fixes problems reported in several issues: #111 #240 #246 #318 #314 **Notes:** - added support for SQLite to handle Enums - added support for SQLite to handle non-model types: - custom Codable structs - codable arrays - added tests to make sure the right values are represented as SQLite bindings - remove field type string representation - re-organized schema related files - add support for Enum and non-model types - remove commented code - fix SQLite Int64 precision - improve documentation and test cases - better error handling and parameter naming - addressed PR feedback - add tests for `AnyEncodable` - renamed variables for improved readability - improved error message - minor naming changes to address PR feedback - update cocoapods version to be in sync with master **Tests:** - added a model that has all types of fields to make it easier to visualize how data is represented on SQLite **Pending:** - More documentation - GraphQL clenup on API category
Hi @rodrigoelp, support for codable enums just landed in |
Has this been fixed yet? I have the same issue in my project at the moment. |
Still same issue.. |
Hey @rodrigoelp @yosuke1985 @AnruStander we just released a stable v1.0.0. Enums should work correctly in I appreciate your patience and the fact you tried our unstable preview and provided valuable feedback and insights with your issue report. I hope the stable release fixes things for you. We also have a brand new Discord server for Amplify related topics. Feel free to hit me up there to talk about your use cases and challenges with the new APIs and docs. https://discord.gg/amplify |
Closing this issue. Feel free to open a new one if you have problems with the stable version of Amplify. |
Let's take the following example:
I would expect this generation to be pretty straight forward, but building this code will generate an error indicating
Person
is not decodable. Checking the generated definition I can see aPerson.swift
,Person+Extensions.swift
and aGender.swift
file without any extension.Fixing this issue is simple, basically just add the extension file manually and type in:
extension Gender: Codable { }
... But I would imagine this is the responsibility of the code generator to put in place.The text was updated successfully, but these errors were encountered: