Skip to content

Commit

Permalink
fix swagger
Browse files Browse the repository at this point in the history
  • Loading branch information
gmesserman committed Dec 25, 2020
1 parent b457ddc commit ff69545
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/app.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,12 @@ export class AppController {
@ApiProduces("text/plain")
@ApiConsumes("text/plain")
@ApiBody({
type: "string",
description:
'Template for rendering by doT. Expects plain text as request body',
})
@ApiProduces('text/plain')
@ApiResponse({
description: 'Rendered result',
type: String,
status: 200
})
@Post('render')
async renderTemplate(@Req() req): Promise<string> {
Expand Down Expand Up @@ -113,7 +111,8 @@ export class AppController {
description: 'Launches system command on server',
})
@ApiResponse({
type: "string",
type: String,
status: 200
})
async launchCommand(@Query('command') command: string): Promise<string> {
this.log.debug(`launchCommand with ${command}`);
Expand Down Expand Up @@ -151,6 +150,7 @@ export class AppController {
})
@ApiResponse({
type: AppConfig,
status: 200
})
@Get('/config')
getConfig(): AppConfig {
Expand Down
3 changes: 3 additions & 0 deletions src/testimonials/testimonials.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export class TestimonialsController {
})
@ApiResponse({
type: ITestimonial,
status: 200
})
async createTestimonial(
@Body() req: CreateTestimonialRequest,
Expand All @@ -51,6 +52,7 @@ export class TestimonialsController {
@ApiResponse({
type: ITestimonial,
isArray: true,
status: 200
})
async getTestimonials(): Promise<ITestimonial[]> {
this.log.debug('Called createTestimonial');
Expand All @@ -66,6 +68,7 @@ export class TestimonialsController {
})
@ApiResponse({
type: String,
status: 200
})
async getCount(@Query('query') query: string): Promise<string> {
this.log.debug('getCount');
Expand Down
3 changes: 3 additions & 0 deletions src/users/users.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export class UsersController {
})
@ApiResponse({
type: IUser,
status: 200
})
async getUser(@Param('email') email: string): Promise<IUser> {
try {
Expand Down Expand Up @@ -124,6 +125,7 @@ export class UsersController {
@ApiResponse({
type: IUser,
isArray: true,
status: 200
})
async ldapQuery(@Query('query') query: string): Promise<IUser[]> {
try {
Expand Down Expand Up @@ -159,6 +161,7 @@ export class UsersController {
})
@ApiResponse({
type: IUser,
status: 200
})
async createUser(@Body() user: CreateUserRequest): Promise<IUser> {
try {
Expand Down

0 comments on commit ff69545

Please sign in to comment.