Skip to content

Commit

Permalink
Fixed missing global params (#280)
Browse files Browse the repository at this point in the history
Signed-off-by: Theo Truong <theotr@amazon.com>
  • Loading branch information
nhtruong committed May 3, 2024
1 parent 287ea69 commit a8822aa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions spec/_global_parameters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion tools/merger/GlobalParamsGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ export default class GlobalParamsGenerator {
const params = (spec.components?.parameters ?? {}) as Record<string, OpenAPIV3.ParameterObject>
_.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
}
Expand Down

0 comments on commit a8822aa

Please sign in to comment.