Skip to content

Conversation

@ardaaltinors
Copy link

Summary

Adds springdoc.swagger-ui.document-title to customize the browser tab title for Swagger UI pages.

Related Issues

Why

When working with microservices, having 5 tabs all named "Swagger UI" is painful. This lets you name them.

Usage

springdoc:
  swagger-ui:
    document-title: "User Service API"

Implementation

Follows the existing CSRF/OAuth injection pattern - injects document.title = '...' into swagger-initializer.js with proper XSS escaping.

Tests

  • Title injection ✅
  • Null/empty handling ✅
  • XSS prevention ✅

This allows customizing the browser tab title for Swagger UI pages
by setting a configuration property that injects document.title
JavaScript after SwaggerUIBundle initialization.

Includes XSS protection by escaping < and > characters in the title.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant