ChotThanachot/eapi
一个通过分析 AST 生成 Swagger 文档的工具 docs, gin, openapi, swagger
eapi: An AST-Based Tool for Generating Swagger Documentation 🌐
Welcome to the eapi repository! This tool analyzes Abstract Syntax Trees (AST) to generate Swagger documentation. It is designed to work seamlessly with frameworks like docs, gin, openapi, and swagger. This README provides all the necessary information to help you get started and utilize the tool effectively.
Table of Contents
Features
- AST Analysis: Efficiently analyzes the structure of your code to create accurate Swagger documentation.
- Framework Support: Compatible with popular frameworks like docs, gin, openapi, and swagger.
- Easy Integration: Simple to integrate into your existing projects.
- Customization: Allows customization of the generated documentation to fit your needs.
Installation
To install eapi, you can download the latest release from our Releases page. Please download the appropriate file for your operating system, and follow the instructions to execute it.
Example Installation Steps
- Visit the Releases page.
- Download the appropriate binary for your OS.
- Execute the binary from your terminal or command prompt.
Usage
Using eapi is straightforward. After installation, you can generate Swagger documentation by running a simple command.
Basic Command
eapi generate [options]Options
--input: Specify the input file or directory.--output: Define the output directory for the generated documentation.--format: Choose the format of the generated documentation (e.g., JSON, YAML).
Example Command
eapi generate --input ./src --output ./docs --format yamlThis command will analyze the source files in the src directory and generate Swagger documentation in YAML format in the docs directory.
Examples
Example 1: Generating Basic Documentation
To generate basic documentation, you can run:
eapi generate --input ./myapi --output ./swagger-docs --format jsonThis command processes the myapi directory and outputs the Swagger documentation in JSON format.
Example 2: Customizing Output
You can customize the output by specifying additional options:
eapi generate --input ./myapi --output ./swagger-docs --format yaml --title "My API Documentation"This command adds a title to the generated documentation.
Contributing
We welcome contributions to eapi! If you want to help improve the tool, please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Make your changes and commit them.
- Push your branch and create a pull request.
Please ensure your code adheres to the project's coding standards and includes appropriate tests.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Links
For more information, check the Releases section for the latest updates and downloads.
Feel free to explore the repository and contribute to making eapi even better!