-
Notifications
You must be signed in to change notification settings - Fork 43
JSONAPI
Colin Harrington edited this page Sep 20, 2016
·
9 revisions
See http://jsonapi.org.
Rendering JSONAPI formatted items
Handling JSONAPI formatted data
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
}
}
]
}
#Links Support for top-level links including related associations
{
"data":{
"type":"article",
"id":"1",
"attributes":{
"title":"Save the Gumbo",
"version":0
},
"relationships":{
"author":{
"data":{
"type":"person",
"id":"1"
}
}
}
},
"links":{
"self":"/articles?id=1",
"related":{
"href":"/people?id=1"
}
}
}