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

EntryModellable doesn't properly synthesize lists. #132

Closed
bennichols opened this issue Sep 29, 2017 · 1 comment · Fixed by #138
Closed

EntryModellable doesn't properly synthesize lists. #132

bennichols opened this issue Sep 29, 2017 · 1 comment · Fixed by #138

Comments

@bennichols
Copy link
Contributor

  • contentful.swift version number: 0.9.3
  • Xcode version number: 9.0
  • Target operating system(s) and version number(s)
    - [x ] iOS:
    - [ ] tvOS:
    - [ ] watchOS:
    - [ ] macOS:
  • Package manager:
    - [x ] Carthage
    - [ ] Cocoapods

When I have a list of objects or assets, they don't synthesize to the associated objects in my models. I believe this is due to the way the relationshipNames function is determining what is a valid relationship and not taking arrays into account. I tried to fix it there, but it didn't seem to work. Maybe there is more going on in the cache in order to get the models into the arrays?

@loudmouth
Copy link
Contributor

Hey @bennichols thanks for you patience in me getting to this. In the past week, I have been working on a refactor of the mechanism to decode user-defined types. In the currently released version of contentful.swift, the SDK actually serializes in 2 steps: first to Entrys and Assets and then to user-defined types. This is obviously inefficient. My refactor will cut out the first step to directly serialize user-defined types from JSON.

The other exciting improvement is that instead of implementing two methods like in EntryModellable the new system directly leverages the Decodable protocol that is standard lib in Swift 4 with a special method to serialize links. I will make sure to test serializing links that point to arrays and ensure that this is working with this set of upcoming changes.

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 a pull request may close this issue.

2 participants