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…
you can use https://www.coolutils.com/XMLViewer It supports not only XML but also JSON and FO files. You can expand or collapse nodes in your XML files for better view. You can convert XML to JSON. The app can print your XML, JSON and FO files or produce full reports about them. i hope you can get benefit from that and besides that you can see other converters also according to your need.
All the best.