Skip to content
 
 

Latest commit

 

History

1,819 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JSONAPI::Resources (Sanger fork)

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.

Documentation

Full documentation can be found at http://jsonapi-resources.com, including the v0.10 alpha Guide specific to this version.

Demo App

We have a simple demo app, called Peeps, available to show how JR is used.

Client Libraries

JSON:API maintains a (non-verified) listing of client libraries which should be compatible with JSON:API compliant server implementations such as JR.

Installation

Add JR to your application's Gemfile:

gem 'jsonapi-resources'

And then execute:

bundle

Or install it yourself as:

gem install jsonapi-resources

For further usage see the v0.10 alpha Guide

Sanger-specific release process

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

For version 1 series

  • 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 install to ensure the gemspec is up to date.
  • Execute gem build jsonapi-resources.gemspec which builds sanger-jsonapi-resources-0.1.x.gem in this case.
  • Execute gem push sanger-jsonapi-resources-0.1.x.gem which publishes the gem.

For version 2 series

  • 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 install to ensure the gemspec is up to date.
  • Execute gem build jsonapi-resources.gemspec which builds sanger-jsonapi-resources-0.2.x.gem in this case.
  • Execute gem push sanger-jsonapi-resources-0.2.x.gem which publishes the gem.

Publication

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.

Contributing

See CONTRIBUTING.md for details.

License

Copyright 2014-2021 Cerebris Corporation. MIT License (see LICENSE for details).

About

A resource-focused Rails library for developing JSON:API compliant servers.

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages