File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ export class GlobalParameterConsolidator {
1414 */
1515 consolidate ( ) : OpenAPIV3 . Document {
1616 this . createGlobalParamsSchema ( ) ;
17+ this . createGlobalParamsParameter ( ) ;
1718 this . replaceGlobalParamsInPaths ( ) ;
1819 return this . root ;
1920 }
@@ -63,6 +64,26 @@ export class GlobalParameterConsolidator {
6364 ( this . root . components . schemas as any ) . GlobalParams = globalParamsSchema ;
6465 }
6566
67+ private createGlobalParamsParameter ( ) : void {
68+ if ( ! this . root . components ) {
69+ this . root . components = { } ;
70+ }
71+ if ( ! this . root . components . parameters ) {
72+ this . root . components . parameters = { } ;
73+ }
74+
75+ const globalParamsParam : any = {
76+ name : 'globalParams' ,
77+ in : 'query' ,
78+ description : 'Global query parameters' ,
79+ schema : {
80+ $ref : '#/components/schemas/GlobalParams' ,
81+ }
82+ } ;
83+
84+ ( this . root . components . parameters as any ) . globalParams = globalParamsParam ;
85+ }
86+
6687 private replaceGlobalParamsInPaths ( ) : void {
6788 if ( ! this . root . paths ) {
6889 return ;
You can’t perform that action at this time.
0 commit comments