-
Notifications
You must be signed in to change notification settings - Fork 43
JSONAPI_Rendering
DeweertD edited this page Nov 13, 2024
·
3 revisions
#Rendering the JSON:
##Ability to enable/disable the JSON API Object
##Configurable:
- Sensible defaults matching the spec
- per-app config mechanism driven via standard grails config
- per-view dynamic configuration like:
json jsonapi.render([data: widget, exposeJsonApiObject: true])
##Error Handling: json jsonapi.render(widget) http://jsonapi.org/format/#errors
-
Automatic error handling with Validation Errors
json jsonapi.render(widget)
-
Manual Error handling:
model {
Errors errors
}
json jsonapi.render([errors: errors])
http://jsonapi.org/format/#document-compound-documents Something similar to:
model {
Widget widget
Producer widgetProducer
List<Market> markets
}
json jsonapi.render(widget, [included: [widgetProducer, markets]])