Closed markst closed 3 months ago
Not sure if I get the issue right, please correct me if I am wrong.
From what I understood you'd like to resolve Author
model to a more generic Entry
type. If yes, what is the purpose of that and why can't/won't you specify the Author
type in the custom content types? From my perspective, if you don't want/need to use the Author
custom type you could remove that property from the Feature
class.
At the moment the library cannot resolve that type because heterogeneous array is designed to work with custom types that conforms to EntryDecodable
. The Entry
is completely different type. When you resolve those types to see the protocols they conform to you can see they differ a bit.
Author: FlatResource, EndpointAccessible, Resource, FieldKeysQueryable, Decodable
Entry: FlatResource, EndpointAccessible, Resource, ResourceQueryable, Codable
Could you elaborate more on what would you like to achieve with the property being specified as Entry
?
Thanks!
Thanks @tomkowz. That's correct we wish to combine the two types.
In most cases we can define the EntryDecodable
models for each & works fine. However since content types can be added to the backend after app launch, it was an effort to allow future modifications to be supported.
I don't think we'll be able to change that behaviour at the current state of the library.
Closing of inactivity
5.2.0
11.6
My content features mostly custom types with the exception of some linked Entry's such as:
decodeHeterogeneousEntries
will throw away content types which aren't passed as content type classes: https://github.com/contentful/contentful.swift/blob/master/Sources/Contentful/ArrayResponse.swift#L327Since resource can be decoded:
Why then is it not possible to use generic Entry's as relationship links?