grails-views icon indicating copy to clipboard operation
grails-views copied to clipboard

Provide a way to include transient properties when rendering json with the JSON API.

Open pawlorj opened this issue 7 years ago • 1 comments

Currently, only persistent properties are rendered.

pawlorj avatar Aug 08 '17 14:08 pawlorj

Just as a use case, this issue is the result of conflation between the concept of database persistence vs. object persistence (which seems to happen a lot in spots).

I have a model which has some data stored persistently in the database, and other data which is loaded from elsewhere (all done in a service). In GORM-speak, the non-database properties are transient (ie: static transient = ['propertyName']) however they are not object transient (ie: transient PropertyType propertyName) and they do need to be serialized (and thus output when JSONifying).

U47 avatar Oct 20 '17 17:10 U47