Skip to content

Bug: Use stable ReDocly CDN for RedocRenderPlugin #4476

@sion908

Description

@sion908

Description

The current default for the RedocRenderPlugin in Litestar uses version='next' and constructs the JS bundle URL via a general CDN (for example: https://cdn.jsdelivr.net/npm/redoc@next/bundles/redoc.standalone.js). However, this URL appears to produce HTTP 404 errors or incorrect MIME types (e.g., text/plain) in some environments, thus rendering the ReDoc UI inoperative.

In contrast, the official ReDoc distribution via https://cdn.redoc.ly/redoc/latest/bundles/redoc.standalone.js has shown to work reliably.

Therefore, I propose:

  1. Update the default JS bundle URL construction for RedocRenderPlugin to use the stable cdn.redoc.ly host (for example: https://cdn.redoc.ly/redoc/latest/bundles/redoc.standalone.js or latest).
  2. Consider deprecating the version='next' default and recommending a specific version (or latest) that is maintained.

Benefits:

  • Avoids broken UI due to CDN or version tag issues.
  • Improves reliability of API documentation UI out of the box.

Please let me know if I can help by submitting a PR for this change.

URL to code causing the issue

No response

MCVE

Steps to reproduce

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Screenshots

Image

Logs


Litestar Version

2.18.0

Platform

  • Linux
  • Mac
  • Windows
  • Other (Please specify in the description above)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bug 🐛This is something that is not working as expected

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions