Skip to content
Colin Harrington edited this page Sep 13, 2016 · 9 revisions

JSON API Notes

See http://jsonapi.org.

The Very Basics

JSONAPI Basics

Rendering JSONAPI

Rendering JSONAPI formatted items

Handling JSONAPI

Handling JSONAPI formatted data

Errors

Error handling implemented via http://jsonapi.org/format/#errors

{
    "errors":[
        {
            "code":"blank",
            "detail":"Property [title] of class [class grails.example.Article] cannot be blank",
            "source":{
                "object":"grails.example.Article",
                "field":"title",
                "rejectedValue":"",
                "bindingError":false
            }
        },
        {
            "code":"nullable",
            "detail":"Property [author] of class [class grails.example.Article] cannot be null",
            "source":{
                "object":"grails.example.Article",
                "field":"author",
                "rejectedValue":null,
                "bindingError":false
            }
        }
    ]
}
Clone this wiki locally