From 03a45f457773be4f81d47e12953eca3bd3b54a95 Mon Sep 17 00:00:00 2001 From: Theo Truong Date: Fri, 3 May 2024 07:54:08 -0600 Subject: [PATCH] Fixed missing global params Signed-off-by: Theo Truong --- spec/_global_parameters.yaml | 10 +++++----- tools/merger/GlobalParamsGenerator.ts | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/spec/_global_parameters.yaml b/spec/_global_parameters.yaml index 9a2cd00e..e1f1b5ee 100644 --- a/spec/_global_parameters.yaml +++ b/spec/_global_parameters.yaml @@ -4,34 +4,34 @@ info: version: '' components: parameters: - _global::query.pretty: + pretty: name: pretty in: query description: Whether to pretty format the returned JSON response. schema: type: boolean default: false - _global::query.human: + human: name: human in: query description: Whether to return human readable values for statistics. schema: type: boolean default: true - _global::query.error_trace: + error_trace: name: error_trace in: query description: Whether to include the stack trace of returned errors. schema: type: boolean default: false - _global::query.source: + source: name: source in: query description: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. schema: type: string - _global::query.filter_path: + filter_path: name: filter_path in: query description: Comma-separated list of filters used to reduce the response. diff --git a/tools/merger/GlobalParamsGenerator.ts b/tools/merger/GlobalParamsGenerator.ts index df84ff8c..612c18fa 100644 --- a/tools/merger/GlobalParamsGenerator.ts +++ b/tools/merger/GlobalParamsGenerator.ts @@ -27,9 +27,9 @@ export default class GlobalParamsGenerator { const params = (spec.components?.parameters ?? {}) as Record _.entries(params).forEach(([original_key, param]) => { const global_key = `_global::${param.in}.${param.name}` - params[global_key] = param _.set(param, 'x-global', true) _.unset(params, original_key) + params[global_key] = param }) return params }