Drupal is a registered trademark of Dries Buytaert
Protected Pages 3.0.0 Major update available for module protected_pages (3.0.0). Commerce Core 3.3.8 Minor update available for module commerce (3.3.8). Search API HTML Element Filter 1.0.7 Minor update available for module search_api_html_element_filter (1.0.7). Layout Builder Reorder 2.0.1 Minor update available for module layout_builder_reorder (2.0.1). Ban 1.1.0 Minor update available for module ban (1.1.0). Field Formatter Range 2.0.0 Major update available for module field_formatter_range (2.0.0). Field Formatter Range 8.x-1.8 Minor update available for module field_formatter_range (8.x-1.8). Varbase Media Header 9.2.1 Minor update available for module varbase_media_header (9.2.1). Search API Solr 4.3.11 Module search_api_solr updated after 14 months of inactivity (4.3.11). Provus Mega Menu Module provus_mega_menu crossed 1,000 active installs.

This module displays OpenAPI API documentation within your Drupal site using the Swagger UI library. It requires the OpenAPI UI module and works alongside it to provide interactive documentation for Drupal's APIs, such as JSON:API and REST.

Swagger UI is a javascript library which allows a user to explore the api documentation for a web services API. This module provides the Swagger UI library for display of OpenAPI specifications within Drupal site. OpenAPI UI is required to use the project, as it provides the underlying architecture.

Swagger UI for Drupal's APIs

Looking to view documentation on Drupal's APIs? While this module doesn't provide the documentation, you can install it alongside OpenAPI module to view docs for the JSON:API and REST modules, to display documentation on core's rest modules.

Please visit the OpenAPI project page for more information.

Installation

This module can be installed the same as any other Drupal module.

This module has two dependencies.

The Swagger UI Library can either be installed via Composer or manually. Version 3.0.17 is the recommended version of the swagger UI library at this time. Other versions of the libaray may cause issues with content display or schema parsing.

Installation with Composer

To install the library via composer, you will need to configure composer to put the library in the correct location for Drupal. This requests the composer/installers and mnsami/composer-custom-directory-installer packages. You can run the following command to ensure they are installed.

composer require composer/installers mnsami/composer-custom-directory-installer

Then modify your project's composer.json to include the following configuration.

"extra": {
  "installer-paths": {
    ...
    "web/libraries/{$name}": ["swagger-api/swagger-ui", "type:drupal-library"],
    ...
  }
}

Manual Installation

The library can be manually downloaded from Github and extracted into the libraries directory (/libraries/swagger-ui) in your Drupal installation.

Alternative UI Libraries

Swagger UI is not the only option for viewing OpenAPI Docs. Please visit the OpenAPI UI module to view a list of supported integrations.

Activity

Total releases
1
First release
Dec 2025
Latest release
7 months ago
Releases (12 mo)
1 ▲ from 0
Maintenance
Slowing

Releases

Version Type Release date
8.x-1.2 Stable Dec 11, 2025