No commit activity in last 3 years
No release in over 3 years
There's a lot of open issues
Provides a Formatter for the Grape API DSL to emit objects serialized with jsonapi-resources.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 5.0.0
>= 0
>= 0

Runtime

 Project Readme

Grape::JSONAPIResources

Use jsonapi-resources with Grape!

Installation

Add the grape and grape-jsonapi-resources gems to Gemfile.

gem 'grape'
gem 'grape-jsonapi-resources'

Usage

Require grape-jsonapi-resources

Tell your API to use Grape::Formatter::JSONAPIResources

class API < Grape::API
  format :json
  formatter :json, Grape::Formatter::JSONAPIResources
end

Use render to specify JSONAPI options

get "/" do
  user = User.find("123")
  render user, include: ["account"], context: { something: :important }
end

Credit

Code adapted from grape-active_model_serializers