1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-02-04 00:18:01 +01:00

refactor: type query params (#5153)

This commit is contained in:
Mateusz Kwasniewski 2023-10-26 10:05:47 +02:00 committed by GitHub
parent 1bba76413f
commit 2c7b7c90e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 4 deletions

View File

@ -55,8 +55,8 @@ export default class FeatureSearchController extends Controller {
summary: 'Search and filter features', summary: 'Search and filter features',
description: 'Search and filter by selected fields.', description: 'Search and filter by selected fields.',
operationId: 'searchFeatures', operationId: 'searchFeatures',
// TODO: fix the type // top level array needs to be mutable according to openapi library
parameters: featureSearchQueryParameters as any, parameters: [...featureSearchQueryParameters],
responses: { responses: {
200: createResponseSchema('searchFeaturesSchema'), 200: createResponseSchema('searchFeaturesSchema'),
...getStandardResponses(401, 403, 404), ...getStandardResponses(401, 403, 404),

View File

@ -5,7 +5,7 @@ export const featureSearchQueryParameters = [
name: 'query', name: 'query',
schema: { schema: {
default: '', default: '',
type: 'string' as const, type: 'string',
example: 'feature_a', example: 'feature_a',
}, },
description: 'The search query for the feature or tag', description: 'The search query for the feature or tag',
@ -15,7 +15,7 @@ export const featureSearchQueryParameters = [
name: 'projectId', name: 'projectId',
schema: { schema: {
default: '', default: '',
type: 'string' as const, type: 'string',
example: 'default', example: 'default',
}, },
description: 'Id of the project where search is performed', description: 'Id of the project where search is performed',

View File

@ -11,6 +11,7 @@ type OpenApiParam = {
// Parameter types: // Parameter types:
// https://swagger.io/docs/specification/describing-parameters/#types // https://swagger.io/docs/specification/describing-parameters/#types
readonly in: 'query' | 'path' | 'header' | 'cookie'; readonly in: 'query' | 'path' | 'header' | 'cookie';
readonly description?: string;
}; };
type RecurseOnParams< type RecurseOnParams<