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.
- 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
- generating placeholder code for controllers and policies
- 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.
$ npm install sails-generate-raml-scaffolding
$ sails generate raml-scaffolding ~/api.raml
To get started quickly and see this generator in action, ...
Also see CONTRIBUTING.md
for more information on overriding/enhancing existing generators.
See FAQ.md
.
- Stackoverflow
- #sailsjs on Freenode (IRC channel)
- Professional/enterprise
- Tutorials
As for Sails? It's free and open-source under the MIT License.