0.5.0 • Published 4 years ago

fury-adapter-remote v0.5.0

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

Fury Remote Adapter

NPM version License

This adapter provides support for parsing, validation and serialization via the API Elements Web Service in Fury.

The remote adapter can be configured to work with any API service compatible with API Blueprint API. By default the API Elements Web Service is used.

const defaultOptions = {
  // the default value, but consumers should be able to override to use their own deployment
  url: 'https://api.apielements.org',

  parseEndpoint: '/parser',
  validateEndpoint: '/validate',
  serializeEndpoint: '/composer',

  mediaTypes: {
    // the collection of "parse", media types we want this
    // instance of the adapter to handle.
    // NOTE, this allows you to use the API for one media type but
    // another local adapter for another.
    parse: [
      'text/vnd.apiblueprint',
      'application/swagger+json',
      'application/swagger+yaml',
      'application/vnd.oai.openapi',
      'application/vnd.oai.openapi+json',
    ],

    validate: [
      'text/vnd.apiblueprint',
      'application/swagger+json',
      'application/swagger+yaml',
      'application/vnd.oai.openapi',
      'application/vnd.oai.openapi+json',
    ],

    // the collection of "serialize", media types we want this
    // instance of the adapter to handle.
    serialize: [
      'text/vnd.apiblueprint',
    ],
  }
};

Install

$ npm install fury-adapter-remote

Usage

const { Fury } = require('fury');
const FuryRemoteAdapter = require('fury-adapter-remote');

const fury = new Fury();
fury.use(new FuryRemoteAdapter(options);

fury.validate(...);
fury.parse(...);
fury.serialise(...);
0.5.0

4 years ago

0.4.1

4 years ago

0.4.0

4 years ago

0.3.0

5 years ago

0.2.0

5 years ago

0.1.0

5 years ago