diff --git a/src/lib/features/feature-search/feature-search-controller.ts b/src/lib/features/feature-search/feature-search-controller.ts index 6a514ffd42..fdfa5427f3 100644 --- a/src/lib/features/feature-search/feature-search-controller.ts +++ b/src/lib/features/feature-search/feature-search-controller.ts @@ -55,8 +55,8 @@ export default class FeatureSearchController extends Controller { summary: 'Search and filter features', description: 'Search and filter by selected fields.', operationId: 'searchFeatures', - // TODO: fix the type - parameters: featureSearchQueryParameters as any, + // top level array needs to be mutable according to openapi library + parameters: [...featureSearchQueryParameters], responses: { 200: createResponseSchema('searchFeaturesSchema'), ...getStandardResponses(401, 403, 404), diff --git a/src/lib/openapi/spec/feature-search-query-parameters.ts b/src/lib/openapi/spec/feature-search-query-parameters.ts index e97ba4db80..2844d959e2 100644 --- a/src/lib/openapi/spec/feature-search-query-parameters.ts +++ b/src/lib/openapi/spec/feature-search-query-parameters.ts @@ -5,7 +5,7 @@ export const featureSearchQueryParameters = [ name: 'query', schema: { default: '', - type: 'string' as const, + type: 'string', example: 'feature_a', }, description: 'The search query for the feature or tag', @@ -15,7 +15,7 @@ export const featureSearchQueryParameters = [ name: 'projectId', schema: { default: '', - type: 'string' as const, + type: 'string', example: 'default', }, description: 'Id of the project where search is performed', diff --git a/src/lib/openapi/util/from-query-params.ts b/src/lib/openapi/util/from-query-params.ts index 26993789e6..3bba3987e7 100644 --- a/src/lib/openapi/util/from-query-params.ts +++ b/src/lib/openapi/util/from-query-params.ts @@ -11,6 +11,7 @@ type OpenApiParam = { // Parameter types: // https://swagger.io/docs/specification/describing-parameters/#types readonly in: 'query' | 'path' | 'header' | 'cookie'; + readonly description?: string; }; type RecurseOnParams<