{"id":15091354,"url":"https://github.com/mulesoft/oas-raml-converter","last_synced_at":"2025-10-06T10:31:11.200Z","repository":{"id":65411491,"uuid":"65008129","full_name":"mulesoft/oas-raml-converter","owner":"mulesoft","description":"(DEPRECATED) Converts between OAS and RAML API specifications","archived":true,"fork":true,"pushed_at":"2019-09-05T20:45:29.000Z","size":32848,"stargazers_count":73,"open_issues_count":32,"forks_count":48,"subscribers_count":242,"default_branch":"master","last_synced_at":"2025-01-18T02:34:54.774Z","etag":null,"topics":["oas","openapi-spec","raml","raml-converter","raml-tooling","swagger"],"latest_commit_sha":null,"homepage":"https://mulesoft.github.io/oas-raml-converter/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"stoplightio/api-spec-converter","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mulesoft.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-08-05T09:49:24.000Z","updated_at":"2024-08-13T08:03:53.000Z","dependencies_parsed_at":"2023-01-23T10:55:00.065Z","dependency_job_id":null,"html_url":"https://github.com/mulesoft/oas-raml-converter","commit_stats":null,"previous_names":[],"tags_count":66,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mulesoft%2Foas-raml-converter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mulesoft%2Foas-raml-converter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mulesoft%2Foas-raml-converter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mulesoft%2Foas-raml-converter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mulesoft","download_url":"https://codeload.github.com/mulesoft/oas-raml-converter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235519935,"owners_count":19003201,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["oas","openapi-spec","raml","raml-converter","raml-tooling","swagger"],"created_at":"2024-09-25T10:40:33.367Z","updated_at":"2025-10-06T10:31:05.674Z","avatar_url":"https://github.com/mulesoft.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OAS RAML Converter (DEPRECATED) [![npm version](https://badge.fury.io/js/oas-raml-converter.svg)](https://www.npmjs.com/package/oas-raml-converter)\n\n# Deprecation Notice\n**This project has been deprecated and is no longer maintained. Please use [WebAPI Parser](https://github.com/raml-org/webapi-parser) converter instead. https://github.com/raml-org/webapi-parser**\n\n### Master [![Build Status](https://travis-ci.org/mulesoft/oas-raml-converter.svg?branch=master)](https://travis-ci.org/mulesoft/oas-raml-converter) [![Coverage Status](https://coveralls.io/repos/github/mulesoft/oas-raml-converter/badge.svg?branch=master)](https://coveralls.io/github/mulesoft/oas-raml-converter?branch=master) \n\n### v0.2.x [![Build Status](https://travis-ci.org/mulesoft/oas-raml-converter.svg?branch=v0.2.x)](https://travis-ci.org/mulesoft/oas-raml-converter) [![Coverage Status](https://coveralls.io/repos/github/mulesoft/oas-raml-converter/badge.svg?branch=v0.2.x)](https://coveralls.io/github/mulesoft/oas-raml-converter?branch=v0.2.x) \n\nThis package helps to convert between different API specifications. It was originally forked from [the stoplight.io converter](https://github.com/stoplightio/api-spec-converter). \n\n## Supported Conversions (beta)\n\n- OAS (OAS 2.0) -\u003e RAML 1.0: [Complete Functional Specification](./docs/OAS20-to-RAML10.md)\n- RAML 1.0 -\u003e OAS (OAS 2.0): [Complete Functional Specification](./docs/RAML10-to-OAS20.md)\n- RAML 1.0 -\u003e OAS (OAS 3.0): [Complete Functional Specification](./docs/RAML10-to-OAS30.md)\n- RAML 0.8 -\u003e OAS (OAS 2.0)\n- RAML 0.8 -\u003e RAML 1.0\n\n## Using\n\n### 1. Online web page\n\nFor an online conversion, use: [https://mulesoft.github.io/oas-raml-converter](https://mulesoft.github.io/oas-raml-converter).\n\n### 2. Command line tool\n\nThis command needs to be execute after cloning repository, \n```\nnpm run build\n```\n\nThis utility helps you converting local files from your command line.\n\n```\n./lib/bin/converter.js --from OAS20 --to RAML ./path/to/swagger.json\n./lib/bin/converter.js --from OAS20 --to RAML ./path/to/swagger.json \u003e output.raml\n\n./lib/bin/converter.js --from RAML --to OAS20 ./path/to/source.raml \u003e swagger.json\n```\n\nOr install globally and then:\n\n```\noas-raml-converter --from OAS20 --to RAML ./path/to/swagger.json\noas-raml-converter --from OAS20 --to RAML ./path/to/swagger.json \u003e output.raml\n\noas-raml-converter --from RAML --to OAS20 ./path/to/source.raml \u003e swagger.json\n```\n\n### 3. As a service\n\nFor a REST API of the converter, you can start it in an express server, checkout the [oas-raml-converter-service](https://github.com/mulesoft/oas-raml-converter-service) project.\n\n### 4. As a dependency\n\n#### Installation (NodeJS or Browser)\n\n```bash\nnpm install --save oas-raml-converter\n```\n\n#### Initializing a converter\n\nRaml 1.0 to OAS 2.0:\n```js\nvar converter = require('oas-raml-converter');\nvar raml10ToOas20 = new converter.Converter(converter.Formats.RAML, converter.Formats.OAS20);\n```\n\nOAS 2.0 to Raml 1.0:\n```js\nvar converter = require('oas-raml-converter');\nvar oas20ToRaml10 = new converter.Converter(converter.Formats.OAS20, converter.Formats.RAML);\n```\n\nThe converter detects the input raml format automatically by passing `RAML` import format, so:\nRaml 0.8 to OAS 2.0:\n```js\nvar converter = require('oas-raml-converter');\nvar raml08ToOas20 = new converter.Converter(converter.Formats.RAML, converter.Formats.OAS20);\n```\nRaml 0.8 to Raml 1.0:\n```js\nvar converter = require('oas-raml-converter');\nvar raml08ToRaml10 = new converter.Converter(converter.Formats.RAML, converter.Formats.RAML);\n```\n\n#### Converting from a file or url\n\n```js\noas20ToRaml10.convertFile('/path/to/swagger.json').then(function(raml) {\n  console.log(raml); // raml is raml yaml string\n})\n.catch(function(err) {\n  console.error(err);\n});\n```\n\n#### Converting from a string or json\n\n```js\nvar myOasString = '...';\noas20ToRaml10.convertData(myOasString).then(function(raml) {\n  console.log(raml); // raml is raml yaml string\n})\n.catch(function(err) {\n  console.error(err);\n});\n```\n\n#### Passing options\n\n```js\nvar options = {\n    validate: false, // Parse both input and output to check that its a valid document\n    validateImport: false, // Only validate input\n    validateExport: false, // Only validate output\n    format: 'yaml', // Output format: json (default for OAS) or yaml (default for RAML)\n    fs: { ... } // Use a custom file system solver (not yet available)\n};\n\noas20ToRaml10.convertFile('/path/to/swagger.json', options).then(function(raml) {\n  console.log(raml); // raml is raml yaml string\n})\n.catch(function(err) {\n  console.error(err);\n});\n```\n\n## Contributing\n\nContributions are welcome! Please check the current issues to make sure what you are trying to do has not already been discussed.\n\n### Steps\n\n1. Fork.\n2. Make changes.\n3. Write tests.\n4. Send a pull request.\n\n### Develop\n\nInstall dependencies:\n```bash\nnpm install\n```\n\nRun tests:\n```bash\nnpm test\n```\n\nRun eslint to check linting errors:\n```bash\nnpm run eslint\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmulesoft%2Foas-raml-converter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmulesoft%2Foas-raml-converter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmulesoft%2Foas-raml-converter/lists"}