Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

OCI and DZone Present: A Grails Quickcast #2: JSON Views

DZone's Guide to

OCI and DZone Present: A Grails Quickcast #2: JSON Views

DZone is proud to partner with Object Computing, Inc. to launch a new series: the Grails Quickcasts, led by Jeff Brown, principal software engineer and Grails practice lead at OCI, and senior member of the Core Grails Team. Wet your whistle in this intro to JSON views!

· Integration Zone
Free Resource

Learn how API management supports better integration in Achieving Enterprise Agility with Microservices and API Management, brought to you in partnership with 3scale

Grails co-founder Jeff Scott Brown continues his deep dives into Grails with another awesome Grails Quickcast, brought to you by DZone in collaboration with OCI. In case you missed part 1, here's a dive into interceptors.

Grails co-founder Jeff Scott Brown continues his dives into Grails with another awesome Quickcast. In a delightful and informative 15 minutes, Brown probes JSON views. Beginning with a Grails 3.1.1 application, created with a standard web profile, Brown added a few custom domain classes. The artist class has albums associated with it, and is annotated with grails.rest.Resource.

The ultimate goal is publishing a REST API under /artists for managing instances of the artist class, and to support the JSON and XML formats.

Brown uses music examples, including Space Oddity by David Bowie (RIP), and Close to the Edge by Yes. Sending a request to /artists gives a list of artists all of whom have albums associated with them. While the app is running in development mode, the JSON files can be altered and the effects of those changes can be seen real-time in the application. For example, switching "ArtistName": "Riverside" to "theArtistName": "Riverside"

This Quickcast assumes basic knowledge of Grails, JSON, and REST APIs. Check out Brown’s neat intro to JSON views below!


Unleash the power of your APIs with future-proof API management - Create your account and start your free trial today, brought to you in partnership with 3scale.

Topics:
integration ,ei ,api ,rest ,json ,xml ,grails

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}