You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am currently developing an application with a dependency on Contentful for different subjects such as getting images catalogs, items collections, and in general all of the information content from the API using the contentful.swift SDK.
Our current setup on Contenful is relying on a single Content Type, called "CustomGroup", to do exactly that: Grouping different content Types according to the required information. There is one instance of "CustomGroup" called "Landing Objects" with an array of Entries of a type (Content Type: TypeA), and there is another instance called "Home Objects" with a different array of Entries (Content Type: TypeB).
If we request both objects from the API (we're using the Object ID directly for each instance and is an static value on code) we get an error:
2021-06-23 17:23:41.382070-0500 MyApp[5992:236424] [Contentful] Error: A response for the QueryOn<LandingObjects> did return successfully, but a serious error occurred when decoding the array of LandingObjects.
Double check that you are passing LandingObjects.self, and references to all other EntryDecodable classes into the Client initializer.
So the first Content class we register on the Contentful Client initializer is ignored as if it was never registered. As I could figure out the Contentful Client has a key-value mapping of a Content Type corresponding to a class, so as a temporary workaround we're initializing two separate Contentful Client objects each one of them for an object. Anyway this might not scale well on the longterm since we're planning to use more and more objects this way: Grouping them inside our "container" Content Type and get them whenever they are needed.
Is there anyway there could be more than a single class pointing to a Content Type inside this SDK? Are there any other possible solutions to scale this? Thanks in advance for any information or suggestions!
The text was updated successfully, but these errors were encountered:
Hello!
I am currently developing an application with a dependency on Contentful for different subjects such as getting images catalogs, items collections, and in general all of the information content from the API using the contentful.swift SDK.
Our current setup on Contenful is relying on a single Content Type, called "CustomGroup", to do exactly that: Grouping different content Types according to the required information. There is one instance of "CustomGroup" called "Landing Objects" with an array of Entries of a type (Content Type: TypeA), and there is another instance called "Home Objects" with a different array of Entries (Content Type: TypeB).
If we perform the Client initialize process and register the four classes we get an error as if one of the classes did not get registered.
If we request both objects from the API (we're using the Object ID directly for each instance and is an static value on code) we get an error:
So the first Content class we register on the Contentful Client initializer is ignored as if it was never registered. As I could figure out the Contentful Client has a key-value mapping of a Content Type corresponding to a class, so as a temporary workaround we're initializing two separate Contentful Client objects each one of them for an object. Anyway this might not scale well on the longterm since we're planning to use more and more objects this way: Grouping them inside our "container" Content Type and get them whenever they are needed.
Is there anyway there could be more than a single class pointing to a Content Type inside this SDK? Are there any other possible solutions to scale this? Thanks in advance for any information or suggestions!
The text was updated successfully, but these errors were encountered: