Skip to content

Instantly share code, notes, and snippets.

@andrewwylde
Created November 8, 2021 23:09
Show Gist options
  • Save andrewwylde/1aef2d64bce2a37448e98072de7808d4 to your computer and use it in GitHub Desktop.
Save andrewwylde/1aef2d64bce2a37448e98072de7808d4 to your computer and use it in GitHub Desktop.
Modifying `swagger-ui` before building

Problem: We need to make changes to swagger-ui that aren't fixed upstream

Solution: Update swagger-ui directly and bundle for ourselves!

Steps:

  • clone swagger-ui
  • check out v3.26.0 (git checkout v3.26.0) or whatever version we're working on
  • make your changes!
  • Build and copy to the kong-portal-templates directory: yarn build && cp dist/swagger-ui-bundle.js ../kong-portal-templates/workspaces/default/themes/base/assets/js/third-party/swagger-ui-bundle-3.26.0-mod.min.js

Pros

  • gets our a11y considerations into our codebase
  • relatively quick/painless

Cons

  • misses upstream changes
  • may cause confusion for future devs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment