grails - gson view unable to resolve domain class -


i'm using grails 3.3.0 rest api , gson views. have following setup...

domain class

package foo  @resource(uri="/api/bars", readonly = false, formats = ['json', 'xml']) class bar{     string firstname     string lastname } 

controller:

package foo  class barcontroller extends restfulcontroller<building>{      def show(){         respond bar.get(params.id)     } } 

_bar.gson:

import foo.bar;  model {     bar bar }  json {     name bar.firstname } 

_show.gson:

import foo.bar;  model {     bar bar }  json g.render(template:"bar", model:[bar:bar]) 

directory layout:

/grails-app/views/ -----------------bar/ --------------------_bar.gson --------------------_show.gson 

this fails during build, test, compile , war following error:

execution failed task ':compilegsonviews'. foo_bar_show_gson: 3: unable resolve class foo.bar 

i followed documentation cannot around this. please help!

after looking through github issues seems caused rest profile , running on windows machine. if start new project using web profile works fine.


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -