contentful.java icon indicating copy to clipboard operation
contentful.java copied to clipboard

Sync API: Result of sync does not provide transformation support

Open drezzzik opened this issue 5 years ago • 0 comments

Hello,

After a sync action, there is no possibility to transform downloaded entries to local data/POJO classes annotated properly.

Such action is possible for fetch like actions client.observeAndTransform(LocalDataClass::class.java).

Workaround is to slightly change com.contentful.java.cda.TransformQuery class (btw it is in Beta for some time), add it to own project and then transform entries to local classes like this:

val transformQuery = TransformQuery(LocalDataClass::class.java, client)

then to call transform

transformQuery.transform(synchronizedSpace.entries().value) as LocalDataClass

I hope this project will become active, again.

drezzzik avatar Mar 19 '20 19:03 drezzzik