• This repository has been archived on 13/Feb/2022
  • Stars
    star
    138
  • Rank 264,508 (Top 6 %)
  • Language RAML
  • License
    Other
  • Created about 9 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

(deprecated)

DEPRECATION NOTICE: please note that this parser is now deprecated, please use webapi-parser instead.

โ€”-

RAML 1.0 JS Parser

Build Status Greenkeeper badge

See http://raml.org for more information about RAML.

This parser supports both RAML 0.8 and 1.0.

Quick start

Install the parser: npm install raml-1-parser

Create new file test.js with the following code:

var raml = require("raml-1-parser");
var apiJSON = raml.load(ramlFileName);
console.log(JSON.stringify(apiJSON, null, 2));

where ramlFileName is a path to RAML file.

Run the test: node ./test.js

Installation

npm install raml-1-parser

node node_modules/raml-1-parser/test/test01.js  //synchronously loads XKCD API from local file system and prints its JSON representation
node node_modules/raml-1-parser/test/testAsync01.js  //asynchronously loads XKCD API from local file system and prints its JSON representation
node node_modules/raml-1-parser/test/test02.js  //synchronously loads XKCD API from github and prints its JSON representation
node node_modules/raml-1-parser/test/testAsync02.js  //asynchronously loads XKCD API from github and prints its JSON representation


Usage

  • For parser usage example refer to node_modules/raml-1-parser/test/test01.js
  • For asynchrounous usage example refer to node_modules/raml-1-parser/test/testAsync01.js

Parser documentation: https://raml-org.github.io/raml-js-parser-2/

Parser JSON output schema: https://github.com/raml-org/raml-js-parser-2/blob/master/tckJsonSchema/tckJsonSchema.json

Getting started guide: https://github.com/raml-org/raml-js-parser-2/blob/master/documentation/GettingStarted.md

High-level usage example: https://github.com/raml-org/raml-js-parser-2/blob/master/examples/highlevel-AST-usage/tutorial.md

Validation plugins usage example: https://github.com/raml-org/raml-js-parser-2/blob/master/examples/validationPlugins

Creating standalone browser package

Clone repository: git clone https://github.com/raml-org/raml-js-parser-2.git

Install modules: npm install

Build : npm run build

Generate browser package: npm run generateBrowserVersion, this will generate the package in browserVersion folder.

To generate debug-friendly browser package: npm run generateBrowserVersionDev

Setting up parser development environment

Clone repositories:

  • git clone https://github.com/mulesoft-labs/yaml-ast-parser.git
  • git clone https://github.com/mulesoft-labs/ts-model.git
  • git clone https://github.com/mulesoft-labs/ts-structure-parser.git
  • git clone https://github.com/raml-org/raml-typesystem.git
  • git clone https://github.com/raml-org/raml-definition-system.git
  • git clone https://github.com/raml-org/raml-js-parser-2.git

For each repository, preserving the order:

  • Install modules: npm install
  • Set up npm link: npm link

For each repository, preserving the order:

  • Open dependencies: cd node_modules
  • For each module <module_name> in node_modules belonging to the list above: rm -rf <module_name>
  • For each module <module_name> in node_modules belonging to the list above: npm link <module_name>

For each repository, preserving the order:

  • Build : npm run build

How to test: gulp test

Launching TCK tests

Execute npm run tck in the commend line. The script clones the master branch of the TCK repository to the TCK subfolder of the project and executes all the tests. The report file is TCK/report.json.

Contributing

If you are interested in contributing some code to this project, thanks! Please first read and accept the Contributors Agreement.

To discuss this project, please use its github issues or the RAML forum.

More Repositories

1

raml-spec

RAML Specification
3,867
star
2

raml-php-parser

Community-maintained RAML parser for php
PHP
200
star
3

raml-js-parser

(deprecated) A RAML parser based on PyYAML written in CoffeScript and available for use as NodeJs module or in-browser.
JavaScript
195
star
4

raml-examples

This repository contains valid RAML 1.0 examples. These examples are not only part of the spec, but also represent RAML features in different scenarios.
RAML
191
star
5

raml-java-parser

(deprecated) A RAML parser based on SnakeYAML written in Java
Java
174
star
6

webapi-parser

API Spec parser based on AMF. Currently supports RAML 0.8, RAML 1.0, OAS 2.0 and OAS 3.0(beta).
Scala
68
star
7

ramldt2jsonschema

CLI & Library to convert a RAML 1.0 data type to a JSON Schema, and back
JavaScript
59
star
8

api-modeling-framework

DEPRECATED - This project has been moved
Clojure
27
star
9

raml-dotnet-parser

Community-maintained .NET parser for RAML
C#
22
star
10

raml-java-parser-2

JavaScript
19
star
11

raml-dotnet-parser-2

RAML
18
star
12

raml-typesystem

(deprecated) Typescript implementation of RAML type system
TypeScript
15
star
13

raml-org

Project website
SCSS
14
star
14

raml-cli

A handy command-line tool for RAML enthusiasts.
TypeScript
11
star
15

raml-tutorial-08

DEPRECATED - This repository contains the content for the RAML tutorial on raml.org.
9
star
16

playground

RAML Playground (WIP)
TypeScript
8
star
17

raml-tck

Test Compatibility Kit for RAML 1.0
RAML
8
star
18

raml-by-example

Series of examples leveraging tools of the RAML community
RAML
6
star
19

datatype-expansion

(deprecated) Utility tool to expand a given RAML type and create a canonical form
JavaScript
6
star
20

raml-definition-system

(deprecated) Definition System for RAML 0.8/1.0
TypeScript
3
star
21

raml-annotations

This repository contains a number of annotations that we, as a community, agreed on and share for others to use.
RAML
2
star
22

raml-tck-runner

Run several RAML parsers against RAML TCK
JavaScript
1
star