📝 fix Swagger docs (#355)

This commit is contained in:
Anton Shepilov
2024-02-02 19:37:53 +03:00
committed by GitHub
parent 5621d6b305
commit b35687829c
4 changed files with 18 additions and 5 deletions
@@ -17,6 +17,7 @@
"level": "LOG_LEVEL"
},
"webserver": {
"host": "TWAKE_DRIVE_HOST",
"logger": {
"level": "LOG_LEVEL"
},
+1
View File
@@ -43,6 +43,7 @@
}
},
"webserver": {
"host": "localhost",
"port": 4000,
"logger": {
"level": "info"
@@ -15,7 +15,6 @@ import { SkipCLI } from "../../framework/decorators/skip";
import fs from "fs";
import { ExecutionContext, executionStorage } from "../../framework/execution-storage";
// import { throws } from "assert";
export default class WebServerService extends TdriveService<WebServerAPI> implements WebServerAPI {
name = "webserver";
version = "1";
@@ -81,15 +80,15 @@ export default class WebServerService extends TdriveService<WebServerAPI> implem
swagger: {
info: {
title: "Tdrive Swagger",
description: "Automatically generate Tdrive Swagger API",
description: "Automatically generated Twake Drive Swagger API",
version: "0.1.0",
},
externalDocs: {
url: "http://linagora.github.io/Tdrive",
url: "https://linagora.github.io/twake-drive",
description: "Find more info here",
},
host: "localhost",
schemes: ["http"],
host: this.configuration.get<string>("host"),
schemes: ["https", "http"],
consumes: ["application/json"],
produces: ["application/json"],
tags: [],
@@ -130,6 +130,17 @@ export const getUserSchema = {
required: ["resource"],
},
},
tags: ["User"],
params: {
type: "object",
description: "Users",
properties: {
id: {
description: "User ID",
type: "string",
},
},
},
};
export const setUserPreferencesSchema = {
@@ -146,6 +157,7 @@ export const setUserPreferencesSchema = {
},
required: [] as any[],
},
tags: ["User"],
response: {
"2xx": userObjectSchema.properties.preferences,
},