ramldt2jsonschema
Quick Start (js2dt)
Published in
1 min readJun 8, 2018
ramldt2jsonschema is both a CLI tool and a Library that can convert a RAML DataType to a JSON Schema, and vice-versa.
Let’s start with a JSON Schema, we’ll use one from json-schema.org:
$ curl http://json-schema.org/example/calendar.json >calendar.json
Download ramldt2jsonschema
and js-yaml
for manipulating YAML:
$ npm install --save ramldt2jsonschema js-yaml
Now let’s write a small node app that outputs two RAML files out of that JSON Schema:
and using the CLI can produce a similar output:
$ npm install -g ramldt2jsonschema
(...)$ js2dt calendar.json >calendar_datatype.raml