3.1.1 • Published 9 years ago

rest-schema-table v3.1.1

Weekly downloads
2
License
-
Repository
github
Last release
9 years ago

rest-schema-table

A table of contents for your REST service schema

Example

var RestSchemaTable = require("rest-schema-table");

var table = RestSchemaTable();
table.multiSet('/foo/:bar', {
  'GET': {
    'requestSchema': { ... },
    'responseSchema': { ... }
  }
});

//  {
//      'GET /foo/:bar': {
//          request: { ... },
//          response: { ... }
//      }
//  }
console.log('obj', table.toJSON());

Motivation

SchemaTable is an in memory data structure that defines the interface of any network server.

It currently encodes arbitrarly named operations which have requests and responses.

By convention it's recommended that you encode REST semantics by naming your operations as "{HTTP_METHOD} {HTTP_URL_PATTERN}". i.e. your server has a set of operations that are methods on resources.

The requestSchema and responseSchema are arbitrary.

Installation

npm install rest-schema-table

Tests

npm test

Contributors

  • Raynos

MIT Licenced

3.1.1

9 years ago

3.1.0

9 years ago

3.0.0

9 years ago

2.0.0

9 years ago