sails-hook-jsonapi

0.0.4 • Public • Published

sails-hook-jsonapi

Build Status Dependency Status devDependency Status

This is a Sails JS hook for creating an API which conforms to JSON API specifications per jsonapi.org.

Note: This project is still in development, and is not yet fully functional.

Installation

npm install sails-hook-jsonapi

Usage

requires at least sails >= 0.11

Just lift your app as normal, and your api responses will be formatted in accordance with jsonapi.org.

Options

Create a jsonapi.js file inside the config/ directory of your app, and you can set the following options:

Option Default Description
compoundDoc true When set to 'true' (default), response will be a compound document including related resources.

Known Limitations

This is unfinished. So far, the following are not yet implemented:

  • Fetching resources
    • Included request parameter handling
    • Links
      • Top-level "self" links
      • Top-level "related" links
      • Resource-level "self" links
      • Related resource relationship links
      • Metadata links
    • Pagination
    • Formatting
      • Non-dasherized attributes
    • Sparse fieldsets
  • Fetching relationships
  • Updating relationships
  • Deleting relationships

There may be more. Please submit issue reports. Or better yet, pull requests.

Package Sidebar

Install

npm i sails-hook-jsonapi

Weekly Downloads

0

Version

0.0.4

License

MIT

Last publish

Collaborators

  • ianvs