Add basic swagger documentation

accessible by running with -swagger. Accessible at /swagger/index.html.
Currently doesn't have authentication setup, so no requests will work.
This commit is contained in:
Harvey Tindall
2020-09-24 17:51:13 +01:00
parent 544f5674e8
commit b6537cef65
12 changed files with 3254 additions and 144 deletions
+5 -4
View File
@@ -144,15 +144,16 @@ const populateProfiles = (noTable?: boolean): void => _get("/profiles", null, fu
const profileList = document.getElementById('profileList');
profileList.textContent = '';
availableProfiles = [this.response["default_profile"]];
for (let name in this.response) {
for (let name in this.response["profiles"]) {
if (name != availableProfiles[0]) {
availableProfiles.push(name);
}
const reqProfile = this.response["profiles"][name];
if (!noTable && name != "default_profile") {
const profile: Profile = {
Admin: this.response[name]["admin"],
LibraryAccess: this.response[name]["libraries"],
FromUser: this.response[name]["fromUser"]
Admin: reqProfile["admin"],
LibraryAccess: reqProfile["libraries"],
FromUser: reqProfile["fromUser"]
};
profileList.innerHTML += `
<td nowrap="nowrap" class="align-middle"><strong>${name}</strong></td>