Skip to content
This repository has been archived by the owner on Jan 20, 2024. It is now read-only.

A RAML parser based on SnakeYAML written in Java

Notifications You must be signed in to change notification settings

mulesoft-labs/raml-java-parser

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RAML Java Parser

![Gitter](https://badges.gitter.im/Join Chat.svg)

This is a Java parser for RAML version 0.8 as defined in the 0.8 RAML specification The parser depends on SnakeYaml, a Java YAML parser.

A newer version is now available as a beta. It supports RAML 1.0 as well as RAML 0.8.

Build

JAR file without dependencies

mvn clean package

JAR file with dependencies

mvn clean package -P jar-with-dependencies

Run standalone validator

java -jar raml-parser-{version}.jar raml-file ...

Usage

Validation

The validator allows you to check whether a RAML resource is valid or not, and in the case is not valid it provides a List of validation results:

List<ValidationResult> results = RamlValidationService.createDefault().validate(ramlLocation);

Parsing

The parser returns a Raml object and can be invoked using a String with the RAML file location:

Raml raml = new RamlDocumentBuilder().build(ramlLocation);

Emitter

If you do any change to the Raml object model and you want to get the updated RAML descriptor you can use RamlEmitter class:

Raml raml = new RamlDocumentBuilder().build(ramlLocation);

// modify the raml object

RamlEmitter emitter = new RamlEmitter();
String dumpFromRaml = emitter.dump(raml);

About

A RAML parser based on SnakeYAML written in Java

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • RAML 67.0%
  • Java 33.0%