Documentation Index
Fetch the complete documentation index at: https://mintlify.com/renja-g/RiftRelay/llms.txt
Use this file to discover all available pages before exploring further.
Overview
RiftRelay includes a built-in Swagger UI that provides an interactive interface for exploring and testing Riot Games API endpoints. The Swagger UI automatically fetches the latest Riot API OpenAPI specification and adapts it to work through RiftRelay.Swagger UI is enabled by default. Disable it by setting
ENABLE_SWAGGER=false.Endpoint
Configuration
Enable/Disable
Swagger UI is enabled by default. To disable:Docker Usage
The Swagger UI is available immediately when running RiftRelay:http://localhost:8985/swagger/
Features
Automatic Region Selection
The Swagger UI rewrites the OpenAPI spec servers to use RiftRelay’s URL format with a region selector:na1,euw1,euw2,kr,br1,la1,la2,oc1,ru,tr1,jp1(Regional)americas,europe,asia,sea(Continental)
internal/swagger/handler.go:95-119
X-Priority Header Injection
The Swagger UI automatically adds theX-Priority header parameter to all API operations, allowing you to test high-priority requests directly from the interface.
Parameter:
- Name:
X-Priority - Location: Header
- Type: String
- Enum:
["high"] - Required: No
- Description: “Request priority hint. Use high to bypass pacing delay while still respecting rate limits.”
internal/swagger/handler.go:216-227
Security Removal
RiftRelay automatically strips authentication requirements from the OpenAPI spec since theX-Riot-Token is injected server-side. You don’t need to provide API keys in the Swagger UI.
Source: internal/swagger/handler.go:121-154
Simplified Documentation
The info description is rewritten to reference RiftRelay and the upstream OpenAPI spec source:internal/swagger/handler.go:229-236
OpenAPI Spec Endpoint
The processed OpenAPI specification is available at:- Fetches the upstream Riot API OpenAPI spec from:
- Rewrites the servers to use RiftRelay’s URL format
- Strips security schemes
- Adds the
X-Priorityheader parameter - Simplifies the info description
internal/swagger/handler.go:56-93
Usage Examples
Accessing the UI
Navigate to the Swagger UI in your browser:Testing an Endpoint
- Select Region: Choose your region from the dropdown (e.g.,
na1) - Find Endpoint: Browse or search for the endpoint (e.g.,
GET /lol/summoner/v4/summoners/by-name/{summonerName}) - Try It Out: Click “Try it out”
- Enter Parameters: Fill in required parameters (e.g.,
summonerName: Doublelift) - (Optional) Set Priority: Add
highto theX-Priorityheader field - Execute: Click “Execute”
- View Response: See the actual response from Riot API
Example Request
When you execute a request through Swagger UI for:na1, Swagger UI sends:
High Priority Request
To bypass pacing delays:- Expand the
X-Priorityheader parameter - Select
highfrom the dropdown - Execute the request
Advanced Configuration
Custom OpenAPI Spec URL
While not configurable via environment variables, you can modify the spec URL in the source:internal/swagger/handler.go:12
Proxy Behind Reverse Proxy
If RiftRelay is behind a reverse proxy, the Swagger UI automatically detects the correct scheme (http/https) from theX-Forwarded-Proto header:
internal/swagger/handler.go:273-287
Implementation Details
Swagger UI HTML
RiftRelay serves a lightweight HTML page that loads Swagger UI from CDN:internal/swagger/handler.go:302-327
Route Registration
The Swagger handler is registered during server initialization:internal/app/server.go:72-74
OpenAPI Spec Processing Flow
- Fetch Upstream Spec: HTTP GET to Riot API OpenAPI schema
- Parse JSON: Decode into
map[string]any - Rewrite Servers: Replace with RiftRelay URL format
- Strip Security: Remove authentication requirements
- Add Priority Header: Inject
X-Priorityparameter into all operations - Simplify Description: Update info section
- Encode Response: Return modified spec as JSON
internal/swagger/handler.go:56-93
Troubleshooting
Swagger UI Not Loading
Check if enabled:internal/app/server.go:98-100
OpenAPI Spec Fetch Failed
Error: “cannot load swagger spec upstream” Causes:- Network connectivity issues
- Upstream spec URL unreachable
- Request timeout (15 seconds)
Requests Failing in Swagger UI
Error: 400 Bad Request Common Causes:- Wrong region selected
- Missing required parameters
- Invalid parameter format
/{region}/{api-path} format
Examples
Fetch OpenAPI Spec
Check Servers Configuration
Extract the servers section from the processed spec:Verify X-Priority Parameter
Check ifX-Priority header is added to endpoints:
Related Endpoints
- Proxy Endpoint - Main API proxy interface
- Health Check - Service availability check
- Metrics - Operational metrics