Second level expand in gson

纵饮孤独 提交于 2020-01-15 09:23:05

问题


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?

来源:https://stackoverflow.com/questions/40441814/second-level-expand-in-gson

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!