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

Commit

Permalink
Merge pull request #110 from fearthecowboy/master
Browse files Browse the repository at this point in the history
make sure flattener is called right, add x-ms-skip-url-encoding for p…
  • Loading branch information
fearthecowboy authored Jan 9, 2020
2 parents 45f999e + 5c90b78 commit 40935bd
Show file tree
Hide file tree
Showing 53 changed files with 98,617 additions and 2 deletions.
3 changes: 2 additions & 1 deletion modelerfour/flattener/flattener.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ export class Flattener {
// support '--payload-flattening-threshold:X' global setting

if (this.options['flatten-models'] !== false) {
return;
//return this.codeModel;

for (const schema of values(this.codeModel.schemas.objects)) {
this.flattenSchema(schema);
}
Expand Down
2 changes: 1 addition & 1 deletion modelerfour/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { processRequest as flattener } from './flattener/plugin-flattener';
export async function initializePlugins(pluginHost: AutoRestExtension) {
pluginHost.Add('modelerfour', modelerfour);
pluginHost.Add('pre-namer', preNamer);
pluginHost.Add('flatten', flattener);
pluginHost.Add('flattener', flattener);
}

async function main() {
Expand Down
6 changes: 6 additions & 0 deletions modelerfour/modeler/modelerfour.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1036,6 +1036,12 @@ export class ModelerFour {
}
}));

// if allowReserved is present, add the extension attribute too.
if (parameter.allowReserved) {
newParam.extensions = newParam.extensions ?? {};
newParam.extensions['x-ms-skip-url-encoding'] = true;
}

if (implementation === ImplementationLocation.Client) {
this.codeModel.addGlobalParameter(newParam);
}
Expand Down
Loading

0 comments on commit 40935bd

Please sign in to comment.