Project Information
- Name of tool/project: Swagger UI
- Project home page: https://github.com/swagger-api/swagger-ui
- Name of team requesting review: Platform Engineering (RESTBase Sunsetting)
- Primary contact: @daniel
- Target date for deployment: Q3 2023
- Link to code repository / patchset: https://github.com/swagger-api/swagger-ui
- Link to scc output for general sizing of codebases (https://github.com/boyter/scc):
16:35 [(HEAD detached at v4.15.5)] ~/code/swagger-ui> scc src ─────────────────────────────────────────────────────────────────────────────── Language Files Lines Blanks Comments Code Complexity ─────────────────────────────────────────────────────────────────────────────── JSX 97 9049 1221 211 7617 709 JavaScript 78 6970 854 363 5753 774 Sass 17 3060 669 28 2363 5 Markdown 4 165 45 0 120 0 SVG 2 61 3 0 58 0 ─────────────────────────────────────────────────────────────────────────────── Total 198 19305 2792 602 15911 1488 ─────────────────────────────────────────────────────────────────────────────── Estimated Cost to Develop (organic) $493,602 Estimated Schedule Effort (organic) 10.52 months Estimated People Required (organic) 4.17 ─────────────────────────────────────────────────────────────────────────────── Processed 570413 bytes, 0.570 megabytes (SI) ───────────────────────────────────────────────────────────────────────────────
Description of the tool/project:
JavaScipt library that creates an interactive UI for exploring an OpenAPI specification, including constructing request against the respective API.
Description of how the tool will be used at WMF:
The plan is to create a special page that displayes the OpenAPI spec of any REST endpoints exposed by the wiki instance. The spec will be constructed automatically based on self-documentation abilities of the respective endpoints. This is similar to what Special:ApiSandbox does for the Action API.
See T323786: REST framework: Add support for outputting an OpenAPI (swagger) spec
Dependencies
Swagger UI will be served to clients as a single minfied bundle containing all dependencies, swagger-ui-bundle.js.
From https://github.com/swagger-api/swagger-ui/blob/v4.15.5/package.json:
"dependencies": { "@babel/runtime-corejs3": "^7.18.9", "@braintree/sanitize-url": "=6.0.0", "base64-js": "^1.5.1", "classnames": "^2.3.1", "css.escape": "1.5.1", "deep-extend": "0.6.0", "dompurify": "=2.3.10", "ieee754": "^1.2.1", "immutable": "^3.x.x", "js-file-download": "^0.4.12", "js-yaml": "=4.1.0", "lodash": "^4.17.21", "patch-package": "^6.5.0", "prop-types": "^15.8.1", "randexp": "^0.5.3", "randombytes": "^2.1.0", "react": "=17.0.2", "react-copy-to-clipboard": "5.1.0", "react-debounce-input": "=3.3.0", "react-dom": "=17.0.2", "react-immutable-proptypes": "2.2.0", "react-immutable-pure-component": "^2.2.0", "react-inspector": "^6.0.1", "react-redux": "^7.2.4", "react-syntax-highlighter": "^15.5.0", "redux": "^4.1.2", "redux-immutable": "^4.0.0", "remarkable": "^2.0.1", "reselect": "^4.1.5", "serialize-error": "^8.1.0", "sha.js": "^2.4.11", "swagger-client": "^3.18.5", "url-parse": "^1.5.8", "xml": "=1.0.1", "xml-but-prettier": "^1.0.1", "zenscroll": "^4.0.2" },
Has this project been reviewed before?
An earlier version of Swagger UI is already exposed on WMF sites under https://en.wikipedia.org/api/rest_v1/. This path is proxied from RESTbase, which exposes this UI. If we had the new version in MediaWiki, we would use that to visualize the spec exposed by RESTbase. We wouldn't need to have two versions in production.
Working test environment
On a MediaWiki installation, apply https://gerrit.wikimedia.org/r/c/mediawiki/core/+/863987 and visit Special:REST.
Post-deployment
Integration of Swagger UI with MediaWiki will be maintained by Platform Engineering (API Platform)