Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed missing global params #280

Merged
merged 1 commit into from
May 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading