diff --git a/src/lib/routes/admin-api/favorites.ts b/src/lib/routes/admin-api/favorites.ts index 55ca0a2484..28cd93b88e 100644 --- a/src/lib/routes/admin-api/favorites.ts +++ b/src/lib/routes/admin-api/favorites.ts @@ -3,7 +3,7 @@ import Controller from '../controller'; import { FavoritesService, OpenApiService } from '../../services'; import { Logger } from '../../logger'; import { IUnleashConfig, IUnleashServices, NONE } from '../../types'; -import { emptyResponse } from '../../openapi'; +import { emptyResponse, getStandardResponses } from '../../openapi'; import { IAuthRequest } from '../unleash-types'; export default class FavoritesController extends Controller { @@ -34,7 +34,13 @@ export default class FavoritesController extends Controller { openApiService.validPath({ tags: ['Features'], operationId: 'addFavoriteFeature', - responses: { 200: emptyResponse }, + summary: 'Add feature to favorites', + description: + 'This endpoint marks the feature in the url as favorite', + responses: { + 200: emptyResponse, + ...getStandardResponses(401, 404), + }, }), ], }); @@ -48,7 +54,13 @@ export default class FavoritesController extends Controller { openApiService.validPath({ tags: ['Features'], operationId: 'removeFavoriteFeature', - responses: { 200: emptyResponse }, + summary: 'Remove feature from favorites', + description: + 'This endpoint removes the feature in the url from favorites', + responses: { + 200: emptyResponse, + ...getStandardResponses(401, 404), + }, }), ], }); @@ -61,8 +73,14 @@ export default class FavoritesController extends Controller { middleware: [ openApiService.validPath({ tags: ['Features'], + summary: 'Add project to favorites', + description: + 'This endpoint marks the project in the url as favorite', operationId: 'addFavoriteProject', - responses: { 200: emptyResponse }, + responses: { + 200: emptyResponse, + ...getStandardResponses(401, 404), + }, }), ], }); @@ -75,8 +93,14 @@ export default class FavoritesController extends Controller { middleware: [ openApiService.validPath({ tags: ['Features'], + summary: 'Remove project from favorites', + description: + 'This endpoint removes the project in the url from favorites', operationId: 'removeFavoriteProject', - responses: { 200: emptyResponse }, + responses: { + 200: emptyResponse, + ...getStandardResponses(401, 404), + }, }), ], }); diff --git a/src/test/e2e/api/admin/favorites.e2e.test.ts b/src/test/e2e/api/admin/favorites.e2e.test.ts index 955b9ba903..0229849ee4 100644 --- a/src/test/e2e/api/admin/favorites.e2e.test.ts +++ b/src/test/e2e/api/admin/favorites.e2e.test.ts @@ -81,7 +81,13 @@ const getProjects = async () => { beforeAll(async () => { db = await dbInit('favorites_api_serial', getLogger); - app = await setupAppWithAuth(db.stores); + app = await setupAppWithAuth(db.stores, { + experimental: { + flags: { + strictSchemaValidation: true, + }, + }, + }); stores = db.stores; accessService = app.services.accessService;