Skip to content
This repository has been archived by the owner on Oct 11, 2023. It is now read-only.

Commit

Permalink
make sure client apiversion parameter ends up in global set
Browse files Browse the repository at this point in the history
  • Loading branch information
fearthecowboy committed Jan 13, 2020
1 parent d1f7c9b commit 8c2450f
Show file tree
Hide file tree
Showing 22 changed files with 2,584 additions and 5,750 deletions.
10 changes: 9 additions & 1 deletion modelerfour/modeler/modelerfour.ts
Original file line number Diff line number Diff line change
Expand Up @@ -988,7 +988,12 @@ export class ModelerFour {
value: new ConstantValue(apiversions[0])
}));

return op.request.addParameter(new Parameter('ApiVersion', 'Api Version', apiVersionConst, {
const p = this.codeModel.findGlobalParameter(each => each.language.default.name === 'ApiVersion');
if (p) {
return op.request.addParameter(p);
}

const apiVersionParameter = op.request.addParameter(new Parameter('ApiVersion', 'Api Version', apiVersionConst, {
required: parameter.required ? true : undefined,
//implementation: 'client' === <any>parameter['x-ms-parameter-location'] ? ImplementationLocation.Client : ImplementationLocation.Method,
implementation: ImplementationLocation.Client,
Expand All @@ -1001,6 +1006,9 @@ export class ModelerFour {
}
}
}));

this.codeModel.addGlobalParameter(apiVersionParameter);
return apiVersionParameter;
}

// multiple api versions. okaledokaley
Expand Down
Loading

0 comments on commit 8c2450f

Please sign in to comment.