1

In GORM-standalone I have a simple domain class like:

@JsonIgnore( [ 'owner' ] )
class Person implements MongoEntity<Person>{
  String id
  String name
  String owner

  Long version // attempt to hack
}

When an instance of Person is converted to JSON, the version is not output to resulting JSON string.

Any way to get it done automatically?

P.S. Even adding version prop expicitly does NOT add it to resulting JSON...

injecteer
  • 20,038
  • 4
  • 45
  • 89

1 Answers1

0

You can set the configuration property in grails-app/conf/Config.groovy

grails.converters.domain.include.version = true

or in grails-app/conf/application.yml

grails:
  converters:
    domain:
      include:
        version: true
Vahe92
  • 51
  • 5