yakworks / gorm-rest-api

Grails restful api helpers to make gorm domains rest api enabled
https://yakworks.github.io/gorm-rest-api/
Apache License 2.0
1 stars 2 forks source link

Integrate with renderer from json-views to generate json #7

Open basejump opened 7 years ago

basejump commented 7 years ago

currently its tied to DAO and uses our PagingData. currently its spins through and creates a copy of the data into another list of maps and then copies it again to the writer when we render/respond with as JSON

customize either a renderer or objectMarshaler or both to deal with the built in Grails PagedResultList, we should be able to pass in the selectFields/showfields/listFields to it somehow.

see the following for refernce http://docs.grails.org/latest/guide/REST.html#renderers https://stackoverflow.com/questions/23940641/render-metadata-for-pagination-from-grails-restfulcontroller-index-search-action https://kylewbanks.com/blog/Customizing-JSON-Grails-Object-Marshalling https://www.slideshare.net/clatimer/building-awesome-apis-in-grails

Source: https://github.com/grails-plugins/grails-plugin-converters/blob/master/src/main/groovy/grails/converters/JSON.java

and see the org.grails.plugins.web.rest.render.json.DefaultJsonRenderer and JsonCollectionRenderer in the Grails source

basejump commented 6 years ago

see the notes here https://github.com/yakworks/gorm-tools/blob/master/docs/idea-bank-notes/overview-json-views.md