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

RLC: enable a flag for tsp interface as operation group name #1911

Merged
merged 17 commits into from
Jul 6, 2023
1 change: 1 addition & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
"name": "[TypeSpec] Smoke Test Debug",
"request": "launch",
"cwd": "${workspaceFolder}/packages/typespec-test/test/openai_modular",

MaryGao marked this conversation as resolved.
Show resolved Hide resolved
"runtimeArgs": ["tsp", "compile", "./spec"],
"runtimeExecutable": "npx",
"skipFiles": ["<node_internals>/**"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,7 @@ export function transformOptions(model: CodeModel): RLCOptions {
options.credentialScopes = credentialScopes;
options.credentialKeyHeaderName = credentialKeyHeaderName;
options.sourceFrom = "Swagger";
// Always enable operation group prefix for swagger
options.enableOperationGroup = true;
return options;
}
5 changes: 4 additions & 1 deletion packages/rlc-common/src/buildClientDefinitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,10 @@ function getOperationReturnTypeName(
operationGroupName &&
operationGroupName !== "Client"
) {
return `${pascalCase(operationGroupName)}${pascalCase(name)}`;
return normalizeName(
`${pascalCase(operationGroupName)}${pascalCase(name)}`,
NameType.Interface
);
}

return pascalCase(name);
Expand Down
1 change: 1 addition & 0 deletions packages/rlc-common/src/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ export interface RLCOptions {
azureArm?: boolean;
sourceFrom?: "Cadl" | "Swagger";
isModularLibrary?: boolean;
enableOperationGroup?: boolean | string;
MaryGao marked this conversation as resolved.
Show resolved Hide resolved
}

export interface ServiceInfo {
Expand Down

Large diffs are not rendered by default.

Loading