The Swagger Dart Router VS Code extension simplifies the process of generating Dart routes directly from a Swagger Json File. With just a few clicks, you can convert your Swagger API documentation into a Dart file containing all the necessary routes, organized by scope. This extension is perfect for Dart developers who want to streamline their API integration workflow and avoid manually typing out each route.
Features
Automatic Route Generation: Automatically generates Dart routes based on the paths and methods defined in the Swagger Json File, reducing manual effort and potential errors.
Customizable Output: Specify the output file name and location, allowing flexibility in integrating the generated routes into your Dart projects.
Scope-based Organization: Routes are grouped by scope, making it easier to navigate and manage them within the generated Dart file.
CamelCase Naming: Path segments are converted to camelCase for better readability and adherence to Dart naming conventions.
Error Handling: Handles errors gracefully, providing informative messages in case of failures during Swagger Json File retrieval or route generation.
Generated File Comments: Includes comments indicating that the Dart file is auto-generated, helping developers understand its purpose and avoid accidental modifications.
Cross-platform Compatibility: Dart is a versatile language, and the generated routes can be used in various Dart environments, including Flutter apps, web applications, and server-side Dart projects.
Installation
Open the Extensions view in VS Code (Ctrl+Shift+X or Cmd+Shift+X).
Search for Swagger Dart Router.
Click Install.
Requirements
An active internet connection to fetch the Swagger Json data.
Valid Swagger Json URL.
Usage
Open the command palette (Ctrl+Shift+P or Cmd+Shift+P).
Type and select Generate Dart Routes from Swagger.
Enter the Swagger Json URL when prompted.
Choose the location to save the generated Dart file.
The extension will generate a Dart file with routes organized by scope.
Known Issues
List any known issues here to help limit duplicate reports. (e.g., "Currently does not support Swagger Json Files with..." or "Known issue with paths containing special characters...")
Contributing
We welcome contributions to improve this extension! Feel free to submit issues and pull requests to the GitHub repository.
Support
If you encounter any issues or have any questions, please reach out via the GitHub issues page.