Not sure regarding running as non-root. However I want to warn you about latest version 0.3.1 of ramldt2jsonschema. It is broken! Latest version doesn’t handles types. Simply can’t find types in project. That’s why I rolled back to previous 0.3.0.
Thanks for the heads up regarding version 0.3.1. Since I’m aiming to get the basic ramldt2jsonschema package running under a non-root ID, 0.3.1 is good enough for now.
dt2js.js module and adding these lines to the bottom of the script:
var ramlFile = "simple.raml"
console.log('Reading ' + ramlFile);
var ramlData = fs.readFileSync(ramlFile).toString()
var typeName = "User"
dt2js(ramlData, typeName, writeToConsole)
Github has a site named Simple RAML with an example of a very basic API definition which I put into a local file named
simple.raml and obtained the following output:
which looks pretty good for starters…