JSONAPI::Resources, or "JR", provides a framework for developing an API server that complies with the
JSON:API specification.
Like JSON:API itself, JR's design is focused on the resources served by an API. JR needs little more than a definition of your resources, including their attributes and relationships, to make your server compliant with JSON API.
JR is designed to work with Rails 5.1+, and provides custom routes, controllers, and serializers. JR's resources may be backed by ActiveRecord models or by custom objects.
Full documentation can be found at http://jsonapi-resources.com, including the v0.10 alpha Guide specific to this version.
We have a simple demo app, called Peeps, available to show how JR is used.
JSON:API maintains a (non-verified) listing of client libraries which should be compatible with JSON:API compliant server implementations such as JR.
Add JR to your application's Gemfile:
gem 'jsonapi-resources'
And then execute:
bundleOr install it yourself as:
gem install jsonapi-resourcesFor further usage see the v0.10 alpha Guide
There are two versions of the gem which we use for production. The version 1 series has unique customisations and is used by Sequencescape. The version 2 series is a more generic version which is used by Traction.
The aim is to support the 3 most recent Rails versions for each series to allow for seamless upgrades between releases.
Check which versions we have published at https://rubygems.org/gems/sanger-jsonapi-resources
- Create a branch from develop, apply fixes.
- Change version number in
lib/jsonapi/resources/version.rb. This file is read by the gemspec during publication. - Test Sequencescape with the gem from the branch.
- Merge the branch into develop.
- Create a release from the develop branch with the new version number as the tag. Set Release label to None.
- Checkout the newly-created tag on develop.
- Execute
bundle installto ensure the gemspec is up to date. - Execute
gem build jsonapi-resources.gemspecwhich builds sanger-jsonapi-resources-0.1.x.gem in this case. - Execute
gem push sanger-jsonapi-resources-0.1.x.gemwhich publishes the gem.
- Create a branch from master, apply fixes.
- Change version number in
lib/jsonapi/resources/version.rb. This file is read by the gemspec during publication. - Test Traction with the gem from the branch.
- Merge the branch into master.
- Create a release from the master branch with the new version number as the tag. Set Release label to Latest.
- Checkout the newly-created tag on master.
- Execute
bundle installto ensure the gemspec is up to date. - Execute
gem build jsonapi-resources.gemspecwhich builds sanger-jsonapi-resources-0.2.x.gem in this case. - Execute
gem push sanger-jsonapi-resources-0.2.x.gemwhich publishes the gem.
You will be notified by email for each. You will also receive one email for API key setup. The first push will ask email and password for the account, which are in KeePass (search for "gem").
Note
The email and password for gem publication is a recent addition to the credentials database. Pull latest changes in the credentials repo.
See CONTRIBUTING.md for details.
Copyright 2014-2021 Cerebris Corporation. MIT License (see LICENSE for details).