api-blueprint-to-json
Converts API Blueprints (Apiary) to JSON
Last updated 5 years ago by aselbie .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install api-blueprint-to-json 
SYNC missed versions from official npm registry.

API Blueprint to JSON

Pulls down API Blueprints from Apiary, parses them, and saves them locally as JSON.

Install

> npm install api-blueprint-to-json

Use

The this model exposes a single method process which accepts an array of resource objects, defined as follows:

  • url (required) - [string]: A url for an .apib file. These are available from Apiary as https://api.apiary.io/blueprint/get/<api-name>, which you can find in the subdomain part from http://docs.<api-name>.apiary.io/.
  • token (required) - [string]: A valid api token with access to the above resource. You can view/generate these from https://login.apiary.io/tokens.
  • savePath (required) - [string]: An absolute local path where you would like to save the converted JSON.

Example

var resources = [
  {
    url: 'https://api.apiary.io/blueprint/get/myapi',
    token: 'someapitoken',
    savePath: __dirname + '/schemas/myapi.json'
  }
];

function callback(err) {
  if (err) {
    console.log(err);
  } else {
    console.log('All done');
  }
}

apiBlueprintToJson.process(resources, callback);

Current Tags

  • 0.0.0                                ...           latest (5 years ago)

1 Versions

  • 0.0.0                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (4)
Dev Dependencies (0)
None
Dependents (1)

Copyright 2014 - 2016 © taobao.org |