Skip to content

Commit

Permalink
feat: implement advanced search for all supported endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
mostafa committed Jul 31, 2024
1 parent cdc080f commit e887f3a
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion packages/core/src/routes/swagger/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,18 @@ const anonymousPaths = new Set<string>([
'status',
]);

const advancedSearchPaths = new Set<string>([
'/applications',
'/applications/:applicationId/roles',
'/resources/:resourceId/scopes',
'/roles/:id/applications',
'/roles/:id/scopes',
'/roles',
'/roles/:id/users',
'/users',
'/users/:userId/roles',
]);

type RouteObject = {
path: string;
method: OpenAPIV3.HttpMethods;
Expand All @@ -73,7 +85,7 @@ const buildOperation = (
const queryParameters = [
...buildParameters(query, 'query'),
...(hasPagination ? paginationParameters : []),
...(path === '/users' && method === 'get' ? [searchParameters] : []),
...(advancedSearchPaths.has(path) && method === 'get' ? [searchParameters] : []),
];

const requestBody = body && {
Expand Down

0 comments on commit e887f3a

Please sign in to comment.