0.1.2 • Published 9 years ago

sails-generate-raml-scaffolding v0.1.2

Weekly downloads
3
License
MIT
Repository
github
Last release
9 years ago

sails-generate-raml-scaffolding

A tool for generating Sails models from RESTful API Modeling Language specification.

This is not intended to produce a working implementation of an API, or even working code in most cases, instead the result is simply meant to serve as a quickstart basis for a new project.

Features

  • creates a model for each RAML resource
  • maps formParameters from post actions to model attributes
  • if Sails blueprints are configured to pluralize will rename models accordingly
  • maps several RAML attribute properties to one recognized by Waterline
  • parses RAML resource description field for annotations prefixed by @wl-, and inserts them in the model attribute definition (see here for supported properties), rest of the description is added as javascript comment

Planned features

  • generating placeholder code for controllers and policies

Known issues

  • identifying resources is naive and is likely to contain issues, e.g. collisions
  • practically no validation is done to verify RAML description fields or the code injected in to the model files
  • overwrites attributes of existing models if one with same name is parsed from RAML

In other words, be cautious, do not run in a project with uncommitted code of any value.

Installation

$ npm install sails-generate-raml-scaffolding

Usage

On the command line
$ sails generate raml-scaffolding ~/api.raml

Development

To get started quickly and see this generator in action, ...

Also see CONTRIBUTING.md for more information on overriding/enhancing existing generators.

Questions?

See FAQ.md.

More Resources

License

MIT © 2014 stt

As for Sails? It's free and open-source under the MIT License.

image_squidhome@2x.png