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:
parent
1bba76413f
commit
2c7b7c90e0
@ -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),
|
||||||
|
@ -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',
|
||||||
|
@ -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<
|
||||||
|
Loading…
Reference in New Issue
Block a user