diff --git a/src/controllers/rest.controller.ts b/src/controllers/rest.controller.ts index 3ef1da9..8914f7f 100644 --- a/src/controllers/rest.controller.ts +++ b/src/controllers/rest.controller.ts @@ -1,5 +1,5 @@ import { Inject, Constant, Controller, Get } from "@tsed/common"; -import { ContentType, Description, Summary } from "@tsed/schema"; +import { ContentType, Description, Returns, Summary } from "@tsed/schema"; import { SwaggerSettings } from "@tsed/swagger"; import moment from "moment"; import { KeycloakAuth } from "src/decorators/KeycloakAuthOptions.decorator"; @@ -13,6 +13,7 @@ export class RestController { @Get("/") @Summary("Root route of the API") @Description("Return a message and time.") + @Returns(200, Object) get() { return { message: "hello world!", @@ -21,6 +22,9 @@ export class RestController { } @Get("/protected") + @Summary("Protected route of the API") + @Description("Return a greeting when user is authenticated.") + @Returns(200, Object) @KeycloakAuth({ role: "realm:user" }) protected() { return { "test": "ahoj" };