Technology
The openapi module provides Swagger UI integration for Project Forge applications. It embeds the complete Swagger UI interface to visualize, explore, and test OpenAPI specifications.
Overview
This module provides:
- Swagger UI Integration: Complete embedded Swagger UI for interactive API documentation
- OpenAPI Specification Support: Compatible with OpenAPI 3.x specifications
- Interactive Testing: Built-in API testing capabilities through the Swagger UI
- Customizable Integration: Flexible controller implementation with configurable security
Key Features
Interactive Documentation
- Visual API documentation with request/response schemas
- Interactive API testing directly in the browser
- Parameter validation and example generation
- Multiple response format support
Seamless Integration
- Embeds all necessary Swagger UI assets (CSS, JavaScript)
- Works with any OpenAPI 3.x specification
- Supports both local and remote specification URLs
- Integrates with Project Forge’s theming system
Security & Customization
- Flexible security model - add authentication as needed
- Customizable base URL and specification location
- Integration with Project Forge’s routing and middleware
Usage
Basic Implementation
By default, no controller exposes the Swagger UI. Create a controller following this example, then add a route with your preferred security:
1 | |
Configuration Options
You can customize the OpenAPI specification source:
1 | |
Configuration
This module requires:
- An OpenAPI 3.x specification file accessible at the configured URL
- A controller implementation (not provided by default)
- Route configuration for accessing the Swagger UI
Source Code
- Repository: https://github.com/kyleu/projectforge/tree/main/module/openapi
- License: CC0 (Public Domain)
- Author: Kyle U (kyle@kyleu.com)
See Also
- OpenAPI Specification - OpenAPI 3.x documentation
- Swagger UI Documentation - Swagger UI features and configuration
- Project Forge Documentation - Complete documentation