Skip to content

Commit 94859f5

Browse files
committed
added update instructions
Signed-off-by: fenn-cs <[email protected]>
1 parent 7813f8c commit 94859f5

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,30 @@
11
# phpList REST API swagger-ui
22
OpenAPI Documentation for [phpList/rest-api](github.com/phpList/rest-api) ove Swaggger UI
3+
4+
# Updating
5+
6+
We use`swagger-ui-dist` which is the compiled version of swagger UI for server side projects. It's simply a copy of the `dist` directory from the[Swagger UI Repo](https://github.com/swagger-api/swagger-ui)) stored.
7+
8+
So if there are updates in the UI we would like to have, the fastest way to update our copy of swagger UI would be to clone the entire swagger UI [repository](https://github.com/swagger-api/swagger-ui) and copy the contents of `dist` to `public/docs` and make the required changes in `index.html`. That includes making sure the assets (javascript and css) are pointing to the right place (`/restapi-docs/`) and that `SwaggerUIBundle` is referencing `/restapi-docs/restapi.json` correctly as shown bellow;
9+
10+
```js
11+
window.onload = function() {
12+
// Begin Swagger UI call region
13+
const ui = SwaggerUIBundle({
14+
url: "/restapi-docs/restapi.json",
15+
dom_id: '#swagger-ui',
16+
deepLinking: true,
17+
presets: [
18+
SwaggerUIBundle.presets.apis,
19+
SwaggerUIStandalonePreset
20+
],
21+
plugins: [
22+
SwaggerUIBundle.plugins.DownloadUrl
23+
],
24+
layout: "StandaloneLayout"
25+
});
26+
// End Swagger UI call region
27+
28+
window.ui = ui;
29+
};
30+
```

0 commit comments

Comments
 (0)