|
1 | | -# plugin-api-docs-module-raml-gen-doc |
2 | | -Adds RAML to OpenAPI conversion support in Backstage API Docs for seamless rendering and integration. |
| 1 | +# Backstage.io Api-Docs Plugin: RAML to OpenAPI Renderer |
| 2 | + |
| 3 | +## Overview |
| 4 | + |
| 5 | +This is a plugin for [Backstage](https://backstage.io/) that extends the capabilities of the built-in API documentation feature by adding support for parsing and rendering [RAML](https://raml.org/) (RESTful API Modeling Language) definitions in [OpenAPI](https://www.openapis.org/) format. |
| 6 | + |
| 7 | +With this integration, Backstage users can seamlessly view and manage their APIs defined in RAML within the same familiar interface as OpenAPI. |
| 8 | + |
| 9 | +## Features |
| 10 | + |
| 11 | +- **Converts RAML to OpenAPI**: Automatically translates RAML API definitions into OpenAPI v2.0 specifications. |
| 12 | +- **Enhanced Documentation**: Leverages Backstage's Api-Docs capabilities for a consistent user experience. |
| 13 | +- **Easy Integration**: Designed to work seamlessly with existing Backstage setups and plugins. |
| 14 | + |
| 15 | +## Prerequisites |
| 16 | + |
| 17 | +- Basic knowledge of Backstage setup. |
| 18 | +- Node.js installed on your development machine (preferably the latest LTS version). |
| 19 | +- Existing or planned RAML API definitions in your project. |
| 20 | + |
| 21 | +## Installation |
| 22 | + |
| 23 | +1. **Clone or Download this Repository** |
| 24 | + |
| 25 | + ```bash |
| 26 | + git clone https://github.com/Coderrob/plugin-api-docs-module-raml-gen-doc.git |
| 27 | + cd plugin-api-docs-module-raml-gen-doc |
| 28 | + ``` |
| 29 | + |
| 30 | +2. **Install Dependencies** |
| 31 | + |
| 32 | + Ensure that you have Backstage installed and configured. If not, follow the [official Backstage documentation](https://backstage.io/docs/getting-started/) to set up a new instance. |
| 33 | + |
| 34 | +3. **Build the Plugin** |
| 35 | + |
| 36 | + ```bash |
| 37 | + yarn build |
| 38 | + ``` |
| 39 | + |
| 40 | +4. **Link the Plugin to your Backstage App** |
| 41 | + |
| 42 | + Navigate to your Backstage app directory and link the plugin: |
| 43 | + |
| 44 | + ```bash |
| 45 | + cd path/to/your-backstage-app |
| 46 | + yarn --cwd packages/app add @coderrob/plugin-api-docs-module-raml-gen-doc |
| 47 | + ``` |
| 48 | + |
| 49 | +5. **Register the Plugin in Your App's `packages/app/src/plugins.ts`** |
| 50 | + |
| 51 | + Add the following import statement to register the plugin with Backstage: |
| 52 | + |
| 53 | + ```typescript |
| 54 | + export const ramlOpenApiPlugin = createPlugin({ |
| 55 | + id: 'raml-open-api', |
| 56 | + routes: { |
| 57 | + root: rootRouteRef, |
| 58 | + }, |
| 59 | + }); |
| 60 | + ``` |
| 61 | + |
| 62 | +6. **Restart Your Backstage App** |
| 63 | + |
| 64 | + After making changes, restart your Backstage application to see the new plugin in action: |
| 65 | + |
| 66 | + ```bash |
| 67 | + yarn dev |
| 68 | + ``` |
| 69 | + |
| 70 | +## Usage |
| 71 | + |
| 72 | +1. **Add RAML Files** |
| 73 | + |
| 74 | + Place your RAML API definitions under a directory specified for API documentation within your Backstage app (e.g., `static/docs/api`). |
| 75 | + |
| 76 | +2. **Navigate to API Docs** |
| 77 | + |
| 78 | + Access the API documentation section in Backstage, and you should see an option or tab dedicated to RAML-based APIs. |
| 79 | + |
| 80 | +3. **View Rendered OpenAPI Documentation** |
| 81 | + |
| 82 | + The plugin will automatically convert the RAML definitions into OpenAPI format and render them using Backstage's built-in tools for a clean, interactive experience. |
| 83 | + |
| 84 | +## Configuration |
| 85 | + |
| 86 | +The plugin leverages Backstage’s existing configuration settings for API documentation. No additional configuration is required unless you need to customize the conversion process or rendering options. |
| 87 | + |
| 88 | +If customization is needed, refer to the following optional configuration steps: |
| 89 | + |
| 90 | +1. **Custom Conversion Scripts** |
| 91 | + |
| 92 | + Modify the conversion scripts located in `src/raml-to-openapi` to suit your specific RAML and OpenAPI version requirements. |
| 93 | + |
| 94 | +2. **Update Plugin Settings** |
| 95 | + |
| 96 | + Adjust settings within `src/plugin.tsx` or related configuration files to change behavior such as API scanning paths, default rendering themes, etc. |
| 97 | + |
| 98 | +## Contributing |
| 99 | + |
| 100 | +Contributions are welcome! Feel free to open issues for bug reports or feature requests, and submit pull requests with your enhancements. |
| 101 | + |
| 102 | +- Fork this repository. |
| 103 | +- Create a new branch: `git checkout -b feature/your-feature-name`. |
| 104 | +- Commit your changes: `git commit -m "Add some feature"`. |
| 105 | +- Push to the branch: `git push origin feature/your-feature-name`. |
| 106 | +- Open a pull request against the main branch in this repository. |
| 107 | + |
| 108 | +## License |
| 109 | + |
| 110 | +This plugin is released under the Apache 2.0 License. Please see [LICENSE](LICENSE) for more details. |
| 111 | + |
| 112 | +## Support and Community |
| 113 | + |
| 114 | +For any questions or support related to this plugin, please join our community on Slack or check out the GitHub Issues section of this repository. |
| 115 | + |
| 116 | +- **GitHub Issues**: [Issues on GitHub](https://github.com/your-repo/backstage-raml-openapi-plugin/issues) |
| 117 | + |
| 118 | +Enjoy using this plugin to enhance your Backstage API documentation capabilities with RAML support! |
0 commit comments