I have been developing some APIs with Grails lately as opposed to traditional web apps. I’m going to be giving a talk at GR8CONF US this summer about this topic too.

So, I thought it would be fun to create a screencast with some tips for getting started building APIs with Grails! The screencast covers content types, API URL mappings, customizing JSON output with marshallers and even Rob Fletcher’s GSON plugin. I unfortunately recorded this screencast on a MacBookPro as opposed to an iMac and there’s some background noise because of the MBP fan. First and last time I use a MBP for a screencast, ha! Hopefully it doesn’t distract from the content too much. Thanks for watching!

The sample app built in the screencast is located on GitHub.

10 comments so far

Add Your Comment
  1. Bobby, what are your thoughts on the Grails JAXRS plugin (http://grails.org/plugin/jaxrs). I started my API platform a while back using the strategies outlined here and then switched to JAXRS as it made things simpler while providing flexibility still. I’m curious if you ever evaluated that and if so what your opinions of it were.

    Great screencast btw. Background noise was no big deal for me. Worked great.

  2. Hi Bobby,

    Do you recommend gson plugin instead of the default grails json converter?
    Is it production-stable?

    Great screencast :-)


  3. @Nicholas Thanks for watching! Yup, I’ve used the JAX-RS plugin in the past and it worked great too! The domain object providers in the JAX-RS plugin is certainly very similar to the marshaller approach I used here for customizing the output. It’s great to have options!

  4. @Iván Thanks for watching! Yes, I think the GSON plugin is better than the default converter right now, but this might change with the upcoming 2.3 release. I have not personally used the GSON plugin in a production application yet, but I have used the GSON Java library directly in apps in the past and it’s performed great! A very active open-source project used by many and certainly is production ready! Hope that helps!

  5. hi bobby,

    are you going to do another screencast about how to implement the others methods how to save, delete, and update a book?


  6. hi again Bobby, i was wondering if is there a way to exclude properties from a domain class like you did in the first example using GSON plugin? in your talk in GR8CONF US are you going to include how to secure an api? thats could be very helpful for many of us. thanks

  7. […] Building APIs with Grails […]

  8. […] Building APIs with Grails by Bobby Warner […]