rsdl-js
v0.4.0
Published
RSDL-to-CSDL Compiler
Downloads
10
Keywords
Readme
RSDL-to-CSDL Compiler
RAPID Schema Definition Language (RSDL) is a language to define Web APIs.
RSDL is based on the RAPID Profile of the OData specification. RAPID provides an easy way to envision, create, and consume a Web API that is compatible with the OData Standard and can evolve over time to support more advanced scenarios.
Installation
Clone or download this repository, go to the rsdl-js
folder and type
npm install
To install globally type
npm install -g
Usage
Assuming you installed the package globally and your RSDL file is MyModel.rsdl
, then
rsdl2csdl -p myModel.rsdl
will create MyModel.json
next to it.
Just type
rsdl2csdl -h
to get usage hints
Usage: rsdl2csdl <options> <source files>
Options:
-h, --help show this info
-p, --pretty pretty-print JSON result
If you installed the script locally, start it via
node lib/cli.js ...
Development Setup
Install
- Java
- Node.js
- VS Code
- ANTLR4 grammar syntax support (workspace recommendation)
Done
- [x] create grammar
- [x] create listener that produces CSDL
- [x] create CLI
- [x] use test files from ../rapid-cli/rapid.rdm.transformation.tests/data
- [x] inheritance
- [x] annotations
- [x] flags enumerations
- [x] create error listener for syntactically incorrect "files"
- [x] log errors from CLI
- [x] type definitions
- [x] doc comments
- [x] migrate to ANTLR 4.9.2 and switch from CommonJS modules to ES modules
TODO
- [ ] Model validation
- [ ] Option
-a
for compiling all files in a folder? - [ ] Option
-r
for recursive compilation? - [ ] Update to ANTLR 4.9.x