A Restify formatter for JSON API compliant responses using the `application/vnd.api+json` content type. Version 2.0.0 supports Restify 5.x. It is a lightweight plugin that integrates directly into Restify's formatter chain. The package currently handles basic JSON API serialization but lacks support for links, meta, included resources, and the jsonapi section (roadmap). It is a niche tool for Restify users who need strict JSON API compliance, with limited maintenance activity.
npm install restify-formatter-jsonapiNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Sets up a basic Restify server with JSON API formatter, including accept parser and media type registration, then serves a sample resource.
Check your Restify version. If using Restify 6+, find an alternative or fork.
Manually construct the full JSON API envelope in your route handlers, or use a more complete library like jsonapi-store-relationaldb.
Push the media type to server.acceptable and ensure acceptParser is registered.
Use const formatter = require('restify-formatter-jsonapi'); and then assign server.formatters['application/vnd.api+json'] = formatter;Add server.acceptable.push('application/vnd.api+json'); after registering acceptParser.Downgrade to restify@5.x or use a different formatter library that supports Restify 6+.