The `raml-parser` package provides a JavaScript implementation for parsing RAML (RESTful API Modeling Language) version 0.8 specifications. It is built using CoffeeScript and is designed for use in both Node.js environments via CommonJS `require` and directly in web browsers by including a script tag. The current stable version is 0.8.18. This parser specifically targets the RAML 0.8 specification, which is an older standard. For projects requiring support for RAML 1.0, a separate, newer parser (`raml-js-parser-2`) is available and recommended. Release cadence for `raml-parser` is infrequent, focusing primarily on bug fixes and maintenance for the 0.8 specification, such as recent patches addressing circular references in JSON schemas and `$ref`erenced schema support. Its primary differentiator is its strict adherence to the deprecated RAML 0.8 standard, making it suitable mainly for maintaining legacy systems built on that specific version.
npm install raml-parserVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to parse a RAML 0.8 file and a RAML 0.8 string into an object model, and also how to generate an Abstract Syntax Tree (AST) from a RAML string, using both `loadFile`/`load` and `compose` methods.
For RAML 1.0 support, use the `raml-js-parser-2` package instead, which is specifically designed for the newer specification.
Consider migrating your API definitions to RAML 1.0 and utilizing `raml-js-parser-2` for future development to leverage updated features and tooling support.
Ensure your code correctly handles Promises returned by `loadFile` and other methods that might involve fetching remote resources. No direct fix is available to revert to synchronous behavior.
Upgrade to `raml-parser` version 0.8.17 or higher to ensure proper handling of `$ref`erenced JSON schemas.
Update to `raml-parser` version 0.8.18 to correctly handle JSON schemas with circular references.
Review the documentation for `applySchemas` in v0.8.15+ and update your parsing logic if specific schema transformation control is required.
In the browser, ensure `raml-parser.min.js` is included via a `<script>` tag and use `RAML.Parser.loadFile()` or `RAML.Parser.load()`.
Carefully review your RAML file or string for correct YAML and RAML 0.8 syntax. Use a linter or validator for RAML 0.8 if available.
Verify the file path provided to `raml.loadFile()` is correct and that the Node.js process has read permissions for the file.
Ensure the input to `loadFile` or `load` is valid (e.g., a string for `load`, a valid path for `loadFile`) and that the parser is correctly initialized. This can also happen if the `raml` object itself is undefined or incorrectly imported.
No dependency data recorded yet.