diff --git a/powershell/llcsharp/operation/method.ts b/powershell/llcsharp/operation/method.ts index 1efd7117ed6..a18586b58a3 100644 --- a/powershell/llcsharp/operation/method.ts +++ b/powershell/llcsharp/operation/method.ts @@ -396,20 +396,20 @@ export class NewOperationMethod extends Method { // replace any server params in the uri for (const pp of serverParams) { - url = url.replace(`{${pp.param.language.csharp?.name}}`, `" + url = url.replace(`{${pp.param.language.default.serializedName}}`, `" + ${pp.name} + "`); } for (const pp of pathParams) { - rx = rx.replace(`{${pp.param.language.csharp?.name}}`, `(?<${pp.param.language.csharp?.name}>[^/]+)`); + rx = rx.replace(`{${pp.param.language.default.serializedName}}`, `(?<${pp.param.language.default.serializedName}>[^/]+)`); if (this.viaIdentity) { - url = url.replace(`{${pp.param.language.csharp?.name}}`, `" + url = url.replace(`{${pp.param.language.default.serializedName}}`, `" + ${pp.name} + "`); } else { - url = url.replace(`{${pp.param.language.csharp?.name}}`, `" + url = url.replace(`{${pp.param.language.default.serializedName}}`, `" + ${newRemoveEncoding(pp, '', KnownMediaType.UriParameter)} + "`); } @@ -435,7 +435,7 @@ export class NewOperationMethod extends Method { yield EOL; yield '// replace URI parameters with values from identity'; for (const pp of pathParams) { - yield `var ${pp.name} = ${match.value}.Groups["${pp.param.language.csharp?.name}"].Value;`; + yield `var ${pp.name} = ${match.value}.Groups["${pp.param.language.default.serializedName}"].Value;`; } } @@ -469,7 +469,7 @@ export class NewOperationMethod extends Method { // content length is set when the request body is set continue; } - yield hp.serializeToContainerMember(KnownMediaType.Header, new LocalVariable('request.Headers', dotnet.Var), hp.param.language.csharp?.serializedName || hp.param.language.default.serializedName, ClientRuntime.SerializationMode.None); + yield hp.serializeToContainerMember(KnownMediaType.Header, new LocalVariable('request.Headers', dotnet.Var), hp.param.language.default.serializedName, ClientRuntime.SerializationMode.None); } yield EOL; } diff --git a/powershell/package.json b/powershell/package.json index 308f6e460d6..1579cc13cf0 100644 --- a/powershell/package.json +++ b/powershell/package.json @@ -66,4 +66,4 @@ "source-map-support": "0.5.13", "xmlbuilder": "10.1.1" } -} \ No newline at end of file +} diff --git a/powershell/plugins/cs-namer-v2.ts b/powershell/plugins/cs-namer-v2.ts index 5e15783833b..260dc095464 100644 --- a/powershell/plugins/cs-namer-v2.ts +++ b/powershell/plugins/cs-namer-v2.ts @@ -140,6 +140,8 @@ function setSchemaNames(schemaGroups: Dictionary>, azure: boolean, namespace: '', fullname: '' }; + // xichen: for invalid namespace case, we won't create model class. So we do not need consider dup case + thisNamespace.delete(schemaName); } // name each property in this schema diff --git a/powershell/plugins/llcsharp.ts b/powershell/plugins/llcsharp.ts index 0d84bd25793..b4735cdffbf 100644 --- a/powershell/plugins/llcsharp.ts +++ b/powershell/plugins/llcsharp.ts @@ -12,21 +12,11 @@ import { Dictionary } from '@azure-tools/linq'; const resources = `${__dirname}/../../resources`; -function outerTest(service: Host, project: Project, fname: string, content: string) { - service.WriteFile(join(project.apifolder, fname), test(content, project.overrides), undefined, 'source-file-csharp'); -} - -function test(content: string, overrides: Dictionary): string { - const a = applyOverrides(content, overrides); - return a; -} - export async function llcsharp(service: Host) { try { const project = await new Project(service).init(); - await project.writeFiles(async (fname, content) => service.WriteFile(join(project.apifolder, fname), test(content, project.overrides), undefined, 'source-file-csharp')); - await project.writeFiles(async (fname, content) => outerTest(service, project, fname, content)); + await project.writeFiles(async (fname, content) => service.WriteFile(join(project.apifolder, fname), applyOverrides(content, project.overrides), undefined, 'source-file-csharp')); // recursive copy resources await copyResources(join(resources, 'runtime', 'csharp', 'client'), async (fname, content) => service.WriteFile(join(project.runtimefolder, fname), content, undefined, 'source-file-csharp'), project.overrides); diff --git a/tests-upgrade/Configuration.json b/tests-upgrade/Configuration.json index 73ac6021127..2bf7cc7583e 100644 --- a/tests-upgrade/Configuration.json +++ b/tests-upgrade/Configuration.json @@ -32,7 +32,10 @@ "extension-ms-discriminatorvalue", "extension-ms-examples", "extension-ms-longruningoperation", - "extension-ms-pageable" + "extension-ms-pageable", + "directive-aliasremoval", + "directive-cmdlet", + "directive-parameter" ], "BlackList": [ "basic-get-querystr",