🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

raml2code

Package Overview
Dependencies
Maintainers
1
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

raml2code

Raml spec to code

npmnpm
Version
0.0.11
Version published
Weekly downloads
47
104.35%
Maintainers
1
Weekly downloads
 
Created
Source

Raml to code generator

  • This module generate code from a RAML definition
  • It uses Handlebars templates

Defining a Generator

A generator is a simple object with the following properties:

  • Required properties:
    • template -> Handlebars template.
    • parser(data) -> Function it receives RAML parsed data, returns parsed data. [{ name: "test.test", model: {title:data.title + " finos"}}]
  • Optional properties:
    • helpers -> Handlebars helpers.
    • partials -> Handlebars partials.

generators included and tested

* raml to Groovy pojo

Gulp-plugin

var gulp = require('gulp');
var raml2code = require('raml2code');
var genDTO = require("raml2code/lib/generators/groovy/raml2DTO.js");

gulp.task("test", function(){
  gulp.src('./test/cats.raml')
    .pipe(raml2code({generator: genDTO, extra: {package:'com.gex'}}))
    .pipe(gulp.dest('build'));
});

Keywords

RAML

FAQs

Package last updated on 19 Nov 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts