oapi-mdgen is a command-line tool that converts OpenAPI 3 specifications into Markdown documentation. It generates a readable Markdown file detailing the endpoints, paths, operations, parameters, request bodies, responses, and schemas defined in your OpenAPI specification.
- Parses OpenAPI v3 specifications.
- Generates structured Markdown documentation grouping endpoints by tags.
- Includes details on requests, responses, and schemas.
- Built on top of libopenapi.
Ensure you have Go installed on your system. You can build the tool by running:
make buildAlternatively, you can install or run it directly using go:
go install github.com/masagroup/oapi-mdgengo run github.com/masagroup/oapi-mdgen -i input.yaml -o output.mdoapi-mdgen --input <openapi.yaml> --output <documentation.md>-i,--input: (Required) Path to the input OpenAPI specification file.-o,--output: (Required) Path to the output Markdown file.
oapi-mdgen -i openapi.yaml -o api-docs.mdThe project includes a Makefile for common tasks:
make build: Builds the project.make test: Runs the tests.make lint: Runsgolangci-lint(requires Docker).make coverage: Generates test coverage data.make coverage-html: Generates an HTML report for test coverage.