Update Swagger UI Library To Latest Major Version

Created on 15 December 2023, 11 months ago
Updated 15 April 2024, 7 months ago

Problem/Motivation

The listed compatible version for this module is 3.x but the library goes up to 5.x now. I think we should attempt to update the library version.

Proposed resolution

Update the "swagger-api/swagger-ui" dependency to version 5.x.

User interface changes

In testing by manually placing the library vs. composer adding it, I didn't see a difference in the UI. The configuration docs also seem pretty similar. There might be UI changes, and it'd be nice to get some functional JS tests added to this repo.

📌 Task
Status

RTBC

Version

1.0

Component

Code

Created by

🇺🇸United States afinnarn

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @afinnarn
  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.3 & MariaDB 10.3.22
    last update 11 months ago
    1 pass
  • Status changed to Needs review 11 months ago
  • 🇺🇸United States afinnarn

    I updated the composer.json file to pull swagger-ui 5.x but didn't add any tests yet. Feel free to review, and hopefully, I can help add tests.

  • Open in Jenkins → Open on Drupal.org →
    Core: 10.2.1 + Environment: php8.3_mysql8
    last update 8 months ago
    1 pass
  • Open in Jenkins → Open on Drupal.org →
    Core: 10.2.1 + Environment: PHP 8.2 & MySQL 8
    last update 8 months ago
    1 pass
  • Status changed to RTBC 8 months ago
  • 🇮🇳India vipin.mittal18 Greater Noida

    Hello @richgerdes,

    Swagger-api/swagger-ui have been updated from version 3 to version 5 with a number of bug fixes. so it would be good for us to use latest one.
    Thanks!

  • 🇺🇸United States afinnarn

    Hey @vipin.mittal18, are you getting the 5.x library with this patch? I thought I was, but when I look in the libraries directory, I still have 3.x . I think the patch might be applied after Composer installs and merges dependencies, but I'm not sure. I will continue to look into this and maybe try pointing Composer to the MR branch.

    If you aren't getting 5.x either, then maybe this MR has to be merged for us to pick it up or at least the issue should go back to "Needs Work".

  • 🇺🇸United States afinnarn

    I will leave this at RTBC since I confirmed that once the patch is merged, it will update swagger-ui to 5.x. For now, I had to do the following:

    Update composer.json repositories section:

        "repositories": {
            "drupal": {
                "type": "composer",
                "url": "https://packages.drupal.org/8",
                "exclude": [
                    "drupal/openapi_ui_swagger"
                ]
            },
            "drupal/openapi_ui_swagger": {
                "type": "git",
                "url": "https://git.drupal.org/issue/openapi_ui_swagger-3409145.git"
            }
    

    Then run these commands:

    1. composer remove drupal/openapi_ui_swagger --no-update
    2. composer require drupal/openapi_ui_swagger:dev-3409145-update-swagger-ui#bd0b5aa612c5c49763e28f8d19dfef9940166f49 -W

    Now when you look, you should see swagger_ui 5.x loaded instead of 3.x.

Production build 0.71.5 2024