How to register HAL renderer for all domain classes
Thanks to this little code snippet below you can register HAL renderers for all your domain classes:
grailsApplication.domainClasses*.clazz.each { Class domain ->
"hal${domain.simpleName}Renderer"(HalJsonRenderer, domain)
"hal${domain.simpleName}CollectionRenderer"(HalJsonCollectionRenderer, domain)
}
Read more: http://docs.grails.org/latest/guide/webServices.html#hypermedia
Ran on Grails 3.2.4
Written on February 3, 2017