Add Swagger UI alongside Redocly documentation#5
Merged
Conversation
Added Swagger UI for interactive API exploration alongside the existing Redocly documentation, giving users two ways to interact with the API. Changes: - Installed swagger-ui-dist package - Created build script for Swagger UI (scripts/build-swagger.js) - Updated npm scripts to build both Redocly and Swagger UI - Added navigation link from Swagger UI to Redocly docs - Added link in OpenAPI description to Swagger UI - Updated README with documentation for both formats Documentation formats: 1. Redocly (dist/index.html) - Beautiful, readable API documentation - Green Button theming - Comprehensive examples 2. Swagger UI (dist/swagger/index.html) - Interactive API testing - 'Try it out' functionality - OAuth flow testing - Green Button branded Build commands: - npm run build - Builds both formats - npm run build:redocly - Builds only Redocly - npm run build:swagger - Builds only Swagger UI Both use the same openapi/openapi.yaml source file. Validation: Passes npm test with valid OpenAPI spec Build: Successfully generates both documentation formats Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds Swagger UI for interactive API exploration alongside the existing Redocly documentation, providing users with two complementary ways to interact with the Green Button ESPI API.
Problem Solved
Users need different tools for different purposes:
Both tools now use the same
openapi/openapi.yamlsource file - no duplication!Changes Made
1. Added Swagger UI
✅ Installed
swagger-ui-distpackage✅ Created build script (
scripts/build-swagger.js)✅ Green Button branded - Custom colors and styling
✅ Navigation - Link from Swagger UI to Redocly docs
2. Updated Build System
✅ npm run build - Builds both formats
✅ npm run build:redocly - Builds only Redocly
✅ npm run build:swagger - Builds only Swagger UI
✅ npm run bundle - Generates JSON bundle for Swagger
3. Documentation Updates
✅ Updated README with both documentation formats
✅ Added link in OpenAPI description to Swagger UI
✅ Cross-navigation between both interfaces
Documentation Formats
Redocly (Main) -
dist/index.htmlSwagger UI (Interactive) -
dist/swagger/index.htmlBuild Output Structure
File Changes
scripts/build-swagger.js(build script)package.json(new scripts, swagger-ui-dist dep)package-lock.json(new dependencies)README.md(documentation for both formats)openapi/openapi.yaml(link to Swagger UI)Total: 5 files changed, 191 insertions, 4 deletions
Features
Green Button Branding
Cross-Navigation
Single Source of Truth
Both tools read from
openapi/openapi.yaml- maintain one file, get two interfaces!Validation
✅
npm test- Passes with valid OpenAPI spec✅
npm run build- Successfully builds both formats✅ Both interfaces display correctly
Testing
After merge, verify:
Co-Authored-By: Claude Sonnet 4.5 noreply@anthropic.com