raml-to-typescript
RAML to TypeScript Definition Files Converter. Uses raml2obj
and json-schema-to-typescript
.
See the changelog.
install
locally:
npm install --save raml-to-typescript
globally:
npm install -g raml-to-typescript
usage
as a CLI tool:
raml2ts -i example-contract/geo.raml -o example-dts
as a library:
const raml2ts = ;raml2ts // orraml2ts
example
RAML file:
#%RAML 1.0title: Example Service /geo: /countries: description: | Collection of all countries. get: description: Fetch collection of countries responses: 200: body: application/json: type: !include countries.schema.json
related countries.schema.json
schema file:
will produce following output:
;
limitations
Currently, only JSON Schema files are supported (RAML-defined types are not yet supported).
todos
- include request schemas as well as response schemas