The Swagger Generator is a tool designed to streamline the conversion of cURL commands into Swagger 2 or OpenAPI formats. It offers an intuitive interface for simplifying the process of documenting API endpoints.
Follow these steps to set up and use the Swagger Generator:
-
Clone the Repository:
git clone https://github.com/elvus/swagger-generator.git
This command clones the project repository to your local machine.
-
Navigate to the Project Directory:
cd swagger-generator
Move into the project directory.
-
Install Dependencies:
npm install
This command installs all necessary dependencies required for running the Swagger Generator.
-
Run the Application:
npm run dev
Start the application by running this command. It will launch the Swagger Generator interface, allowing you to convert cURL commands effortlessly into Swagger or OpenAPI formats.
-
Access the Interface: After running the application, open your web browser and go to http://localhost:5173/ to access the Swagger Generator interface.
Alternatively, you can use Docker to deploy the Swagger Generator:
-
Build the Docker Image:
docker build -t swagger_gen .
This command builds the Docker image named
swagger_gen
. -
Run the Docker Container:
docker run --name=swagger_gen -p 5173:5173 swagger_gen
Execute the Docker container with the specified name (
swagger_gen
) and port mapping. This will deploy the Swagger Generator within a Docker container.
Feel free to explore and utilize the Swagger Generator to enhance your API documentation process.