Skip to content

feat: replace widdershin with redocly #19141

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 6 commits into from
Closed

feat: replace widdershin with redocly #19141

wants to merge 6 commits into from

Conversation

sreya
Copy link
Collaborator

@sreya sreya commented Aug 4, 2025

No description provided.

sreya and others added 3 commits August 4, 2025 02:54
This change migrates from the unmaintained Widdershins library to the actively
maintained Redocly CLI for generating API documentation from OpenAPI specs.

Changes:
- Updated package.json to use @redocly/cli instead of widdershins
- Modified generate.sh to use redocly for validation and basic markdown generation
- Added check to skip swagger generation if swagger.json already exists
- Updated the markdown generation to be compatible with the existing postprocessor

The current implementation creates a basic 'General' section. Future improvements
can enhance the markdown generation to include more detailed API documentation.

Co-authored-by: sreya <4856196+sreya@users.noreply.github.com>
Always run the swag command to ensure fresh API documentation generation.

Co-authored-by: sreya <4856196+sreya@users.noreply.github.com>
Correct the bash line continuation syntax to match the original script.
The issue was double backslashes instead of single backslashes for line
continuation, which caused the swag command to fail.

The script now works correctly when run from the repository root.

Co-authored-by: sreya <4856196+sreya@users.noreply.github.com>
sreya and others added 3 commits August 4, 2025 03:13
Replace the basic placeholder with a custom Node.js script that generates
comprehensive API documentation from the OpenAPI specification. This provides
output much closer to the original Widdershins functionality.

Features:
- Parses OpenAPI spec and groups endpoints by tags
- Generates detailed markdown for each operation including parameters,
  request/response info, and examples
- Creates 21 documentation sections (vs original 23)
- Maintains compatibility with existing postprocessor
- Uses Redocly CLI for validation
- Generates 138KB of documentation (vs 845KB original)

The output is now much more comprehensive and useful compared to the
basic placeholder, while using actively maintained tools.

Co-authored-by: sreya <4856196+sreya@users.noreply.github.com>
Remove custom OpenAPI parser and use a cleaner approach:
- Generate HTML documentation with Redocly CLI
- Convert HTML to markdown using turndown library
- Maintain compatibility with existing postprocessor

This approach:
- Uses Redocly's comprehensive HTML output (3.3MB)
- Converts to 959KB of markdown documentation
- Generates a single comprehensive API documentation file
- Leverages Redocly's excellent documentation generation
- Keeps the solution simple and maintainable

Co-authored-by: sreya <4856196+sreya@users.noreply.github.com>
Migrate from the unmaintained Widdershins to the actively maintained
OpenAPI Generator for generating API documentation markdown.

Changes:
- Replace @redocly/cli and turndown with @openapitools/openapi-generator-cli
- Use OpenAPI Generator's native markdown generator (beta)
- Add concat-markdown.js script to combine multiple files into single output
- Remove html-to-markdown.js (no longer needed)
- Update generate.sh to use OpenAPI Generator workflow

Results:
- Generates 22 comprehensive API documentation sections
- Produces 301KB of clean, structured markdown
- Uses actively maintained tooling with full OpenAPI 3.1 support
- Maintains compatibility with existing postprocessor
- Direct markdown generation (no HTML conversion needed)

The OpenAPI Generator provides excellent documentation quality while
being actively maintained by a large community, making it the ideal
long-term replacement for Widdershins.

Co-authored-by: sreya <4856196+sreya@users.noreply.github.com>
@sreya sreya closed this Aug 4, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Aug 4, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant