Skip to content

Swagger/UI Freshness #335

Description

@mockodin

Greetings

I'm curious about SwaggerUI freshness - I see today the files needed are vendored, is that a hard requirement? I believe we could benefit from leveraging an intermediary module like flask-swagger-ui which provides regular automated updates.

Motivation

Flask-Rebar currently owns a copied Swagger UI distribution and a local HTML
template. This has several costs:

  • Updating Swagger UI requires manually replacing generated frontend files.
  • Flask-Rebar duplicates resources already maintained by a dedicated package.
  • Large minified assets obscure meaningful Python changes during review.
  • Applications cannot configure common Swagger UI or OAuth settings per
    registry.
  • The copied UI bundle can age independently of Flask-Rebar's Python code.

Goals

  • Serve Swagger UI from a declared Python dependency (pinnable / user-overridable)
  • Remove Flask-Rebar's duplicate JavaScript, CSS, source maps, icons, OAuth
    resources, and HTML template.
  • Preserve existing public routes, endpoints, and Python call signatures.
  • Support JSON-serializable Swagger UI settings per handler registry.
  • Support OAuth initialization settings per handler registry.
  • Keep registry configuration isolated from caller mutation and cloned
    registries.
  • Render configuration safely inside HTML script contexts.
  • Keep generated Swagger/OpenAPI documents unchanged.

I successfully wired-up flask-swagger-ui==5.32.14 locally to act the source for swagger UI static files. Even now we don't leverage all swagger UI features, but this would give is some modernization by default. Notably Dark Mode and accessibility enhancements.

If there is interest, I can roll this into a PR.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions