diff --git a/src/controllers/UserController.ts b/src/controllers/UserController.ts index c87536e..c528572 100644 --- a/src/controllers/UserController.ts +++ b/src/controllers/UserController.ts @@ -25,7 +25,7 @@ export class UserController { @Get() @Authorized("USER:GET") - @ResponseSchema(User, { isArray: true }) + @ResponseSchema(ResponseUser, { isArray: true }) @OpenAPI({ description: 'Lists all users.
This includes their groups and permissions directly granted to them (if existing/associated).' }) async getAll() { let responseUsers: ResponseUser[] = new Array(); @@ -38,7 +38,7 @@ export class UserController { @Get('/:id') @Authorized("USER:GET") - @ResponseSchema(User) + @ResponseSchema(ResponseUser) @ResponseSchema(UserNotFoundError, { statusCode: 404 }) @OnUndefined(UserNotFoundError) @OpenAPI({ description: 'Lists all information about the user whose id got provided.
Please remember that only permissions granted directly to the user will show up here, not permissions inherited from groups.' }) @@ -50,7 +50,7 @@ export class UserController { @Post() @Authorized("USER:CREATE") - @ResponseSchema(User) + @ResponseSchema(ResponseUser) @ResponseSchema(UserGroupNotFoundError) @OpenAPI({ description: 'Create a new user.
If you want to grant permissions to the user you have to create them seperately by posting to /api/permissions after creating the user.' }) async post(@Body({ validate: true }) createUser: CreateUser) { @@ -67,7 +67,7 @@ export class UserController { @Put('/:id') @Authorized("USER:UPDATE") - @ResponseSchema(User) + @ResponseSchema(ResponseUser) @ResponseSchema(UserNotFoundError, { statusCode: 404 }) @ResponseSchema(UserIdsNotMatchingError, { statusCode: 406 }) @OpenAPI({ description: "Update the user whose id you provided.
To change the permissions directly granted to the user please use /api/permissions instead.
Please remember that ids can't be changed." }) @@ -88,7 +88,7 @@ export class UserController { @Delete('/:id') @Authorized("USER:DELETE") - @ResponseSchema(User) + @ResponseSchema(ResponseUser) @ResponseSchema(ResponseEmpty, { statusCode: 204 }) @OnUndefined(204) @OpenAPI({ description: 'Delete the user whose id you provided.
If there are any permissions directly granted to the user they will get deleted as well.
If no user with this id exists it will just return 204(no content).' })