Contentful logo

Contentful Community

Unwrap nested references

I am attempting to unwrap content that contains a list of categories, which contains a list of topics. The categories are unwrapped correctly, but the topics are empty. I have verified the field ids match and the data is present in the raw json. Is there another step that must be performed to transform the inner nested elements?

data class ContentfulTroubleshooter (
    var categories: List<ContentfulCategory> = emptyList()

data class ContentfulCategory (
    var id: Double? = 0.0,
    var name: String = "",
    var topics: List<ContentfulTopic> = emptyList()

data class ContentfulTopic (
    @ContentfulField(value = "topicId")
    var id: Double? = 0.0,
    var name: String = ""