All Projects → raml2html → raml2obj

raml2html / raml2obj

Licence: MIT license
RAML to object.

Programming Languages

javascript
184084 projects - #8 most used programming language
RAML
58 projects

Projects that are alternatives of or similar to raml2obj

osprey-method-handler
Middleware for validating requests and responses based on a RAML method object
Stars: ✭ 14 (-39.13%)
Mutual labels:  raml, raml-tooling, raml-utilities
api-console-cli
A CLI tools for the API console.
Stars: ✭ 14 (-39.13%)
Mutual labels:  raml, raml-tooling, raml-utilities
node-raml-validate
Strict validation of RAML parameters in JavaScript
Stars: ✭ 18 (-21.74%)
Mutual labels:  raml, raml-tooling
oas-raml-converter
(DEPRECATED) Converts between OAS and RAML API specifications
Stars: ✭ 75 (+226.09%)
Mutual labels:  raml, raml-tooling
raml-dotnet-parser-2
No description or website provided.
Stars: ✭ 17 (-26.09%)
Mutual labels:  raml, raml-tooling
raml-java-client-generator
Raml Java Client Generator
Stars: ✭ 32 (+39.13%)
Mutual labels:  raml, raml-tooling
raml-sublime-plugin
Syntax highlighter for the RESTful API Modeling Language
Stars: ✭ 49 (+113.04%)
Mutual labels:  raml, raml-tooling
raml-typesystem
(deprecated) Typescript implementation of RAML type system
Stars: ✭ 15 (-34.78%)
Mutual labels:  raml, raml-tooling
commercetools-api-reference
commercetools API reference documentation
Stars: ✭ 41 (+78.26%)
Mutual labels:  raml, raml-utilities
raml-javascript-generator
Generate a JavaScript API client from RAML
Stars: ✭ 30 (+30.43%)
Mutual labels:  raml, raml-tooling
Osprey Mock Service
Generate an API mock service from a RAML definition using Osprey
Stars: ✭ 106 (+360.87%)
Mutual labels:  raml
Raml Client Generator
Template-driven generator of clients for APIs described by a RAML spec
Stars: ✭ 119 (+417.39%)
Mutual labels:  raml
Api Workbench
The API Workbench for RAML (deprecated)
Stars: ✭ 222 (+865.22%)
Mutual labels:  raml
Raml ruby
Raml Ruby
Stars: ✭ 95 (+313.04%)
Mutual labels:  raml
Raml Js Parser
(deprecated) A RAML parser based on PyYAML written in CoffeScript and available for use as NodeJs module or in-browser.
Stars: ✭ 197 (+756.52%)
Mutual labels:  raml
Raml Tester
Test if a request/response matches a given raml definition
Stars: ✭ 70 (+204.35%)
Mutual labels:  raml
Commerce Sdk
Stars: ✭ 63 (+173.91%)
Mutual labels:  raml
Raml2html
RAML to HTML documentation generator.
Stars: ✭ 1,108 (+4717.39%)
Mutual labels:  raml
smockin
Dynamic API, S3 & Mail mocking for web, mobile & microservice development.
Stars: ✭ 74 (+221.74%)
Mutual labels:  raml
Raml Java Parser
(deprecated) A RAML parser based on SnakeYAML written in Java
Stars: ✭ 169 (+634.78%)
Mutual labels:  raml

RAML to object

NPM version Prettier

A thin wrapper around raml-js-parser-2, adding extra properties to the resulting object for use in raml2html and raml2md.

Versions 4.0.0 and up only support RAML 1.x files. If you still have RAML 0.8 source files, please stick with raml2obj 3.

Install

npm i raml2obj --save

Usage

var raml2obj = require('raml2obj');

// source can either be a filename, url, or parsed RAML object.
// Returns a promise.
raml2obj.parse(source).then(function(ramlObj) {
  // Do something with the resulting ramlObj :)
});

Options

The parse() function can be called with options to customize the result. Defaults are compatible with raml2html.

raml2obj.parse(source, {
  validate: true, 
  extensionsAndOverlays : [], 
  collectionFormat: 'arrays',
}).then(function(ramlObj) {
  // Do something with the resulting ramlObj :)
});
  • validate: triggers the rejectOnErrors flag of the underlying parser. defaults to false
  • extensionsAndOverlays: Defaults to []. See parser documentation.
  • collectionFormat: choose what data structure the double-nested [{name1: {..}}, {name2: {..}}] patterns of the raml-1-parser are transformed to in the output object:
collectionFormat value output
objects (default) {name1: { orderHint: 0, ..}, name2: { orderHint: 1, ..}} (eases e.g. property access). Applies to top-level collections only, nested are arrays except type properties.
arrays [ {key: "name1", ..}, {key: "name2", ..}] (eases e.g. representation in a database). Applies recursively everywhere.

Questions & Support

Do you have a question? Have you found a bug or would you like to request a feature? Please check out CONTRIBUTING.md.

License

raml2obj is available under the MIT license. See the LICENSE file for more info.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].