Second level expand in gson

2019-07-25 04:22发布

问题:

I'm using Grails 3.2.2 and org.grails.plugins:views-gradle:1.1.1 and in my section gson I'd like to expand all users and their carnets. I tried:

import com.example.sections.Section

model {
    Section section
}

json g.render(section, [excludes:['archived', 'deleted'], expand:['clients', 'clients.carnets']]){
}

but it only expands clients in result json. how can I do that? btw carnets in Client domain class are transient. Is it possible to add transient variables to result gson? If so - how?