Skip to content

⬆️ upgrade swagger-ui to 5.27.1#4218

Open
josemigallas wants to merge 1 commit intomasterfrom
THREESCALE-12255_swagger_ui_27
Open

⬆️ upgrade swagger-ui to 5.27.1#4218
josemigallas wants to merge 1 commit intomasterfrom
THREESCALE-12255_swagger_ui_27

Conversation

@josemigallas
Copy link
Copy Markdown
Contributor

@josemigallas josemigallas commented Feb 5, 2026

THREESCALE-12255: Update swagger-ui to 5.27.1

Latest is 5.31 but 5.28 breaks our implementation. While I figure out why, this is the most recent version we can update to.

Verification steps

This module is used in OAS 3 specs in the following pages:

  • 3scale API Documentation /p/admin/api_docs
  • api_docs with apiconfig/services/:service_id/api_docs/:id/preview
  • dev portal docs page /docs

ℹ️ https://github.com/swagger-api/swagger-ui/releases

@qltysh
Copy link
Copy Markdown

qltysh bot commented Feb 5, 2026

❌ 1 blocking issue (1 total)

Tool Category Rule Count
eslint Lint Unsafe argument of type any assigned to a parameter of type string. 1

@josemigallas josemigallas requested a review from a team February 6, 2026 10:13
@josemigallas josemigallas self-assigned this Feb 6, 2026
Copy link
Copy Markdown
Contributor

@jlledom jlledom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the problem with 5.28? It's surprising we can upgrade 2 major versions at once but then there's a breaking change in a minor version.

Copy link
Copy Markdown
Contributor

@jlledom jlledom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to work fine for me, I found a small bug. In the request body section for POST and PUT requests, the fields are auto-filled wrongly, I think.

Before:
Image

After:

Image

@mayorova
Copy link
Copy Markdown
Contributor

mayorova commented Feb 9, 2026

Seems to work fine for me, I found a small bug. In the request body section for POST and PUT requests, the fields are auto-filled wrongly, I think.

That rings a bell... See Notes for reviewer in #3934

@josemigallas
Copy link
Copy Markdown
Contributor Author

josemigallas commented Feb 9, 2026

What's the problem with 5.28? It's surprising we can upgrade 2 major versions at once but then there's a breaking change in a minor version.

It's TBI (to be investigated). It simply throws an error in the browser console and doesn't render anything.

@github-actions github-actions bot added the Stale label Mar 14, 2026
@3scale 3scale deleted a comment from github-actions bot Mar 16, 2026
@github-actions
Copy link
Copy Markdown

This PR is stale because it has not received activity for more than 30 days. Remove stale label or comment or this will be closed in 15 days.

@github-actions github-actions bot added the Stale label Apr 16, 2026
@jlledom jlledom removed the Stale label Apr 16, 2026
@jlledom
Copy link
Copy Markdown
Contributor

jlledom commented Apr 17, 2026

I've been checking this. I rebased to master and tried to update to 5.32.4, the last release.

I hit the error after upgrading to 5.28.0. After an investigation I found the problem is due to 5.28.0 and later versions depending on React 18 de facto: even when their package.json states they accept React between 16 and 19, the fact is they only accept React 18 and 19 by mistake. People depending on swagger-ui-dist receive the correct React already bundled, but we use swagger-ui which expects React to be installed by us.

Somebody hit the same bug: swagger-api/swagger-ui#10636

And there's a fix already, but not merged: swagger-api/swagger-ui#10642

The fix looks abandoned, it doesn't seem it's going to be merged soon. So we can't rely on that. In order to upgrade to newer versions, we would need:

  • react: 17.0.2 → 18.3.1
  • react-dom: 17.0.2 → 18.3.1
  • react-redux: 7.2.9 → ^9.2.0
  • @wojtekmaj/enzyme-adapter-react-17@cfaester/enzyme-adapter-react-18
  • Add resolutions for swagger-ui/react and swagger-ui/react-dom → 18.3.1
  • Fix tests

I told Claude to do it and I could upgrade to swagger-ui 5.32.4. Everything in porta looked correct. So it can be done. I kept the branch if you are interested.

IMO we should merge this and get swagger-ui 5.27.1. In another PR we can upgrade to React 18 and last swagger-ui release. The issue I mentioned in this comment would still need to be fixed: #4218 (review)

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.

3 participants