wpswag converts a WordPress REST API into an OpenAPI 3.0.3 JSON file.
go install github.com/m7medVision/wpswag@latestgo build -o wpswag ../wpswag convert -u "https://example.com/wp-json" -o openapi.jsonYou can also run it without building:
go run . convert -u "https://example.com/wp-json"- Input can be a WordPress REST URL or a local JSON file.
- Output defaults to
openapi.json. - The generated spec includes typed schemas for core
wp/v2resources when schema metadata is available.